1.. zephyr:board:: sensortile_box_pro 2 3Overview 4******** 5 6The STEVAL-MKBOXPRO (SensorTile.box PRO) features an ARM Cortex-M33 based STM32U585AI MCU 7and is a ready-to-use box kit for wireless IoT and wearable sensor platforms to help using 8and developing apps based on remote motion and environmental sensor data. 9 10The SensorTile.box PRO board fits into a small plastic box with a long-life rechargeable 11battery, and communicates with a standard smartphone through its Bluetooth interface, 12providing data coming from the sensors. 13 14More information about the board can be found at the `SensorTile.box PRO website`_. 15 16Supported Features 17****************** 18 19The SensorTile.box PRO provides motion, environmental, and audio 20sensor data through either the BLE or USB protocols to a host application running 21on a smartphone/PC to implement applications such as: 22 23- Pedometer optimized for belt positioning 24- Baby crying detection with Cloud AI learning 25- Barometer / environmental monitoring 26- Vehicle / goods tracking 27- Vibration monitoring 28- Compass and inclinometer 29- Sensor data logger 30 31(see `Motion and environmental sensors`_ section for the complete lists of available 32sensors on board) 33 34Hardware 35******** 36 37The following is a summary of the main board features. More info can be find on `UM3133`_ 38and the `schematic`_. 39 40The STM32U585xx devices are an ultra-low-power microcontrollers family (STM32U5 41Series) based on the high-performance Arm|reg| Cortex|reg|-M33 32-bit RISC core. 42They operate at a frequency of up to 160 MHz. 43 44- Ultra-low-power with FlexPowerControl (down to 300 nA Standby mode and 19.5 uA/MHz run mode) 45- Core: ARM |reg| 32-bit Cortex |reg| -M33 CPU with TrustZone |reg| and FPU. 46- Performance benchmark: 47 48 - 1.5 DMPIS/MHz (Drystone 2.1) 49 - 651 CoreMark |reg| (4.07 CoreMark |reg| /MHZ) 50 51- Security and cryptography 52 53 - Arm |reg| TrustZone |reg| and securable I/Os memories and peripherals 54 - Flexible life cycle scheme with RDP (readout protection) and password protected debug 55 - Root of trust thanks to unique boot entry and secure hide protection area (HDP) 56 - Secure Firmware Installation thanks to embedded Root Secure Services 57 - Secure data storage with hardware unique key (HUK) 58 - Secure Firmware Update support with TF-M 59 - 2 AES coprocessors including one with DPA resistance 60 - Public key accelerator, DPA resistant 61 - On-the-fly decryption of Octo-SPI external memories 62 - HASH hardware accelerator 63 - Active tampers 64 - True Random Number Generator NIST SP800-90B compliant 65 - 96-bit unique ID 66 - 512-byte One-Time Programmable for user data 67 - Active tampers 68 69- Clock management: 70 71 - 4 to 50 MHz crystal oscillator 72 - 32 kHz crystal oscillator for RTC (LSE) 73 - Internal 16 MHz factory-trimmed RC ( |plusminus| 1%) 74 - Internal low-power 32 kHz RC ( |plusminus| 5%) 75 - 2 internal multispeed 100 kHz to 48 MHz oscillators, including one auto-trimmed by 76 LSE (better than |plusminus| 0.25 % accuracy) 77 - 3 PLLs for system clock, USB, audio, ADC 78 - Internal 48 MHz with clock recovery 79 80- Power management 81 82 - Embedded regulator (LDO) 83 - Embedded SMPS step-down converter supporting switch on-the-fly and voltage scaling 84 85- RTC with HW calendar and calibration 86- Up to 136 fast I/Os, most 5 V-tolerant, up to 14 I/Os with independent supply down to 1.08 V 87- Up to 24 capacitive sensing channels: support touchkey, linear and rotary touch sensors 88- Up to 17 timers and 2 watchdogs 89 90 - 2x 16-bit advanced motor-control 91 - 2x 32-bit and 5 x 16-bit general purpose 92 - 4x low-power 16-bit timers (available in Stop mode) 93 - 2x watchdogs 94 - 2x SysTick timer 95 96- ART accelerator 97 98 - 8-Kbyte instruction cache allowing 0-wait-state execution from Flash and 99 external memories: up to 160 MHz, MPU, 240 DMIPS and DSP 100 - 4-Kbyte data cache for external memories 101 102- Memories 103 104 - 2-Mbyte Flash memory with ECC, 2 banks read-while-write, including 512 Kbytes with 100 kcycles 105 - 786-Kbyte SRAM with ECC OFF or 722-Kbyte SRAM including up to 322-Kbyte SRAM with ECC ON 106 - External memory interface supporting SRAM, PSRAM, NOR, NAND and FRAM memories 107 - 2 Octo-SPI memory interfaces 108 109- Rich analog peripherals (independent supply) 110 111 - 14-bit ADC 2.5-Msps, resolution up to 16 bits with hardware oversampling 112 - 12-bit ADC 2.5-Msps, with hardware oversampling, autonomous in Stop 2 mode 113 - 12-bit DAC, low-power sample and hold 114 - 2 operational amplifiers with built-in PGA 115 - 2 ultra-low-power comparators 116 117- Up to 22 communication interfaces 118 119 - USB Type-C / USB power delivery controller 120 - USB OTG 2.0 full-speed controller 121 - 2x SAIs (serial audio interface) 122 - 4x I2C FM+(1 Mbit/s), SMBus/PMBus 123 - 6x USARTs (ISO 7816, LIN, IrDA, modem) 124 - 3x SPIs (5x SPIs with dual OCTOSPI in SPI mode) 125 - 1x FDCAN 126 - 2x SDMMC interface 127 - 16- and 4-channel DMA controllers, functional in Stop mode 128 - 1 multi-function digital filter (6 filters)+ 1 audio digital filter with 129 sound-activity detection 130 131- CRC calculation unit 132- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade| 133- True Random Number Generator (RNG) 134 135- Graphic features 136 137 - Chrom-ART Accelerator (DMA2D) for enhanced graphic content creation 138 - 1 digital camera interface 139 140- Mathematical co-processor 141 142 - CORDIC for trigonometric functions acceleration 143 - FMAC (filter mathematical accelerator) 144 145 146More information about STM32U585AI can be found here: 147 148- `STM32U585 on www.st.com`_ 149- `STM32U585 reference manual`_ 150 151Motion and environmental sensors 152================================ 153 154 - **LSM6DSV16X** 6-axis inertial measurement unit 155 (`lsm6dsv16x datasheet`_) 156 - **LIS2MDL** 3-axis magnetometer 157 (`lis2mdl datasheet`_) 158 - **LPS22DF** Altimeter / pressure sensor 159 (`lps22df datasheet`_) 160 - **LIS2DU12** 3-axis accelerometer 161 (`lis2du12 datasheet`_) 162 - **STTS22H** Digital temperature sensor 163 (`stts22hh datasheet`_) 164 - **MP23db01HP** Microphone / audio sensor 165 (`mp23db01hp datasheet`_) 166 167Connections and IOs 168=================== 169 170- 4x user LEDs 171 172 - **led0** (Green) 173 - **led1** (Red - shared with BLE) 174 - **led2** (Yellow) 175 - **led3** (Blue) 176 177 178- 4x buttons/switch 179 180 - **User BT1** button, available to user application 181 - **User BT2** / **boot0** button, available to user application 182 but useful to let the SensorTile.box PRO enter DFU mode 183 if found pressed after h/w reset (see **rst** button and 184 `Programming and Debugging`_ section) 185 - **rst** button, used to reset the board (not available on case) 186 - **power** switch, used to Power on/off the board 187 188System Clock 189============ 190 191SensorTile.box PRO System Clock could be driven by internal or external 192oscillator, as well as main PLL clock. By default, the System clock is 193driven by the PLL clock at 80MHz, driven by the 16MHz external oscillator. 194The system clock can be boosted to 120MHz. 195The internal AHB/APB1/APB2 AMBA buses are all clocked at 80MHz. 196 197Serial Port 198=========== 199 200The SensorTile.box PRO has 4 U(S)ARTs. The UART4 is connected to JTAG/SWD connector 201and may be used as console. 202 203USB interface 204============= 205 206SensorTile.box PRO can be connected as a USB device to a PC host through its USB-C connector. 207The final application may use it to declare SensorTile.box PRO device as belonging to a 208certain standard or vendor class, e.g. a CDC, a mass storage or a composite device with both 209functions. 210 211BlueNRG-LP chip 212=============== 213 214The board is equipped with an STMicroelectronics `BlueNRG-LP`_ chip. Before running Zephyr Bluetooth samples 215on SensorTile.box PRO, it is required to upgrade the BlueNRG chip with a Zephyr BLE stack compatible firmware. 216The upgrade may be easily performed using the application provided in `SensorTile.box PRO BLE firmware upgrade package`_. 217For more information about BLE binaries for SensorTile.box family, see `stsw-mkbox-bleco`_. 218 219Console 220======= 221 222There are two possible options for Zephyr console output: 223 224- through common CDC ACM UART backend configuration for all boards 225 226- through UART4 which is available on SWD connector (JP2). In this case a JTAG adapter 227 can be used to connect SensorTile.box PRO and have both SWD and console lines available. 228 229 To enable console and shell over UART: 230 231 - in your prj.conf, override the board's default configuration by setting :code:`CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n` 232 233 - add an overlay file named ``<board>.overlay``: 234 235.. code-block:: dts 236 237 / { 238 chosen { 239 zephyr,console = &uart4; 240 zephyr,shell-uart = &uart4; 241 }; 242 }; 243 244 245Console default settings are 115200 8N1. 246 247Programming and Debugging 248************************* 249 250There are two alternative methods of flashing ST Sensortile.box Pro board: 251 2521. Using DFU software tools 253 254 This method requires to enter STM32U585 ROM bootloader DFU mode 255 by powering up (or reset) the board while keeping the BOOT0 button pressed. 256 No additional hardware is required except a USB-C cable. This method is fully 257 supported by :ref:`flash-debug-host-tools`. 258 You can read more about how to enable and use the ROM bootloader by checking 259 the application note `AN2606`_ (STM32U585xx section). 260 2612. Using SWD hardware tools 262 263 This method requires to connect additional hardware, like a ST-LINK/V3 264 embedded debug tool, to the board SWD connector. 265 266DFU flashing 267============ 268 269Install dfu-util 270---------------- 271 272It is recommended to use at least v0.9 of dfu-util. The package available in 273Debian and Ubuntu can be quite old, so you might have to build dfu-util from source. 274Information about how to get the source code and how to build it can be found 275at the `DFU-UTIL website`_ 276 277Flash an Application to SensorTile.box PRO 278------------------------------------------ 279 280While pressing the BOOT0 button, connect the USB-C cable to the USB OTG SensorTile.box PRO 281port and to your computer. The board should be forced to enter DFU mode. 282 283Check that the board is indeed in DFU mode: 284 285.. code-block:: console 286 287 $ sudo dfu-util -l 288 dfu-util 0.9 289 290 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. 291 Copyright 2010-2019 Tormod Volden and Stefan Schmidt 292 This program is Free Software and has ABSOLUTELY NO WARRANTY 293 Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ 294 295 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" 296 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" 297 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" 298 299You should see following confirmation on your Linux host: 300 301.. code-block:: console 302 303 $ dmesg 304 usb 2-2: new full-speed USB device number 74 using xhci_hcd 305 usb 2-2: New USB device found, idVendor=0483, idProduct=df11 306 usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 307 usb 2-2: Product: STM32 BOOTLOADER 308 usb 2-2: Manufacturer: STMicroelectronics 309 usb 2-2: SerialNumber: 204A325D574D 310 311You can build and flash the provided sample application 312(:zephyr:code-sample:`sensortile_box_pro_sensors`) that reads sensors data and outputs 313values on the console. 314 315References 316********** 317 318.. target-notes:: 319 320.. _SensorTile.box PRO website: 321 https://www.st.com/en/evaluation-tools/steval-mkboxpro.html 322 323.. _UM3133: 324 https://www.st.com/resource/en/user_manual/um3133-getting-started-with-sensortilebox-pro-multisensors-and-wireless-connectivity-development-kit-for-any-intelligent-iot-node-stmicroelectronics.pdf 325 326.. _schematic: 327 https://www.st.com/resource/en/schematic_pack/steval-mkboxpro-schematic.pdf 328 329.. _STM32U585 on www.st.com: 330 https://www.st.com/en/microcontrollers-microprocessors/stm32u575-585.html 331 332.. _STM32U585 reference manual: 333 https://www.st.com/resource/en/reference_manual/rm0456-stm32u575585-armbased-32bit-mcus-stmicroelectronics.pdf 334 335.. _lsm6dsv16x datasheet: 336 https://www.st.com/en/mems-and-sensors/lsm6dsv16x.html 337 338.. _lis2mdl datasheet: 339 https://www.st.com/en/mems-and-sensors/lis2mdl.html 340 341.. _lps22df datasheet: 342 https://www.st.com/en/mems-and-sensors/lps22df.html 343 344.. _lis2du12 datasheet: 345 https://www.st.com/en/mems-and-sensors/lis2du12.html 346 347.. _stts22hh datasheet: 348 https://www.st.com/en/mems-and-sensors/stts22h.html 349 350.. _mp23db01hp datasheet: 351 https://www.st.com/en/mems-and-sensors/mp23db01hp.html 352 353.. _BlueNRG-LP: 354 https://www.st.com/en/wireless-connectivity/bluenrg-lp.html 355 356.. _SensorTile.box PRO BLE firmware upgrade package: 357 https://github.com/STMicroelectronics/stsw-mkbox-bleco/blob/master/ble_fw_upg_app/README.rst 358 359.. _stsw-mkbox-bleco: 360 https://www.st.com/en/embedded-software/stsw-mkbox-bleco.html 361 362.. _AN2606: 363 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 364 365.. _DFU-UTIL website: 366 http://dfu-util.sourceforge.net/ 367