Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader jump to APP, #4473

Open
shanzhuknn opened this issue Sep 18, 2024 · 0 comments
Open

bootloader jump to APP, #4473

shanzhuknn opened this issue Sep 18, 2024 · 0 comments

Comments

@shanzhuknn
Copy link

Hi, 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.
boot

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:
jumapp

[Code not provided directly in the original message]

vtor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant