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
  • Also ,
    I saw one keil forum post, core_cm3.h and core_cm3.c file has to be include project for defination __set_MSP and __IO . But When I add these file , I have got more complex error. It interlace with FS_CM3.lib

    these are ERRORS when I add core_cm3 files

    core_cm3.h(715): warning: #47-D: incompatible redefinition of macro "SCS_BASE" (declared at line 687 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
    core_cm3.h(723): warning: #47-D: incompatible redefinition of macro "SCB" (declared at line 935 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
    core_cm3.h(724): warning: #47-D: incompatible redefinition of macro "SysTick" (declared at line 930 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
    core_cm3.h(725): warning: #47-D: incompatible redefinition of macro "NVIC" (declared at line 934 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")

Reply
  • Also ,
    I saw one keil forum post, core_cm3.h and core_cm3.c file has to be include project for defination __set_MSP and __IO . But When I add these file , I have got more complex error. It interlace with FS_CM3.lib

    these are ERRORS when I add core_cm3 files

    core_cm3.h(715): warning: #47-D: incompatible redefinition of macro "SCS_BASE" (declared at line 687 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
    core_cm3.h(723): warning: #47-D: incompatible redefinition of macro "SCB" (declared at line 935 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
    core_cm3.h(724): warning: #47-D: incompatible redefinition of macro "SysTick" (declared at line 930 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
    core_cm3.h(725): warning: #47-D: incompatible redefinition of macro "NVIC" (declared at line 934 of "C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")

Children