cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Embedded Software

anonymous.8
Senior II
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.
14 REPLIES 14
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
Up vote any posts that you find helpful, it shows what's working..
Nesrine M_O
Lead II
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
Lead
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
Lead II
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
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

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^^)

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
Up vote any posts that you find helpful, it shows what's working..
Posted on May 09, 2018 at 16:27

Turvey.Clive.002

‌ Yes exactly !

I want to make 2 boot, place one in flash and the second one in RAM, in order to be able to switch from one to another when it's neccessary. Kind of a dual boot (windows/linux) but with 2 different program.

Where can I find documentation about run code from RAM ?

thanks for your time

Posted on May 09, 2018 at 18:13

Execution from RAM is useful mostly for debuggers.

RAM loses it's contents with power-off, so it's not really helpful in your case.

Bootloaders for firmware update are another scenarion were execution from RAM is quite handy.

You can access arbitrary Flash regions, and are not hampered by code fetch stalls.

In almost all implementations, you cannot execute code from Flash banks you are about to program.

The IAR Workbench supports execution from RAM nicely - just add a keyword and the toolchain does the rest (if the target supports it at all).