Uploading your Arduino program to STM32
Now that we have set up Arduino IDE to work with the STM32 Nucleo boards, paste the given code in Arduino IDE.
Now we need to export the compiled binaries. Go to Sketch
and select the Export Compiled binaries
option. Once this is done, navigate to the folder where we saved the sketch and a .bin
file should be available. We need to upload this to the built-in IDE on Simuli Virtual Lab. Go to your STM32 instance in Simuli Virtual Lab and open the file viewer sidebar
. Right-click
anywhere in this sidebar and select Upload Files...
. A new window pops up: here we select the .bin
file that we got after exporting the compiled binaries and click open
.
Now we need to rename the bin file from yourfile.bin
to firmware.bin
. We will use the terminal to achieve the same. Go to the terminal, first, let's change our directory to /workspace
using cd
, and then we will rename the files using mv
.
Write these commands in the terminal and execute them.
Make sure you change yourfile.bin in the command to the actual name of the bin file.
Finally, we just need to reset
the STM32, i.e. click on the red power button above the top left corner of the STM32. When the STM32 restarts, it will use our new firmware.bin file.
Last updated