This blog explores STM32 and ARM Cortex-M development and concepts using software tools which are open source and freely available.
Learn how to set up a development environment and start writing code with short concise examples using both real hardware and the QEMU virtual machine emulator.
Demonstrates examples running on real hardware (JTAG programming/debugging, GPIO control), the hardware is based on the ARM Cortex-M4F CPU.
Guide to setting up the STM32-P405 board, a development environment and some simple startup code to validate the setup.
Guide to enable and use the GPIO pins on the STM32-P405 board.
Set up a QEMU emulator and run and debug some startup code.
Generate a usage fault and demonstate the correct handler being called
Examine the stack frame after an exception is called
Generate output on the PL1011 serial device
Enable the SysTick timer
Initialise an initial task and switching to thread mode using the SysTick exception
Implement a simple round robin scheduler capable of executing multiple tasks
Use the PendSV exception to enable deferred context switching
Implement a simple priory mechanism for tasks
Please note: All code presented is licensed under the GNU Public License V3 and examples are provided purely for educational purposes and may lack constructs such as boundary checking, sanity tests etc.
Do not use this code for secure or safety critical applications.