Skip to content

Commit d197b5c

Browse files
committed
boards: arm: Add support for SensorTile.box board
The SensorTile.box is a board designed for IoT applications embedding a wide range of intelligent low power MEMS sensors, a STM32L4 microcontroller to manage sensor configuration and process sensor output data, a micro-USB battery charging interface and an ST Bluetooth Low Energy module for wireless communication with a BLE-enabled smartphone. Signed-off-by: Armando Visconti <[email protected]>
1 parent 53159eb commit d197b5c

File tree

12 files changed

+611
-0
lines changed

12 files changed

+611
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
/boards/arm/sam4s_xplained/ @fallrisk
8383
/boards/arm/v2m_beetle/ @fvincenzo
8484
/boards/arm/olimexino_stm32/ @ydamigos
85+
/boards/arm/sensortile_box/ @avisconti
8586
/boards/arm/stm32*_disco/ @erwango
8687
/boards/arm/stm32f3_disco/ @ydamigos
8788
/boards/arm/stm32*_eval/ @erwango
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(CONFIG_PINMUX)
4+
zephyr_library()
5+
zephyr_library_sources(pinmux.c)
6+
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
7+
endif()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Kconfig - SensorTile.box board configuration
2+
#
3+
# Copyright (c) 2019 STMicroelectronics
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
config BOARD_SENSORTILE_BOX
9+
bool "SensorTile.box Development Board"
10+
depends on SOC_STM32L4R5XX
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Kconfig - SensorTile.box board configuration
2+
#
3+
# Copyright (c) 2019 STMicroelectronics
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
if BOARD_SENSORTILE_BOX
9+
10+
config BOARD
11+
default "sensortile_box"
12+
13+
if UART_CONSOLE
14+
15+
config UART_1
16+
default y
17+
18+
endif # UART_CONSOLE
19+
20+
if I2C
21+
22+
config I2C_1
23+
default y
24+
25+
config I2C_3
26+
default y
27+
28+
endif # I2C
29+
30+
if SPI
31+
32+
config SPI_1
33+
default y
34+
35+
config SPI_3
36+
default y
37+
38+
config SPI_STM32_INTERRUPT
39+
default y
40+
41+
endif # SPI
42+
43+
endif # BOARD_SENSORTILE_BOX
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
4+
5+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
89 KB
Loading
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
.. _sensortile_box:
2+
3+
ST SensorTile.box
4+
#################
5+
6+
Overview
7+
********
8+
9+
The STEVAL-MKSBOX1V1 (SensorTile.box) is a ready-to-use box kit for wireless
10+
IoT and wearable sensor platforms to help you use and develop apps based on
11+
remote motion and environmental sensor data.
12+
The SensorTile.box board fits into a small plastic box with a long-life rechargeable
13+
battery, and communicates with a standard smartphone through its Bluetooth interface,
14+
providing data coming from the sensors.
15+
16+
.. image:: img/sensortile_box.jpg
17+
:width: 784px
18+
:align: center
19+
:height: 643px
20+
:alt: SensorTile.box
21+
22+
More information about the board can be found at the `SensorTile.box website`_.
23+
24+
Hardware
25+
********
26+
27+
SensorTile.box provides the following hardware components:
28+
29+
- Ultra low-power STM32L4R9ZI System on Chip
30+
31+
- LQFP144 package
32+
- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU, adaptive
33+
real-time accelerator (ART Accelerator) allowing 0-wait-state
34+
execution from Flash memory, frequency up to 120 MHz, MPU, 150
35+
DMIPS/1.25 DMIPS/MHz (Dhrystone 2.1), and DSP instructions
36+
- Clock Sources:
37+
38+
- 16 MHz crystal oscillator
39+
- 32 kHz crystal oscillator for RTC (LSE)
40+
41+
- Communication
42+
43+
- Bluetooth Smart connectivity v4.2 (SPBTLE-1S)
44+
- 1 x USB OTG FS (SoC) with micro-B connector
45+
(USB device role only)
46+
47+
- Internal Busses
48+
49+
- 3 x SPI bus
50+
- 3 x I2C bus
51+
52+
- micro-SD connector
53+
54+
- On board sensors:
55+
56+
- Digital temperature sensor (STTS751)
57+
- 6-axis inertial measurement unit (LSM6DSOX)
58+
- 3-axis accelerometers (LIS2DW12 and LIS3DHH)
59+
- 3-axis magnetometer (LIS2MDL)
60+
- Altimeter / pressure sensor (LPS22HH)
61+
- Microphone / audio sensor (MP23ABS1)
62+
- Humidity sensor (HTS221)
63+
64+
- HCP602535ZC LI-ion rechargable battery (3.7V 500mAh)
65+
- FTSH107 connector for SWD debugging and UART Tx/Rx
66+
67+
Supported Features
68+
==================
69+
70+
The SensorTile.box provides motion, environmental, and audio
71+
sensor data through either the BLE or USB protocols to a host application running
72+
on a smartphone/PC to implement applications such as:
73+
74+
- Pedometer optimized for belt positioning
75+
- Baby crying detection with Cloud AI learning
76+
- Barometer / environmental monitoring
77+
- Vehicle / goods tracking
78+
- Vibration monitoring
79+
- Compass and inclinometer
80+
- Sensor data logger
81+
82+
Connections and IOs
83+
===================
84+
85+
LED
86+
---
87+
88+
- Blue LED = PB15
89+
- Green LED = PF2
90+
91+
Push buttons
92+
------------
93+
94+
- BUTTON = BOOT
95+
(used to let the SensorTile.box enter DFU mode. See `Programming and Debugging`_
96+
section)
97+
- BUTTON = PWR
98+
(used to Power on/off the board when battery is connected)
99+
100+
System Clock
101+
============
102+
103+
SensorTile.box System Clock could be driven by internal or external
104+
oscillator, as well as main PLL clock. By default, the System clock is
105+
driven by the PLL clock at 80MHz, driven by the 16MHz external oscillator.
106+
The system clock can be boosted to 120MHz.
107+
The internal AHB/APB1/APB2 AMBA busses are all clocked at 80MHz.
108+
109+
Serial Port
110+
===========
111+
112+
There are two possible options for Zephyr console output:
113+
114+
- using USART1 which is available on FTSH107 connector. In this case a JTAG adapter
115+
can be used to connect SensorTile.box to STLINK-V2 and have both SWD and console lines
116+
available on PC.
117+
- using the USB connector, which may be used to make the console available on PC as
118+
USB CDC class.
119+
120+
Console default settings are 115200 8N1.
121+
122+
USB interface
123+
=============
124+
125+
SensorTile.box can be connected as a USB device to a PC host through its micro-B connector.
126+
The final application may use it to declare SensorTile.box device as belonging to a
127+
certain standard or vendor class, e.g. a CDC, a mass storage or a composite device with both
128+
functions.
129+
130+
Programming and Debugging
131+
*************************
132+
133+
There are 2 main entry points for flashing STM32FL4Rx SoCs, one using the ROM
134+
bootloader, and another by using the SWD debug port (which requires additional
135+
hardware) on FTSH107 connector.
136+
Flash using the ROM bootloader by powering on the board
137+
while keeping the BOOT0 button pressed.
138+
The ROM bootloader supports flashing via USB (DFU), UART, I2C and SPI.
139+
You can read more about how to enable and use the ROM bootloader by checking
140+
the application note `AN2606`_ (STM32L4Rx section).
141+
142+
Flashing
143+
========
144+
145+
Installing dfu-util
146+
-------------------
147+
148+
It is recommended to use at least v0.8 of dfu-util. The package available in
149+
Debian and Ubuntu can be quite old, so you might have to build dfu-util from source.
150+
Information about how to get the source code and how to build it can be found
151+
at the `DFU-UTIL website`_
152+
153+
Flashing an Application to SensorTile.box
154+
-----------------------------------------
155+
156+
While pressing the BOOT0 button, connect the
157+
micro-USB cable to the USB OTG SensorTile.box
158+
port and to your computer. The board should be
159+
forced to enter DFU mode.
160+
161+
Confirm that the board is in DFU mode:
162+
163+
.. code-block:: console
164+
165+
$ sudo dfu-util -l
166+
dfu-util 0.9
167+
168+
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
169+
Copyright 2010-2019 Tormod Volden and Stefan Schmidt
170+
This program is Free Software and has ABSOLUTELY NO WARRANTY
171+
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
172+
173+
Found DFU: [0483:df11] ver=2200, devnum=74, cfg=1, intf=0, path="2-2", alt=2, name="@OTP Memory /0x1FFF7000/01*0001Ke", serial="204A325D574D"
174+
Found DFU: [0483:df11] ver=2200, devnum=74, cfg=1, intf=0, path="2-2", alt=1, name="@Option Bytes /0x1FF00000/01*040 e/0x1FF01000/01*040 e", serial="204A325D574D"
175+
Found DFU: [0483:df11] ver=2200, devnum=74, cfg=1, intf=0, path="2-2", alt=0, name="@Internal Flash /0x08000000/512*0004Kg", serial="204A325D574D"
176+
177+
You should see following confirmation on your Linux host:
178+
179+
.. code-block:: console
180+
181+
$ dmesg
182+
usb 2-2: new full-speed USB device number 74 using xhci_hcd
183+
usb 2-2: New USB device found, idVendor=0483, idProduct=df11
184+
usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
185+
usb 2-2: Product: STM32 BOOTLOADER
186+
usb 2-2: Manufacturer: STMicroelectronics
187+
usb 2-2: SerialNumber: 204A325D574D
188+
189+
You can build and flash the provided sample application
190+
(:ref:`sensortile_box sensors`) that reads sensors data and outputs
191+
values on the console.
192+
193+
References
194+
**********
195+
196+
.. target-notes::
197+
198+
.. _SensorTile.box website:
199+
https://www.st.com/en/evaluation-tools/steval-mksbox1v1.html
200+
201+
.. _AN2606:
202+
http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf
203+
204+
.. _DFU-UTIL website:
205+
http://dfu-util.sourceforge.net/
206+

boards/arm/sensortile_box/pinmux.c

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (c) 2019 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <kernel.h>
8+
#include <device.h>
9+
#include <init.h>
10+
#include <drivers/pinmux.h>
11+
#include <sys/sys_io.h>
12+
13+
#include <pinmux/stm32/pinmux_stm32.h>
14+
15+
/* pin assignments for SensorTile.box board */
16+
static const struct pin_config pinconf[] = {
17+
#ifdef CONFIG_UART_1
18+
{STM32_PIN_PA9, STM32L4X_PINMUX_FUNC_PA9_USART1_TX},
19+
{STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_USART1_RX},
20+
#endif /* CONFIG_UART_1 */
21+
#ifdef CONFIG_UART_2
22+
{STM32_PIN_PA2, STM32L4X_PINMUX_FUNC_PA2_USART2_TX},
23+
{STM32_PIN_PA3, STM32L4X_PINMUX_FUNC_PA3_USART2_RX},
24+
#endif /* CONFIG_UART_2 */
25+
#ifdef CONFIG_I2C_1
26+
{STM32_PIN_PB6, STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL},
27+
{STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA},
28+
#endif /* CONFIG_I2C_1 */
29+
#ifdef CONFIG_I2C_3
30+
{STM32_PIN_PG7, STM32L4X_PINMUX_FUNC_PG7_I2C3_SCL},
31+
{STM32_PIN_PG8, STM32L4X_PINMUX_FUNC_PG8_I2C3_SDA},
32+
#endif /* CONFIG_I2C_3 */
33+
#ifdef CONFIG_SPI_1
34+
{STM32_PIN_PE12, STM32L4X_PINMUX_FUNC_PE12_SPI1_NSS},
35+
{STM32_PIN_PE13, STM32L4X_PINMUX_FUNC_PE13_SPI1_SCK},
36+
{STM32_PIN_PE14, STM32L4X_PINMUX_FUNC_PE14_SPI1_MISO},
37+
{STM32_PIN_PE15, STM32L4X_PINMUX_FUNC_PE15_SPI1_MOSI},
38+
#endif /* CONFIG_SPI_1 */
39+
#ifdef CONFIG_SPI_2
40+
/* SPI2 on the ST Morpho Connector CN10 pins 16, 30, 28, 26*/
41+
{STM32_PIN_PB12, STM32L4X_PINMUX_FUNC_PB12_SPI2_NSS},
42+
{STM32_PIN_PB13, STM32L4X_PINMUX_FUNC_PB13_SPI2_SCK},
43+
{STM32_PIN_PB14, STM32L4X_PINMUX_FUNC_PB14_SPI2_MISO},
44+
{STM32_PIN_PB15, STM32L4X_PINMUX_FUNC_PB15_SPI2_MOSI},
45+
#endif /* CONFIG_SPI_1 */
46+
#ifdef CONFIG_SPI_3
47+
/* SPI3 is used in 3-wires mode */
48+
{STM32_PIN_PA15, STM32L4X_PINMUX_FUNC_PA15_SPI3_NSS},
49+
{STM32_PIN_PB3, STM32L4X_PINMUX_FUNC_PB3_SPI3_SCK},
50+
{STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI3_MISO},
51+
#endif /* CONFIG_SPI_3 */
52+
#ifdef CONFIG_USB_DC_STM32
53+
{STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM},
54+
{STM32_PIN_PA12, STM32L4X_PINMUX_FUNC_PA12_OTG_FS_DP},
55+
#endif /* CONFIG_USB_DC_STM32 */
56+
};
57+
58+
static int pinmux_stm32_init(struct device *port)
59+
{
60+
ARG_UNUSED(port);
61+
62+
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
63+
64+
return 0;
65+
}
66+
67+
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
68+
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

0 commit comments

Comments
 (0)