folks:
I’m working with an STM32F103 development board and using TinyGo to implement both a bootloader and an app. I want to flash these two programs onto the board: one is the bootloader and the other is the app.
The bootloader’s flash start address is 0x08000000.
The app’s flash start address is 0x08002800.
//—————————————————–
Bootloader stm32.ld settings are as follows:
MEMORY
{
FLASH_TEXT (rw) : ORIGIN = 0x08000000, LENGTH = 24K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
}
_stack_size = 2K;
INCLUDE "targets/arm.ld"
//——————————————————
App stm32.ld settings are as follows:
MEMORY
{
FLASH_TEXT (rw) : ORIGIN = 0x08002800, LENGTH = 24K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
}
_stack_size = 2K;
INCLUDE "targets/arm.ld"
I want the bootloader to jump to the app, where the app will output information via println() and simultaneously turn on an LED. Currently, the jump to the app is successful.
enter image description here
However, if I don’t set the SCB.VTOR (Vector Table Offset Register) address, I encounter the following error:
fatal error: illegal use of the EPSR with sp=0x200007d4 pc=0x0800094b
When I try to set the SCB.VTOR address in the run method of the runtime/schedule.go file, the program gets stuck in the initAll() function and doesn’t respond. The code for setting the SCB.VTOR address is as follows:
[Code not provided directly in the original message]
enter image description here
enter image description here
Help:
Has anyone successfully implemented a bootloader jumping to an app using the TinyGo framework and had it work correctly? I would greatly appreciate any advice or guidance.
Thanks!
However, if I don’t set the SCB.VTOR (Vector Table Offset Register) address, I encounter the following error:
fatal error: illegal use of the EPSR with sp=0x200007d4 pc=0x0800094b
When I try to set the SCB.VTOR address in the run method of the runtime/schedule.go file, the program gets stuck in the initAll() function and doesn’t respond. The code for setting the SCB.VTOR address is as follows:
[Code not provided directly in the original message]
enter image description here
enter image description here
shanzhu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.