1.. zephyr:board:: nucleo_u385rg_q
2
3Overview
4********
5
6The Nucleo U385RG board, featuring an ARM |reg| Cortex |reg| -M33 with
7TrustZone |reg| based STM32U385RG MCU, provides an affordable and flexible
8way for users to try out new concepts and build prototypes by choosing from
9the various combinations of performance and power consumption features.
10Here are some highlights of the Nucleo U385RG board:
11
12- STM32U385RG microcontroller in an LQFP64 or LQFP48 package
13- Two types of extension resources:
14
15  - Arduino |reg| Uno V3 connectivity
16  - ST morpho extension pin headers for full access to all STM32U3 I/Os
17
18- On-board STLINK-V2EC debugger/programmer with USB re-enumeration
19  capability: mass storage, Virtual COM port, and debug port
20- Flexible board power supply:
21
22  - USB VBUS or external source(3.3V, 5V, 7 - 12V)
23
24- Two push-buttons: USER and RESET
25- 32.768 kHz crystal oscillator
26- Second user LED shared with ARDUINO |reg| Uno V3
27- External or internal SMPS to generate Vcore logic supply
28- 24 MHz or 48 MHz HSE
29- User USB Device full speed, or USB SNK/UFP full speed
30- Cryptography
31- CAN FD transceiver
32- Board connectors:
33
34 - External SMPS experimentation dedicated connector
35 - USB Type-C |reg| , Micro-B, or Mini-B connector for the ST-LINK
36 - USB Type-C |reg| user connector
37 - MIPI |reg| debug connector
38 - CAN FD header
39
40More information about the board can be found at the `NUCLEO_U385RG website`_.
41
42Hardware
43********
44
45The STM32U385xx devices are an ultra-low-power microcontrollers family (STM32U3
46Series) based on the high-performance Arm |reg| Cortex |reg|-M33 32-bit RISC core.
47They operate at a frequency of up to 96 MHz.
48
49- Includes ST state-of-the-art patented technology
50- Ultra-low-power with FlexPowerControl:
51
52  - 1.71 V to 3.6 V power supply
53  - -40 °C to +105 °C temperature range
54  - VBAT mode: supply for RTC, 32 x 32-bit backup registers
55  - 1.6 μA Stop 3 mode with 8-Kbyte SRAM
56  - 2.2 μA Stop 3 mode with full SRAM
57  - 3.8 μA Stop 2 mode with 8-Kbyte SRAM
58  - 4.5 μA Stop 2 mode with full SRAM
59  - 9.5 μA/MHz Run mode @ 3.3 V (While(1) SMPS step-down converter mode)
60  - 13 μA/MHz Run mode @ 3.3 V/48 MHz (CoreMark |reg| SMPS step-down converter mode)
61  - 16 μA/MHz Run mode @ 3.3 V/96 MHz (CoreMark |reg| SMPS step-down converter mode)
62  - Brownout reset
63
64- Core:
65
66  - 32-bit Arm |reg| Cortex |reg|-M33 CPU with TrustZone |reg| and FPU
67
68- ART Accelerator:
69
70  - 8-Kbyte instruction cache allowing 0-wait-state execution from flash and external memories:
71    frequency up to 96 MHz, MPU, 144 DMIPS and DSP instructions
72
73- Power management:
74
75  - Embedded regulator (LDO) and SMPS step-down converter supporting switch on-the-fly and voltage scaling
76
77- Benchmarks:
78
79  - 1.5 DMIPS/MHz (Drystone 2.1)
80  - 387 CoreMark |reg| (4.09 CoreMark/MHz at 56 MHz)
81  - 500 ULPMark |trade| -CP
82  - 117 ULPMark |trade| -CM
83  - 202000 SecureMark |trade| -TLS
84
85- Memories:
86
87  - 1-Mbyte flash memory with ECC, 2 banks read-while-write
88  - 256 Kbytes of SRAM including 64 Kbytes with hardware parity check
89  - OCTOSPI external memory interface supporting SRAM, PSRAM, NOR, NAND, and FRAM memories
90
91- General-purpose input/outputs:
92
93  - Up to 82 fast I/Os with interrupt capability most 5 V-tolerant and up to 14 I/Os with independent supply down to 1.08 V
94
95- Clock management:
96
97  - 4 to 50 MHz crystal oscillator
98  - 32.768 kHz crystal oscillator for RTC (LSE)
99  - Internal 16 MHz factory-trimmed RC (±1 %)
100  - Internal low-power RC with frequency 32 kHz or 250 Hz (±5 %)
101  - 2 internal multispeed 3 MHz to 96 MHz oscillators
102  - Internal 48 MHz with clock recovery
103  - Accurate MSI in PLL-mode and up to 96 MHz with 32.768 kHz, 16 MHz, or 32 MHz crystal oscillator
104
105- Security and cryptography:
106
107  - Arm |reg| TrustZone |reg| and securable I/Os, memories, and peripherals
108  - Flexible life cycle scheme with RDP and password protected debug
109  - Root of trust due to unique boot entry and secure hide protection area (HDP)
110  - Secure firmware installation (SFI) from embedded root secure services (RSS)
111  - Secure data storage with hardware unique key (HUK)
112  - Secure firmware upgrade
113  - Support of Trusted firmware for Cortex |reg| M (TF-M)
114  - Two AES coprocessors, one with side channel attack resistance (SCA) (SAES)
115  - Public key accelerator, SCA resistant
116  - Key hardware protection
117  - Attestation keys
118  - HASH hardware accelerator
119  - True random number generator, NIST SP800-90B compliant
120  - 96-bit unique ID
121  - 512-byte OTP (one-time programmable)
122  - Antitamper protection
123
124- Up to 15 timers and 2 watchdogs :
125
126  - 1x 16-bit advanced motor-control
127  - 3x 32-bit and 3x 16-bit general purpose
128  - 2x 16-bit basic
129  - 4x low-power 16-bit timers (available in Stop mode)
130  - 2x watchdogs
131  - 2x SysTick timer
132  - RTC with hardware calendar
133  - Alarms
134  - Calibration
135
136- Up to 19 communication peripherals:
137
138  - 1 USB 2.0 full-speed controller
139  - 1 SAI (serial audio interface)
140  - 3 I2C FM+(1 Mbit/s), SMBus/PMBus |trade|
141  - 2 I3C (SDR), with support of I2C FM+ mode
142  - 2 USARTs and 2 UARTs (SPI, ISO 7816, LIN, IrDA, modem), 1 LPUART
143  - 3 SPIs (6 SPIs including 1 with OCTOSPI + 2 with USART)
144  - 1 CAN FD controller
145  - 1 SDMMC interface
146  - 1 audio digital filter with sound-activity detection
147
148- 12-channel GPDMA controller, functional in Sleep and Stop modes (up to Stop 2)
149- Up to 21 capacitive sensing channels:
150
151  - Support touch key, linear, and rotary touch sensors
152
153- Rich analog peripherals (independent supply):
154
155  - 2x 12-bit ADC 2.5 Msps, with hardware oversampling
156  - 12-bit DAC module with 2 D/A converters, low-power sample and hold, autonomous in Stop 1 mode
157  - 2 operational amplifiers with built-in PGA
158  - 2 ultralow-power comparators
159
160- CRC calculation unit
161- Debug:
162
163  - Development support: serial-wire debug (SWD), JTAG, Embedded Trace Macrocell |trade| (ETM)
164
165- ECOPACK2 compliant packages
166
167More information about STM32U385RG can be found here:
168
169- `STM32U385RG on www.st.com`_
170- `STM32U385RG reference manual`_
171
172Supported Features
173==================
174
175.. zephyr:board-supported-hw::
176
177Connections and IOs
178===================
179
180Nucleo U385RG Board has 14 GPIO controllers. These controllers are responsible
181for pin muxing, input/output, pull-up, etc.
182
183For more details please refer to `STM32U385RG board user manual`_.
184
185Default Zephyr Peripheral Mapping:
186----------------------------------
187
188- DAC1_OUT1 : PA4
189- I2C1 SCL/SDA : PB6/PB7 (Arduino I2C)
190- FDCAN1_TX : PA12
191- FDCAN1_RX : PA11
192- LD4 : PA5
193- LPUART_1_TX : PA2
194- LPUART_1_RX : PA3
195- SPI3 NSS/SCK/MISO/MOSI : PA15/PB3/PB4/PB5 (Arduino SPI)
196- UART_1_TX : PA9
197- UART_1_RX : PA10
198- UART_3_TX : PC10
199- UART_3_RX : PC11
200- USER_PB : PC13
201
202System Clock
203------------
204
205Nucleo U385RG System Clock could be driven by internal or external oscillator,
206as well as main PLL clock. By default System clock is driven by PLL clock at
20748MHz, driven by 4MHz medium speed internal oscillator.
208
209Serial Port
210-----------
211
212Nucleo U385RG board has 4 U(S)ARTs, 1 LPUART. The Zephyr console output is assigned to
213USART1. Default settings are 115200 8N1.
214
215CAN
216---
217The STM32U385RG_Q does not have an onboard CAN transceiver. In
218order to use the CAN bus on the this board, an external CAN bus
219transceiver must be connected to ``PA11`` (``FDCAN1_RX``) and ``PA12``
220(``FDCAN1_TX``).
221
222
223Programming and Debugging
224*************************
225
226.. zephyr:board-supported-runners::
227
228Nucleo U385RG board includes an ST-LINK/V3 embedded debug tool interface.
229This probe allows to flash the board using various tools.
230
231Flashing
232========
233
234The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
235so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
236
237Alternatively, JLink or pyOCD can also be used to flash the board using
238the ``--runner`` (or ``-r``) option:
239
240.. code-block:: console
241
242   $ west flash --runner pyocd
243   $ west flash --runner jlink
244
245For pyOCD, additional target information needs to be installed
246by executing the following pyOCD commands:
247
248.. code-block:: console
249
250   $ pyocd pack --update
251   $ pyocd pack --install stm32u3
252
253
254Flashing an application to Nucleo U385RG
255----------------------------------------
256
257Connect the Nucleo U385RG to your host computer using the USB port.
258Then build and flash an application. Here is an example for the
259:zephyr:code-sample:`hello_world` application.
260
261Run a serial host program to connect with your Nucleo board:
262
263.. code-block:: console
264
265   $ minicom -D /dev/ttyACM0
266
267Then build and flash the application.
268
269.. zephyr-app-commands::
270   :zephyr-app: samples/hello_world
271   :board: nucleo_u385rg_q
272   :goals: build flash
273
274You should see the following message on the console:
275
276.. code-block:: console
277
278   Hello World! nucleo_u385rg_q
279
280Debugging
281=========
282
283Default debugger for this board is OpenOCD. It can be used in the usual way.
284Here is an example for the :zephyr:code-sample:`blinky` application.
285
286.. zephyr-app-commands::
287   :zephyr-app: samples/basic/blinky
288   :board: nucleo_u385rg_q
289   :goals: debug
290
291Note: Check the ``build/tfm`` directory to ensure that the commands required by these scripts
292(``readlink``, etc.) are available on your system. Please also check ``STM32_Programmer_CLI``
293(which is used for initialization) is available in the PATH.
294
295.. _NUCLEO_U385RG website:
296  https://www.st.com/en/evaluation-tools/nucleo-u385rg.html
297
298.. _STM32U385RG board user manual:
299   https://www.st.com/resource/en/user_manual/um3062-stm32u3u5-nucleo64-board-mb1841-stmicroelectronics.pdf
300
301.. _STM32U385RG on www.st.com:
302   https://www.st.com/en/microcontrollers-microprocessors/stm32u385rg
303
304.. _STM32U385RG reference manual:
305   https://www.st.com/resource/en/reference_manual/rm0487-stm32u3-series-armbased-32bit-mcus-stmicroelectronics.pdf
306
307.. _STM32CubeProgrammer:
308   https://www.st.com/en/development-tools/stm32cubeprog.html
309