This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Flash API and C++

Hopefully this is an easy question. I have a board with a 28335. The application requires it to get a new flash image from a host and reflash the itself for field updates. The communication routines to the host and the flash api routines are copied to ram and run from ram. This works fine. The problem is that when I erase all the flash sections (A-H) , The .econst section is erased and destroys the VTable and that crashs the program. Is there away to put the VTable for the functions I use in ram? 

  • Hi RichS,

    Maybe the Document spraau8 can help you. It describes section copy from flash to ram for speed optimization - however I think you can use this exactly for your problem too!

    BR Andreas

  • Andreas,

    Thanks for the quick reply. Spraau8 and spra958i describe how to copy the entire econst section to ram or put an array in ram at a particular location How do I access the vtables? The econst section is large and I don't want to copy all of it to ram. 

     

  • Richs,

    spra958 has a section that describes how to copy only the vector table from flash to ram... see page 9 section 4.1

    BR Andreas

  • Thanks for the response. UnfortunatelyI did not make myself clear. I don't mean the interrupt vector table but the virtual table that goes with C++ objects. This table is a look up that resolves function calls. I have managed to isolate that table in the econst section by painfully moving all other stuff like strings to a different section. I can look at the map file and see only the virtual table is left. I can now move that table to ram. It would be nice to be able to directly tell the linker that the table will be run from ram.

  • OK, thanks for the clarification and sorry for my missleading tips. I don't have an idea how to get this reference, but I recommend you to post this question to the compiler forum, they might be more knowledgable in this topic...