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.

TMS320F280039C: TI 280039C SPI bootloader

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello,

We are using a TI 280039C in our design. We will be needing to update the firmware over a SPI connected to another processor.

Researching this out it appears that it is a two-step process. A RAM kernel needs to be loaded that runs entirely out of RAM. It would receive the firmware update over the SPI bus and write the data to the FLASH. Once this is complete, it would then need to jump to an entry point at the start of FLASH to reboot and start execution of the updated firmware image.

Is my understanding correct?

I then went to look in the C2000Ware for code examples.

C:\ti\c2000\C2000Ware_5_02_00_00\utilities\flash_programmers

C:\ti\c2000\C2000Ware_5_02_00_00\driverlib\f28003x\examples\flash

I did find a number of different files associated with updating the flash in this last directory:

flash_kernel_ex3_boot.c
flash_kernel_ex3_sci_boot.c
flash_kernel_ex3_sci_flash_kernel.c
flash_kernel_ex4_boot.c
flash_kernel_ex4_can_flash_kernel.c
flash_kernel_ex5_boot.c
flash_kernel_ex5_dcan_flash_kernel.c
MCAN_Boot.c
but I do not believe any of these are for the SPI? 
Is there documentation on these code examples?
For example, an explanation as to the difference of flash_kernel_ex3_boot.c, flash_kernel_ex4_boot.c, and flash_kernel_ex5_boot.c?
Another place to look for a SPI example?
Thanks for your help,
Brent Williams

  • Hi Brent,

    Apologies for the late response.  Yes, you are correct.  This is a two step process where new firmware is sent through SPI bus through SPI boot then flash that new firmware.  There an extra step though for SPI as SPI boot is not part of the default boot option that are configured by the states of boot mode pins (GPIO24/32).  I'll refer you to our expert who can help guide you through the steps for SPI.

    Regards,

    Joseph

  • Thanks for the response Joseph. Looking at the C2000Ware code there does not appear to be a flash kernel for the SPI. Is that correct?

    Are there plans to add a SPI flash kernel?

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1192990/tms320f28379d-example-code-for-firmware-update-via-spi?tisearch=e2e-sitesearch&keymatch=TMS320F280049C

    I assume that I would need to modify the C:\ti\c2000\C2000Ware_5_02_00_00\driverlib\f28003x\examples\flash\flash_kernel_ex3_sci_flash_kernel example and replace SCI with SPI to come up with a custom flash kernel?

    Looking at the 280039C reference manual I see the following section:

    4.8.8.2.2 SPI Boot Mode

    The SPI loader expects an SPI-compatible 16-bit or 24-bit addressable serial EEPROM or serial Flash device to be present on the SPI-A pins as shown in Figure 4-6. The SPI bootloader supports an 8-bit data stream and does not support a 16-bit data stream.

    In our case the SPI bus would be connected to another processor so I do not believe the SPI Boot Mode would work. Is that your understanding?

    So, I believe I would need to add "custom" boot code at the beginning of our application that would be able to read in the "custom" SPI flash kernel over the SPI and write it to RAM. Once that is complete the application would jump to the "customer" flash kernel to read in the firmware update over SPI and write it to flash. Once this is done jump to the entry point at the beginning of flash to start execution of the new image. 

    Is this correct?

    Is there source code for the SPI bootloader or other(s) that I can use in C2000Ware or somewhere else?

    Thanks for your help,

    Brent Williams

  • Hi Brent,

    You are correct, there is no SPI flash kernel example in C2000Ware. You can modify the SCI flash kernel example to use SPI instead.

    The SPI bootROM loader source is available at C2000Ware_Install_Location\libraries\boot_rom\f28003x\rev0\rom_sources\F28003x_ROM\bootROM\source

    You can either have a custom bootloader to read in the SPI flash kernel, or you can configure the processor to act as the SPI "slave" and use the SPI bootloader in ROM.

    Kind regards,

    Skyler