Hi,
I'm looking at the Hercules SPI bootloader example from: http://processors.wiki.ti.com/index.php/RM4x_Hercules_MCU_Bootloader
I stepped through the code and I am confused how the bootloader is able to reprogram itself.
It appears that only the flashAPIs are being copied and ran from SRAM.
Specifically, when I reach the function UpdaterSPI(spiBase_t *node), it is running at around address 0x000015a8 instead of in SRAM ( around 0x08000000). Thus, when it gets to the "case SPI_COMMAND_SEND_DATA", it will erase the flash starting at address 0x00000000 and destroy program execution with the function "Fapi_BlockErase( 0, 0, FLASH_FIRST_SECTOR_SIZE); "
Could I get some clarification on what I am misunderstanding from the example?
Thank You,
Harvey