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.

Re:Code execution from RAM and FLASH

Hi,

Please help me in getting sample code for erasing and writing to flash.

Also get me code to execute from RAM to erase and write to the flash area.

Best Regards,

Santosh.

  • Hi,

    Always when asking for help it is worth to specify you target micro controller - LM4F has also an EEPROM on chip - so your task can be easier, depending on how much data will be written. Related to your request: there are some routines in driverlib/flash.c file (also eeprom.c). But, unlike other micro controllers, you can erase/program flash from within flash - you don't need to move your code in RAM and execute from there (unless you need to erase all flash). For Cortex-M3 was an interesting application note -spma030.pdf - may you can still find it on TI' site.

    Petrei.

  • Hi Petrei,

    Thanks for the reply and really sorry for providing incomplete details.

    I am using LM4F232, I want to erase the older code from flash and want to update new code, so I am using external flash and will execute code from RAM

    to erase and write data to internal flash from external flash.

    Best regards,

    Santosh.

  • Hi,

    If your "external flash" is an usb stick then a good example can be found in StellarisWare/boards/lm3s9d96/usb_stick_demo project. For other types of "external" you can adapt this project.

    Petrei

  • Santosh PG said:
    really sorry for providing incomplete details.

    Unfortunate that "sorrow" seems abandoned - 2 lines down:

    Santosh PG said:
    write data to internal flash from external flash.

    Are there not many forms of external flash - and minus that detail responders forced to guess.

    You are not alone in posting, "Don't/won't Work!"  Attention to Detail "deficit" reigns supreme - posters must consider their content w/some care...