Mikroe MINI-M4 for STM32¶
MINI-M4 for STM32 is a small ARM® Cortex™-M4 development board containing an STM32F415RG microcontroller. It is pin compatible with PIC16F887 and PIC18(L)F45K20 microcontrollers and it perfectly fits into a standard DIP40 socket. The board is equipped with a 16MHz SMD crystal oscillator, and a 32.768KHz crystal which can be used for the internal RTCC module. It has a reset button and three signal LEDs. It operates on a 3.3V power supply. An on-board voltage regulator allows the board to be powered directly from a USB cable.
This port is a starting point for your own customizations and not a complete port for a specific board. Most of the GPIOs on the STM32 SoC have been exposed in the external header with silk screen labels that match the SoC’s pin names.
For more information on Pin Mapping, please refer to MINI-M4 for STM32 User Manual.
The MINI-M4 for STM32 board configuration supports the following hardware features:
|NVIC||on-chip||nested vectored interrupt controller|
Other hardware features are not supported by the Zephyr kernel.
The default configuration can be found in the defconfig file:
The Zephyr console output is assigned to USART2. Default settings are 115200 8N1.
Programming and Debugging¶
The initial state of the board is set to lock. When you flash, it will fail with the message:
Error: stm32x device protected
Unlocking with openocd makes it possible to flash.
$ openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg \ -f /usr/share/openocd/scripts/target/stm32f4x.cfg -c init\ -c "reset halt" -c "stm32f4x unlock 0" -c "reset run" -c shutdown
Here is an example for the Hello World application.
# On Linux/macOS cd $ZEPHYR_BASE/samples/hello_world mkdir build && cd build # On Windows cd %ZEPHYR_BASE%\samples\hello_world mkdir build & cd build # Use cmake to configure a Ninja-based build system: cmake -GNinja -DBOARD=mikroe_mini_m4_for_stm32 .. # Now run ninja on the generated build system: ninja ninja flash
You should see the following message on the console:
Hello World! mikroe_mini_m4_for_stm32
You can debug an application in the usual way. Here is an example for the Hello World application.
# On Linux/macOS cd $ZEPHYR_BASE/samples/hello_world # If you already made a build directory (build) and ran cmake, just 'cd build' instead. mkdir build && cd build # On Windows cd %ZEPHYR_BASE%\samples\hello_world # If you already made a build directory (build) and ran cmake, just 'cd build' instead. mkdir build & cd build # Use cmake to configure a Ninja-based build system: cmake -GNinja -DBOARD=mikroe_mini_m4_for_stm32 .. # Now run ninja on the generated build system: ninja debug