Make the left half call NVIC_SystemReset() upon receiving SlaveCommand_JumpToBootloader instead of jumping to the ROM address of the bootloader. This way the bootloader timeouts. Remove bootloader.c because it only contained JumpToBootloader() which is now unused.
This commit is contained in:
@@ -43,7 +43,7 @@ void SlaveRxHandler(void)
|
|||||||
uint8_t commandId = RxMessage.data[0];
|
uint8_t commandId = RxMessage.data[0];
|
||||||
switch (commandId) {
|
switch (commandId) {
|
||||||
case SlaveCommand_JumpToBootloader:
|
case SlaveCommand_JumpToBootloader:
|
||||||
JumpToBootloader();
|
NVIC_SystemReset();
|
||||||
break;
|
break;
|
||||||
case SlaveCommand_SetTestLed:
|
case SlaveCommand_SetTestLed:
|
||||||
TxMessage.length = 0;
|
TxMessage.length = 0;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#include "bootloader.h"
|
|
||||||
|
|
||||||
void JumpToBootloader(void) {
|
|
||||||
uint32_t runBootloaderAddress;
|
|
||||||
void (*runBootloader)(void *arg);
|
|
||||||
|
|
||||||
// Read the function address from the ROM API tree.
|
|
||||||
runBootloaderAddress = **(uint32_t **)(0x1c00001c);
|
|
||||||
runBootloader = (void (*)(void * arg))runBootloaderAddress;
|
|
||||||
|
|
||||||
runBootloader(NULL);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user