1.2 KiB
1.2 KiB
STM32 Bluepill Quickstart
Temporary files
Create files and directories within the project temp directory e.g.: ~/.gemini/tmp/d9929d1c794fb414052498bc12a08fef640ff8b7c30d9190d0699962781facbf
Compilation
To compile the sketch, run the following command from the project root:
arduino-cli compile --fqbn STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103CB,upload_method=OpenOCDDapLink --build-path /tmp/$(basename $(pwd)) .
Flashing
To flash the sketch use openocd to flash the sketch.
openocd -d2 -f interface/cmsis-dap.cfg -f target/stm32f1x.cfg -c "program {/tmp/$(basename $(pwd))/$(basename $(pwd)).ino.elf} verify reset exit"
Viewing Logs
The best way for me to read the logs is to capture the output from the serial port to a file, and then read that file.
- First, I'd configure the serial port settings without starting an interactive session using
stty. - Then, I'd use a command like
headto read a specific number of lines from the serial port and save them to a temporary file. This command will exit automatically after reading the lines. - Finally, I would use
read_fileto read the contents of that temporary file.