cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an Executable with STM32CubeIDE

JKing.8
Associate III

I am programming a microcontroller that will be in space flight. Currently to test the device we send the firmware to the board using something like the STM32CubeIDE or the stlink software. This works for now and allows us to run our code, but in flight, we can't use a cable and computer to upload the code and run it, we need the code to be on the board (in flash memory I assume), and we need to be able to execute it via UART commands from a computer on board the spacecraft. I am using an STM32F051R8. Any ideas?

3 REPLIES 3

It's not necessary to like your own posts..

You could use the ROM based system loader vai the serial port

See App Notes AN2606 and AN3155

https://www.st.com/resource/en/application_note/an3155-usart-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

Implementation examples? Perhaps look at the GitHub for the Arduino MKR WAN 1300, which uses a Murata LoRa module with a STM32L0, ie same underlying protocol

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III

"in flight, we can't use a cable and computer to upload the code and run it, we need the code to be on the board (in flash memory I assume)"

So you load the software pre-flight - exactly as you are doing currently with CubeIDE & ST-Link.

Or are you talking about in-flight updates?

For in-flight updates, as @Community member​ says, you will need a bootloader

"we need to be able to execute it via UART commands from a computer on board the spacecraft"

Can this "computer" not just program the STM32?

MM..1
Chief II

R8 inside have 64k flash. Then if i good understand you need no one code to run.

  1. You need know after reset start code "master"
  2. In master you can wait UART for command and do jobs

But this cant be changed in flight.

"in flight, we can't use a cable and computer to upload the code and run it, we need the code to be on the board (in flash memory I assume)"

This words cant be true. If you connect UART you use cable. And commands to UART is from high level computer.

UART give you way to reload full or partial flash memory.