Other Parts Discussed in Thread: C2000WARE
Tool/software:
Hello.
I am not familiar with TI microcontrollers, including the TMS320F28P659, which I am using. I wish to implement a bootloader that resides in Flash. It is my understanding that the it is possible on this mcu that the bootloader can execute from Flash in bank 0 while erasing and reprogramming a different Flash bank.
Our application will receive a serial command via SCI port A from a Firmware Update program to cause the mcu to reset, and then to invoke the bootloader directly in Flash boot mode. We have an issue with the hardware because the hardware has been hardwired so the default SCI boot pins are not able to be read by the boot loader to know what mode it should boot in, which is why it will boot directly into Flash boot mode. We are only using CPU1, so I don't have to involve it in the bootloader. The internal bootrom will start the bootloader running from Flash, and it will validate the application in Flash and execute it from Flash, or receive it will receive a command to start a firmware update, at which time it will jump to the flash kernel executing from Flash in Flash Bank 0.
There are 5 banks of Flash on the device we are using assigned to CPU1 (0-4). I want to use bank 0 to contain the bootloader code. Bank 1 will be allocated to the application. So far the application fits in a single bank.
In our setup, the normal boot procedure would be to boot to the application running from Flash in bank 1. The only way to start a firmware update would be a command via the SCI A port from a Flash update program. There has to be a way to determine whether the boot is from a power-on reset or a commanded reboot to get into the bootloader to execute the flash kernel for a firmware update. This part has me blocked, because there does not appear to be a register or NVM that a warm-boot flag can be stored in that the boot loader could read to indicate that it needs to load the Flash kernel into RAM and jump to it.
To restart the MCU from the application, there are multiple possibilities:
1. Software reset - this looks like it is the equivalent of a power-on reset, from the reference manual (via the SIMRESET register).
2. Set a Watchdog Timer, and let it expire after a short interval.
3. NMI Watchdog Reset. Using this would not be a good idea in case some other module causes it.
=
In both cases 1 and 2 above the status for the cause can be read from a regoster, but I need a way to specifically tell that a firmware update reboot has occurred.
I am also not sure if the internal bootrom or other boot code completely clears RAM or not. If it does not, I could possibly adjust the stack pointer to leave small RAM block uncleared for a reboot flag.
I am currently looking at the flash_kernel example in the C2000 software (C:\ti\c2000\C2000Ware_5_01_00_00\driverlib\f28p65x\examples\c28x_dual\flash_kernel), but that just runs from RAM. I need a working example of a bootrom that runs in flash and executes the flash_kernel from Flash.
So far, I haven't found anything that is complete for the mcu I am using.
Any help would be greatly appreciated.
Regards,
Joel Estes