Forums

IAR C-compiler for AVR: Array of pointers to strings in flash

Started by Erik Cato February 3, 2004
erik.cato@japro.se (Erik Cato) writes:

> Mats Kindahl <mats.kindahl@nowhere.net> wrote in message > > > >> What are you going to do with all the strings? If you are going to > > >> write them out, you will have to recompile (parts of) the library > > >> to get a printf() version accepting pointers into flash memory. > > > > We are writing special functions for displaying text so there is no > > > need for printf. > > > Then you will have no problems (in this regard, at least). > > > You do know that you can reuse the printf() implementation if you need > > more advanced printing? It can also be configured to exclude some > > support that is not needed (for example, printing floating-point > > numbers). > > > > Best wishes, > > Mats Kindahl > > No, I didn&#2013266100;t know this. How? Can you point me to where i can find more info > in this issue.
You have all the source for the libraries under 'src' in the installation root for the AVR Workbench (which is in the directory 'D:/Program Files/IAR Systems/Ew23/avr' on my computer). Basically what you have to do is to recompile the write formatter (IIRC, in file frmwri.c, but you have to look that up) and maybe some other files containing printf; If you just make a copy of them and add them to your project the linker will select your functions instead of those in the precompiled libraries. There are some descriptions about this in the C Compiler Manual (look for _formatted_write... at pages 32-38 in my version), but to get support specifically on your problem I suggest you contact our support department: they are really good at solving these kinds of problems and have more experience with all the details. You find them on: http://www.iar.com/Support/EW/ You will also find application notes and technical articles at the same place. Best wishes, Mats Kindahl -- IAR Systems in Uppsala, Sweden. Any opinions expressed are my own and not those of my company. Spam prevention: contact me at mNaOtSkPiAnM@acm.org or mNaOtSs.kPindAahMl@iar.se, removing the *NO SPAM* from the address.