Skip to content

Commit 1617bd9

Browse files
Adrian Chaddkartben
authored andcommitted
boards: nucleo_u5a5zj_q: add USB HS 2.0 support
This board has the required clock crystal (X4) and jumper settings present to enable the USB 2.0 HS support. * Enable the HSE clock (16MHz) * Flip the PLL1 configuration over to use the HSE clock, but still outputting 160MHz to sysclk/apbclk. * Add the USB HS device tree node. * Update the board documentation. Signed-off-by: Adrian Chadd <[email protected]>
1 parent f72ef5c commit 1617bd9

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

boards/st/nucleo_u5a5zj_q/doc/index.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ The Zephyr nucleo_u5a5zj_q board configuration supports the following hardware f
204204
+-----------+------------+-------------------------------------+
205205
| RTC | on-chip | rtc |
206206
+-----------+------------+-------------------------------------+
207+
| USB | on-chip | USB 2.0 HS |
208+
+-----------+------------+-------------------------------------+
207209

208210

209211
Other hardware features are not yet supported on this Zephyr port.
@@ -245,27 +247,34 @@ Default Zephyr Peripheral Mapping:
245247
- UART_2_TX : PD5
246248
- UART_2_RX : PD6
247249
- USER_PB : PC13
250+
- USB_DM : PA11
251+
- USB_DP : PA12
248252

249253
System Clock
250254
------------
251255

252256
Nucleo U5A5ZJ Q System Clock could be driven by internal or external oscillator,
253257
as well as main PLL clock. By default System clock is driven by PLL clock at
254-
160MHz, driven by 4MHz medium speed internal oscillator.
258+
160MHz, driven by the 16MHz high speed oscillator.
255259

256260
Serial Port
257261
-----------
258262

259263
Nucleo U5A5ZJ Q board has 6 U(S)ARTs. The Zephyr console output is assigned to
260264
USART1. Default settings are 115200 8N1.
261265

262-
263266
Backup SRAM
264267
-----------
265268

266269
In order to test backup SRAM you may want to disconnect VBAT from VDD. You can
267270
do it by removing ``SB50`` jumper on the back side of the board.
268271

272+
Using USB
273+
---------
274+
275+
USB 2.0 high speed (HS) operation requires the HSE clock source to be populated
276+
and enabled. The Nucleo U5A5ZJ-Q includes the 16MHz oscillator and required
277+
jumper settings.
269278

270279
Programming and Debugging
271280
*************************

boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q-common.dtsi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,23 @@
5555
status = "okay";
5656
};
5757

58-
&clk_lse {
58+
/* This board has a 16MHz crystal attached */
59+
&clk_hse {
60+
clock-frequency = <DT_FREQ_M(16)>;
5961
status = "okay";
6062
};
6163

62-
&clk_msis {
64+
&clk_lse {
6365
status = "okay";
64-
msi-range = <4>;
65-
msi-pll-mode;
6666
};
6767

6868
&pll1 {
69-
div-m = <1>;
70-
mul-n = <80>;
71-
div-q = <2>;
72-
div-r = <2>;
73-
clocks = <&clk_msis>;
69+
/* HSE 16MHz source, outputting 160MHz to sysclk and apbclk */
70+
div-m = <4>; /* input divisor */
71+
mul-n = <80>; /* VCO multiplication factor */
72+
div-q = <2>; /* system clock divisor */
73+
div-r = <2>; /* peripheral clock divisor */
74+
clocks = <&clk_hse>;
7475
status = "okay";
7576
};
7677

boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@
7474
&gpdma1 {
7575
status = "okay";
7676
};
77+
78+
zephyr_udc0: &usbotg_hs {
79+
pinctrl-0 = <&usb_otg_hs_dm_pa11 &usb_otg_hs_dp_pa12>;
80+
pinctrl-names = "default";
81+
status = "okay";
82+
};

boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ supported:
2121
- backup_sram
2222
- dma
2323
- rtc
24+
- usb_device
2425
ram: 2450
2526
flash: 4096

0 commit comments

Comments
 (0)