Hello,
I'm working on an application where I need a firmware update. I wrote a bootloader, but I don't get a right solution how to jump to a fixed memory address. I read many forums but those solution wasn't good. I check with my bootlader, that if the uploaded binary file (stored in the flash memory of microcontroller) is a new firmware?, need a firmware update?, if yes the program sholud jump to the application code address in the memory. If isn't new firmware the program should jump in default to the application address.
Can You tell me how can I implement it in C, or better in inline assembly?
Please help me to find a good solution, Kind regards, Szabolcs
P.s.: I'm working with STM32F407 microcontroller, and I use the Keil environment with ARM C51 compiler
You should first understand the processor, and how it executes code.
There are a lot of reasons things crash, your code is broken, and I can't see it remotely, you have a debugger, step the code and understand where it goes. ST provides working examples, try those first.
I got the problem. I wrote my bootloader code in Keil and my application code in SystemWorkbench for STM32, because the limitation of code size in Keil.
Today I write a little test code in both environment and built them. The beginning of two binary file are different. When I loaded the bootloader and the test program (written in Keil) to the appropriate address of flash, the program worked fine. The bootloader jumped to the right address and run the test code.
But if I did the same thing with the test code written in System Workbench, the program chrashed. In this environment a little bit complex to define the load address than in the Keil toolchain. Here are linkerscript and other files where we should do modifies. So problem comes from it. I try to find solutions.
One mor time thank You for Your help, Sincerelly, Szabolcs Vass