This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32F103 - In Application Programing RTX from SD card Help

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

Parents
  • 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

Reply
  • 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

Children