Clicker 2 for STM32
Overview
MikroE Clicker 2 for STM32 is a development board containing an STM32F407 microcontroller. It is equipped with two mikrobus sockets and furthermore has two headers for general signal break out. The board also has battery connection and a battery management unit on board. It can be powered either from a battery pack, such as a LiPo or from USB. The board is equipped with a 25MHz crystal as well as a 32.768kHz clock crystal.
Hardware
The Clicker 2 board contains the following connections:
Two MikroBUS connectors
Two headers with general connections
Furthermore the board contains two LEDs and two push buttons that are connected to the microcontroller.
Supported Features
The mikroe_clicker_2 board supports the hardware features listed below.
- on-chip / on-board
- Feature integrated in the SoC / present on the board.
- 2 / 2
-
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files. -
vnd,foo -
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.
Connections and IOs
The two mikroBUS interfaces are aliased in the device tree so that their
peripherals can be accessed using mikrobus_N_INTERFACE so e.g. the spi on
bus 2 can be found by the alias mikrobus_2_spi. The counting corresponds
with the marking on the board.
For connections on the edge connectors, please refer to Clicker 2 for STM32 User Manual.
Programming and Debugging
The mikroe_clicker_2 board supports the runners and associated west commands listed below.
| flash | debug |
|---|
Applications for the mikroe_clicker_2 board configuration can
be built and flashed in the usual way (see Building an Application and
Run an Application for more details).
Flashing
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.
# From the root of the zephyr repository
west build -b mikroe_clicker_2 samples/hello_world
west flash
You should see the following message on the console:
Hello World! mikroe_clicker_2
Debugging
You can debug an application in the usual way. Here is an example for the Hello World application.
# From the root of the zephyr repository
west build -b mikroe_clicker_2 samples/hello_world
west debug