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.

TMS320F28069F: Copying new image from SPI flash

Part Number: TMS320F28069F

I have finally got the SPI routines to work, where I can write/read data from the external SPI flash device. The idea is to read a new image (NewImage.hex) from a USB drive, and then copy that data into the SPI flash. Once copied, I would reset myself, and have the CurImage.hex detect that there is a new image on the SPI flash, execute a copy function from RAM to copy the data out of SPI flash and over-write CurImage.hex.

Once I have written NewImage.hex over the CurImage.hex, the device will reset and start executing NewImage.hex.

How do I do this?

I want everything to be integrated into one image, so I don't have the luxury have having a SecondaryBoot image, etc (as referenced in ).

How do I do the following:

a) specify the SPI read function to live in RAM

b) copy the image from SPI flash to overwrite the existing image (do I have to use the SCI method, or is there a quicker method to replace the internal flash image)?

c) reset the code so that NewImage.hex can run (simply jump to 0x0?)?

  • Parang,

    Please see the following Threads:
    e2e.ti.com/.../1985962
    e2e.ti.com/.../1946958

    These should help get you stared.

    Also, Have you read through the Serial flash programming users guide?
    http://www.ti.com/lit/sprabv4

    to answer your questions, 

    a) You will use the  #pragma CODE_SECTION() compiler directive, to indicate that you want a function to be in "ramfuncs"  Many of our examples show this. You can look at the Example_28069Flash example for the epwm1_timer_isr  declaration in the main .c file.

    b) you do not have to use the SCI method. You can just read SPI functions and then write the new Flash image using the flash API calls. 

    c) If you completely overwrite the existing image, and the image uses the same sectors and reset vectors, you should be able to reset and have the device boot from the flash image on next reset. 

    Thanks,

    Mark