cancel
Showing results for 
Search instead for 
Did you mean: 

IAP bootloader not jumping to the application address.

Suriya One.Zero
Associate II

0690X00000ARTRCQA5.pngI am working on IAP in STM32F4. I received .bin file using uart and flash it in 0x08004000 address successfully and disable irq , set msp , set vector, deinit hal , reset the systick registers but the jump is not working , It just freeze there. Can anyone help me on this.

1 ACCEPTED SOLUTION

Accepted Solutions

Do your application use SystemInit function (system_stm32SSxx.c location)? If yes, check what value it write to SCB->VTOR.

View solution in original post

10 REPLIES 10

Check the assembler code generated by the compiler.

Check the values​ it is pulling from the vector table.

Use the debugger properly to step the code and follow where it is going.

Make sure the app code enables the IRQS again.

Have a functional Hard Fault Handler in both loader and application.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Do your application use SystemInit function (system_stm32SSxx.c location)? If yes, check what value it write to SCB->VTOR.

I changed the scb->vtor value to app offset in system file but nothing happend.

I now have a new problem. As an example IAP code using YMODEM is worked on my board. So, I thought of modify it to find the difference of my code and the example one. And I did but with little confusion. The code only works in optimization when I set level 0 it wont work. And I also need to add two variables next to jump statement. If I even comment one variable initialization It wont work properly. I don't know what to do? 0690X00000ARVBVQA5.png

0690X00000ARVBVQA5.pngI now have a new problem. As an example IAP code using YMODEM is worked on my board. So, I thought of modify it to find the difference of my code and the example one. And I did but with little confusion. The code only works in optimization when I set level 0 it wont work. And I also need to add two variables next to jump statement. If I even comment one variable initialization It wont work properly. I don't know what to do?

sorry it works without optimization and i figured out the problem. The problem is with the application code. I use Blink program and on Delay function call it get struck. I removed it and put a for loop for delay. Now it works. But why delay didn't work?

sorry it works without optimization and i figured out the problem. The problem is with the application code. I use Blink program and on Delay function call it get struck. I removed it and put a for loop for delay. Now it works. But why delay didn't work?

Do you enable interrupt on your application with __enable_irq()?

Thank you so much. Your first suggestion works after the recent modification. But still didn't figured out how optimization affects it so much. I did IAP in HAL and APPLICATION also in HAL. Now its working fine now.Problems may arise when going to build real application. Anyways thank you so much.