Reverse Engineering Remote Control Power Sockets - Part 5: Setting up a development environment for the STM32F4DISCOVERY
The STM32F4DISCOVERY is a cheap STM32F4 (ARM® Cortex®-M4-based) evaluation board. It is the second target of choice to controll a 433 MHz transmitter in order to switch cheap remote controlled power outlets.
You might want to read the following posts before you continue:
Part 4: Setting up a development environment for the Raspberry Pi
libopencm3 is a free/libre/open-source (LGPL v3, or later) firmware library for various ARM Cortex-M microcontrollers. It comes along with various examples and makes it very easy to do the first steps in embedded programming.
In order to be able to compile libopencm3, you'll need an appropriate cross-toolchain for the ARM platform:
yay -S gcc-arm-none-eabi-bin-92 arm-none-eabi-gdb opencocd stlink
Let's initially build all examples along with libopencm3:
git clone https://github.com/libopencm3/libopencm3-examples cd libopencm3-examples/ git submodule init git submodule update make
Finally connect the STM32F4DISCOVERY via the Mini-USB connectors to your development host and run the following command to flash the miniblink example to the target:
cd examples/stm32/f4/stm32f4-discovery/miniblink/ make flash
Or to flash with stlink instead of OpenOCD:
You'll hopefully see the green LED flashing now.