RTOS on STM32F103Cx [macOS]

GL
Written by GL on

Clone the repo from https://github.com/gowrav-com/chibiOS-STM32F103Cx

git clone https://github.com/gowrav-com/chibiOS-STM32F103Cx
cd chibiOS-STM32F103Cx
mkdir build
make

That’s It now you have the binary files to be dumped in to your STM32F103cx hardware, here I am using UART mode to write directly into the flash memory. You can however use the Maple Mini Bootloader in which case the follow the readme.txt file

make USE_MAPLEMINI_BOOTLOADER=1

The .ld file needs to be linked in line #119 for your board specs in MakeFile.
./ChibiOS/os/common/startup/ARMCMx/compilers/GCC/ld/STM32F103xx.ld

The generated binary in the build folder can be written now using STM32 Flasher tool for windows here for macOS I am using STM32CubeProgrammer this is platform independent and needs Java8 specifically to work.

Connect the UART board to the TX/RX pin of the STM32board supply with 3v3 (3v) supply pin only [alternatively you can power using USB connector]. Change the Boot Jumper configuration to ensure Reprogramming Mode as shown in the picture below.

You can erase the flash memory and start with blank memory as I did, there could be times where the flashing could get stuck and fail when this happens disconnect and reconnect UART module and try flashing again.

Once it succeeds , Disconnect and quit STM32CubeProgrammer https://www.st.com/en/development-tools/stm32cubeprog.html but now before removing the supply power from the STM32 board ensure the Boot Pins are reset to their original position, if not you may have to flash again on power cycle.

Now disconnect the UART and connect the STM32 board through USB port. Open your favourite Serial Terminal Emulator and look for the new USB TTL/TTY connection and connect with baud rate of 115200. Here I am using CoolTerm https://www.macupdate.com/app/mac/31352/coolterm for Mac.

Awesome.! Now you have your own RTOS running in an STM32 board. with a shell prompt. You can run tests on both RT and OSLIB to know the performance.

test rt
test oslib

Comments

comments powered by Disqus