Skip to main content
anonymous.8
Senior II
May 9, 2018
Question

STM32 Embedded Software

  • May 9, 2018
  • 14 replies
  • 1955 views
Posted on May 09, 2018 at 10:21

Hi !

I have 2 binary files for 2 different function, I'm wondering if there is a stm32 embedded software who can help me to choose which binary run, through the UART ? I want to select the application I run andchange from one to another.

Regards,

Thomas

#embedded-softwares

Note: this post was migrated and contained many threaded conversations, some content may be missing.
    This topic has been closed for replies.

    14 replies

    Tesla DeLorean
    Guru
    May 9, 2018
    Posted on May 09, 2018 at 10:44

    You might want to look at the IAP examples, and how they transfer control. The processor can jump to any code in memory.

    You will need to build/link your applications for specific addresses at which they are going to operate, as the vector table contains absolute addresses.

    The alternative is to write a loader which can take object files where the linker hasn't bound them to specific addresses.

    Sort of things covered in courses/texts on Assemblers, Compilers, Linkers and Loaders..

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Nesrine M_O
    Associate
    May 9, 2018
    Posted on May 09, 2018 at 10:46

    Hi

    thomas.petrimaux

    ,

    You can use the STM32 Flash loader demonstrator (

    http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stmhtml

    ) is a free software PC utility from ST, which runs on Microsoft® OSs and communicates through the RS232 with the STM32 system memory bootloader.

    -Nesrine-

    AvaTar
    Senior III
    May 9, 2018
    Posted on May 09, 2018 at 10:50

    Sounds like both 'applications' are supposed to be present in Flash anyway.

    The simplest option would really be to make both projects into one application, and choose at runtime which part to run. Perhaps per UART, or jumper, or button press.

    That would save you a lot of hassle.

    Nesrine M_O
    Associate
    May 9, 2018
    Posted on May 09, 2018 at 10:58

    As also suggested by

    meyer.frank

    you can

    make

    both projects into one application, and choose at runtime which part to run.You can refer to this example it may helps you:

    STM32Cube_FW_L4_V1.0\Projects\NUCLEO-L476RG\Examples\PWR\PWR_ModesSelection

    -Nesrine-

    anonymous.8
    Senior II
    May 9, 2018
    Posted on May 09, 2018 at 15:41

    ELMHIRI.Syrine

    ‌ In this example, the program select a function (who are describe in the program) What i want to do is replace this function by a binary file that I compile from another project. Can I do this ? Make a call of a binary file in another project. (That's sound weird^^)

    Tesla DeLorean
    Guru
    May 9, 2018
    Posted on May 09, 2018 at 15:47

    You tend to need to make things free-standing.

    One can do it at a subroutine level, and call via function pointers, but it requires an understanding of the micro-controller and the calling conventions, and what other functions and library routines it might touch.

    One can load and execute code in RAM also.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    anonymous.8
    Senior II
    May 9, 2018
    Posted on May 09, 2018 at 13:57

    meyer.frank

    ‌ exactly I forget to mention that my two applications need to be present in Flash !

    ELMHIRI.Syrine

    ‌ thanks for the example this is what I need,I will take inspiration from this example !

    thanks to all

    henry.dick
    Associate II
    May 16, 2018
    Posted on May 16, 2018 at 13:23

    No easy solution, as the binaries are compiled assuming a memory lay out that is not going to be true in your setup.

    The best is to find the source files and code them accordingly.

    Short of that, have two chips each running one of the binaries and switch in and out of each of them on demand.

    You can also write a custom boitloader that loads in one of the binaries on demand. 

    ....