cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 bootloader

Sid_sid
Visitor

Dear Members,

I'm using the STM32F030CC controller for my RTOS-based project and currently developing a bootloader for it. The application code has been relocated to 0x08004000. The bootloader successfully jumps to the application, but after initializing all peripherals (GPIO, timers, etc.), calling `HAL_GetTick()` returns a `uwTick` value of 0.

Sid_sid_2-1728297669622.png

This is the fuction iam using to jump from bootloader to application. when i try to do _enable_irq(); the jump fuction is not working . 

am i missing anything?

6 REPLIES 6
Andrew Neil
Evangelist III

Please see the Posting Tips for how to properly post source code - not as an image:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228 

SofLit
ST Employee

Hello @Sid_sid and welcome to the community,

First, please use </> button to paste your code instead of sharing screen shots.

Second, Did you remap your vector table (VTOR) to the new Flash address 0x08004000?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thankyou for your reply.

are you asking about the linker script in application?

* Specify the memory areas */
MEMORY
{
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 32K
FLASH (rx)      : ORIGIN = 0x08004000, LENGTH = 240K
}

No,

I'm talking about vector table relocation on STM32F0:

See: https://community.arm.com/support-forums/f/architectures-and-processors-forum/13533/relocating-the-vector-table-in-cortex---m0

https://electronics.stackexchange.com/questions/370792/remapping-vector-table-in-stm32f0-no-vector-offset-register

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
TDK
Guru

You are disabling interrupts which prevents systick from occurring.

 

For working code on how to jump to the bootloader, see here: It can be easily modified to jump instead to your application. Note the section where it disables interrupts in the NVIC registers. You likely need something similar

How to jump to system bootloader from application ... - STMicroelectronics Community

If you feel a post has answered your question, please click "Accept as Solution".

actually i mapped vector table to 

memcpy((void*)0x20000000, (const void*)APP_ADDRESS, 0xC0);

0x20000000