Skip to content

Commit

Permalink
boards: add USB HS 2.0 support for the Nucleo u5a5jz-q board (Issue z…
Browse files Browse the repository at this point in the history
…ephyrproject-rtos#79823)

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 <adrian.chadd@meta.com>
  • Loading branch information
Adrian Chadd authored and Adrian Chadd committed Dec 3, 2024
1 parent 41b0bd1 commit 50a3173
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
13 changes: 11 additions & 2 deletions boards/st/nucleo_u5a5zj_q/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ The Zephyr nucleo_u5a5zj_q board configuration supports the following hardware f
+-----------+------------+-------------------------------------+
| RTC | on-chip | rtc |
+-----------+------------+-------------------------------------+
| USB | on-chip | USB 2.0 HS |
+-----------+------------+-------------------------------------+


Other hardware features are not yet supported on this Zephyr port.
Expand Down Expand Up @@ -245,27 +247,34 @@ Default Zephyr Peripheral Mapping:
- UART_2_TX : PD5
- UART_2_RX : PD6
- USER_PB : PC13
- USB_DM : PA11
- USB_DP : PA12

System Clock
------------

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

Serial Port
-----------

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


Backup SRAM
-----------

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

Using USB
---------

USB 2.0 high speed (HS) operation requires the HSE clock source to be populated
and enabled. The Nucleo U5A5ZJ-Q includes the 16MHz oscillator and required
jumper settings.

Programming and Debugging
*************************
Expand Down
19 changes: 10 additions & 9 deletions boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,23 @@
status = "okay";
};

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

&clk_msis {
&clk_lse {
status = "okay";
msi-range = <4>;
msi-pll-mode;
};

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

Expand Down
6 changes: 6 additions & 0 deletions boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q.dts
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,9 @@
&gpdma1 {
status = "okay";
};

zephyr_udc0: &usbotg_hs {
pinctrl-0 = <&usb_otg_hs_dm_pa11 &usb_otg_hs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};
1 change: 1 addition & 0 deletions boards/st/nucleo_u5a5zj_q/nucleo_u5a5zj_q.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ supported:
- backup_sram
- dma
- rtc
- usb_device
ram: 2450
flash: 4096

0 comments on commit 50a3173

Please sign in to comment.