2022-07-21 08:05 AM
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?
2022-07-21 08:57 AM
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
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
2022-07-21 09:05 AM
"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?
2022-07-21 10:40 AM
R8 inside have 64k flash. Then if i good understand you need no one code to run.
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.