Using MikroE Click Boards in Linux Print

 

This application note explains how to use MikroE Click boards with the STM32H7 SOM soldered onto the STM32H7-BSB Rev 4A baseboard.

Emcraft tested the functionality documented below using the Altitude 2 Click board with the MS5607 pressure sensor. If you are using some different click board, then it may require enabling/porting/implementing the appropriate device drivers in the Linux kernel and configuring the kernel device tree accordingly.

The Altitude 2 Click board is set to work with the I2C communication protocol by default. In this case, adjust the i2c4 node of the projects/rootfs/rootfs.dts.STM32H7 as follows:

&i2c4 { pinctrl-0 = <&i2c4_pins_a>; pinctrl-names = "default"; status = "okay"; pressure@77 { compatible = "meas,ms5607"; reg = <0x77>; status = "okay"; }; };

The Altitude 2 Click board can be set to work with the SPI communication protocol by switching a few onboard jumpers. In this case, adjust the spi4 node of the projects/rootfs/rootfs.dts.STM32H7 as follows:

&spi4 { pinctrl-0 = <&spi4_pins>; pinctrl-names = "default"; cs-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>; status = "okay"; pressure@0 { compatible = "meas,ms5607"; reg = <0>; spi-max-frequency = <20000000>; status = "okay"; }; };

Plug-in the Click board to the J4 Click connector on the STM32H7-BSB Rev 4A baseboard, then power on the board and let the Linux boot.

Verify that the MS5607 pressure sensor has been detected by Linux:

/ # cat /sys/bus/iio/devices/iio:device0/name
ms5607
/ #

Read the current temperature from the sensor:

/ # cat /sys/bus/iio/devices/iio:device0/in_temp_input
21880
/ #