We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi every one,
I have a STM32F103 Board with an SD card . My project has a simple idea.( Im not sue, I could be simple for begginers like me) New firmware has to be copied Sdcard like “Firmware.bin”
When MCU starts ,
If the file is exist Start firmwareupdate else Jump user App
I’m using FLASH-FS to read firmware file from SD CARD, and write is mcu flash. I inspired AN2557 IAP from USART application and , MCBSTM32 RTX_Blinky projects. Is that possible to IAP using RTX ?
I can read firmware file and write is flash, but I can’t handle jump application. Im stuck now.
This is code what I try,
if(checkfile("firmware.bin")==1){ os_dly_wait(50); firmware_update("firmware.bin ",0,2048); }else{ JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); Jump_To_Application = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) ApplicationAddress); Jump_To_Application(); }
I got error message ;
Blinky.c(114): error: #20: identifier "__IO" is undefined Blinky.c(117): warning: #223-D: function "__set_MSP" declared implicitly
Do you have any suggestion to set mainStackPointer and __IO for RTX blinky project. And please some details about what I must do with jump part
Thanks your help
You shouldn't need to set any stack pointer. Your application (that you downloaded) should be complete with startup code.
So you should make sure the boot loader leaves the interrupts off, and not in user mode. Then pick up the reset vector from the start of the application region and jump there. That code is responsible for setting up the stack. It's your new application that should take responsibility for deciding how much RAM should be stack and how much RAM should be variables, buffers, ...
Hi Per,
AN2557 IAP example said, assing a new application base adress to MSP. I try to develop same structure.My fisrt message has "AN2557 jump user app" codes.
As you said, it has to be enough set reset vector to downloaded App base adress. How downloaded application will start. Do I have to wait watchdog in while loop.
Im looking for forum, how to set reset vector.. Hope it will be easy
thanks
The Application Note shows you that.