Tool/software:
My bootloader is at 0x0000 and application at 0x2000, in application if i use delayCycle then it blinks led, but when i use timer then it not working.
this is my jump application
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
My bootloader is at 0x0000 and application at 0x2000, in application if i use delayCycle then it blinks led, but when i use timer then it not working.
this is my jump application
Hi Sara,
You can try use this code to jump from bootloader to app:


__STATIC_INLINE void invokeBSLAsm(void)
{
/* Erase SRAM completely before jumping to BSL */
__asm(
#if defined(__GNUC__)
".syntax unified\n" /* Load SRAMFLASH register*/
#endif
"ldr r4, = 0x41C40018\n" /* Load SRAMFLASH register*/
"ldr r4, [r4]\n"
"ldr r1, = 0x03FF0000\n" /* SRAMFLASH.SRAM_SZ mask */
"ands r4, r1\n" /* Get SRAMFLASH.SRAM_SZ */
"lsrs r4, r4, #6\n" /* SRAMFLASH.SRAM_SZ to kB */
"ldr r1, = 0x20300000\n" /* Start of ECC-code */
"adds r2, r4, r1\n" /* End of ECC-code */
"movs r3, #0\n"
"init_ecc_loop: \n" /* Loop to clear ECC-code */
"str r3, [r1]\n"
"adds r1, r1, #4\n"
"cmp r1, r2\n"
"blo init_ecc_loop\n"
"ldr r1, = 0x20200000\n" /* Start of NON-ECC-data */
"adds r2, r4, r1\n" /* End of NON-ECC-data */
"movs r3, #0\n"
"init_data_loop:\n" /* Loop to clear ECC-data */
"str r3, [r1]\n"
"adds r1, r1, #4\n"
"cmp r1, r2\n"
"blo init_data_loop\n"
/* Force a reset calling BSL after clearing SRAM */
"str %[resetLvlVal], [%[resetLvlAddr], #0x00]\n"
"str %[resetCmdVal], [%[resetCmdAddr], #0x00]"
: /* No outputs */
: [ resetLvlAddr ] "r"(&SYSCTL->SOCLOCK.RESETLEVEL),
[ resetLvlVal ] "r"(DL_SYSCTL_RESET_BOOTLOADER_ENTRY),
[ resetCmdAddr ] "r"(&SYSCTL->SOCLOCK.RESETCMD),
[ resetCmdVal ] "r"(
SYSCTL_RESETCMD_KEY_VALUE | SYSCTL_RESETCMD_GO_TRUE)
: "r1", "r2", "r3", "r4");
}
Thanks!
Best Regards
Johnson
I am working on custom bootloader. My interrupt problem for timer resolved by removing
Hi Sara,
Does those two app have same memory configuration in compiler? If yes, I think should not have issue.
Thanks!
Best Regards
Johnson
In both app only difference is led numbed all other is same. I am generating both .bin just editing led number.
Both App working properly when I freshly flash through bootloader code.
As like Boot to App1 and Boot to App2 working properly.
Problem in Boot to App1 to Boot to App2
1. I flash boot code through debugger.
2. Flash App1 using UART. It's working.
3. Jump App1 to Boot successfully.
4. In boot I write App2, This app2 not working.
If I write App2 after fresh bootloader debug it's working
Hi Sara,
Some understand from my side as below:
You can three image: BOOT + APP1 + APP2, and download those to MSPM0 together.
BOOT in 0x00 address, and be able to jump to AAP1 or APP2, no issue here.
But if you add some code in APP1, the function is jump to APP2, they you will encountered some issue?
Thanks!
Best Regards
Johnson
no, my boot at 0x0000 and write App1 at 0x2000 and jump to 0x2000, it's working.
Now I jump from App1(0x2000) to boot(0x0000) and my boot code running again.
In boot I write App2 at (0x2000) and again jump to 0x2000, it's not working.
1. Flash bootloader through debugger, write App1 using UART and jump to App1, It's working
2. Flash bootloader through debugger, write App2 using UART and jump to App2, It's working
3. Flash bootloader through debugger, write App1 using UART and jump to App1, It's working . Next I jump from App1 to Boot it's working, next I write App2 and trying to jump it's fail
Hi Sara,
Understood, have you checked if the APP2 have been write normally via readout?
Another point, not sure if this cause by SRAM or some register not cleared, you can try use the previous code I provide at above to jump from boot to app.
Thanks!
Best Regards
Johnson
I am not using bootloader provinded in SDK example. I write bootloader code as such it only receive .bin through uart and write in flash at 0x2000, without using BCR ans BSL configuration of MSPM0
Hi Sara,
Understood, just very general software bootloader. Let me check with team if have some idea and back here.
Thanks!
Best Regards
Johnson