I am using the ROM bootloader in a TM4C123GH6PM part to reprogram the internal flash following the protocol and state machine in spma074a. The processor is running code and is instructed to execute the bootloader with a call to ROM_UpdateSSI():
SysCtlClockSet(SYSCTL_USE_OSC | SYSCTL_SYSDIV_1 | SYSCTL_OSC_INT);
* #APP_ST_SHUTDOWN, execute #ROM_UpdateSSI to begin the ROM
* bootloader application.
* Stop the watchdog and disable all interrupts.
*/
watchdog_Disable();
//
// Disable all processor interrupts. Instead of disabling them
// one at a time, a direct write to NVIC is done to disable all
// peripheral interrupts.
//
HWREG(NVIC_DIS0) = 0xffffffff;
HWREG(NVIC_DIS1) = 0xffffffff;
HWREG(NVIC_DIS2) = 0xffffffff;
HWREG(NVIC_DIS3) = 0xffffffff;
I have implemented the SSI version of the bootloader protocol on a TM4C1294 microcontroller and, when I run it from the TM4C1294, it completes without reporting any errors. However, the TM4C123 remains locked up.
When I connect the debugger and examine the flash, addresses up to 0x00001000 program perfectly. However, after this address, the code looks like swiss cheese, peppered with words written as 0x00000000 instead of the correct firmware. These seem to be random.
I am wondering if there is some issue with transferring to the bootloader which means the flash program function is not working after the first page. I have tried slowing down the processor clock and reducing the SSI transfer speed, but the issue remains. Does anyone have any advice for what I should be looking for?
Thanks.