Part Number: TMS570LS1224
Hi,
I have a problem with resetting the bootloader when the new application was uploaded incorrectly.
After turning on the power, the bootloader wakes up and checks if there is a flag in the memory, informing that the program is already in memory. If the flag is, it goes to the program, if not, it starts the CAN port and waits for the program to be loaded.
When the program is uploaded correctly and the checksum is correct, everything works - the processor resets, checks the flag and enters the program.
However, the problem appears when the program has been uploaded incorrectly (e.g. the checksum, calculated in hardware (CRC), does not match).
When detecting an invalid checksum, I clear the memory that is holding the invalid code and clear the flag.
After clearing the memory and the flag, I would like to jump to the address 0x00 again (software reset the application).
Unfortunately, after calling:
((void (*) (void)) 0x00000000) (); / * Use the reset in SYSECR register in case instruction above not work * / systemREG1-> SYSECR = (0x10) << 14;
processor enters undefEntry
resetEntry
b _c_int00
undefEntry
b # 0x17FF8; 0x04 // <- right here
b # 0x17FF8; vPortSWI / SVC (FREERTOS / nonRTOS)
prefetchEntry
b # 0x17FF8; prefetchEntry
b # 0x17FF8; _dabort
b # 0x17FF8; phantomInterrupt
ldr pc, [pc, # - 0x1b0]
ldr pc, [pc, # - 0x1b0]
Turning off the power to the board completely does not help as the red ERR LED lights up immediately when restarting.
The address to which I upload the application is 0x18000.
Any ideas on how to clear the memory in which the application is loaded from the bootloader and jump back to the address 0x00 without the processor freezing?