Add initial board support for nRF54LM20 DK#3574
Conversation
|
Hi, are you still working on this ? |
|
No, i was hoping someone could review it, let me know if i missed something. |
|
Ok, please remove commited submodules. |
bbca96b to
d6db296
Compare
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in sizeNo entries. Changes <1% in size
No changes
|
|
| target | .text | .rodata | .data | .bss | total | % diff |
|---|---|---|---|---|---|---|
| adafruit_clue/board_test | 6,516 → 8,012 (+1,496) | — | — | 420 → 556 (+136) | 7,664 → 9,296 (+1,632) | +21.3% |
| adafruit_clue/dfu_runtime | 10,772 → 12,204 (+1,432) | — | — | 816 → 952 (+136) | 12,596 → 14,164 (+1,568) | +12.4% |
| adafruit_clue/hid_generic_inout | 11,912 → 13,344 (+1,432) | — | — | 1,020 → 1,156 (+136) | 13,764 → 15,332 (+1,568) | +11.4% |
| adafruit_clue/hid_multiple_interface | 12,532 → 13,964 (+1,432) | — | — | 896 → 1,032 (+136) | 14,436 → 16,004 (+1,568) | +10.9% |
| adafruit_clue/hid_boot_interface | 12,588 → 14,020 (+1,432) | — | — | 896 → 1,032 (+136) | 14,444 → 16,012 (+1,568) | +10.9% |
| adafruit_clue/hid_composite | 12,620 → 14,052 (+1,432) | — | — | 884 → 1,020 (+136) | 14,608 → 16,176 (+1,568) | +10.7% |
| adafruit_clue/midi_test | 12,800 → 14,232 (+1,432) | — | — | 1,144 → 1,280 (+136) | 14,872 → 16,440 (+1,568) | +10.5% |
| raspberrypi_zero/hid_boot_interface | 40,732 → 41,304 (+572) | 807 → 4,323 (+3,516) | — | — | 41,539 → 45,627 (+4,088) | +9.8% |
| raspberrypi_zero/hid_multiple_interface | 40,564 → 41,136 (+572) | 1,011 → 4,527 (+3,516) | — | — | 41,575 → 45,663 (+4,088) | +9.8% |
| adafruit_clue/printer_to_cdc | 13,692 → 15,124 (+1,432) | — | — | 1,436 → 1,572 (+136) | 16,116 → 17,684 (+1,568) | +9.7% |
d6db296 to
a39e9cd
Compare
|
Thanks for removing submodules would have done it myself as well, just didnt get around to it. Anything else still missing? |
…for other ports. add board_uart_read() for nrf
hathach
left a comment
There was a problem hiding this comment.
perfect, thank you. Tested and it works well. I haven't tested with ISO just yet, but I think we could do that with follow-up PR. This is great start for nrf54 series. I update board_uart_read/write(), move the init sequence to dwc2_clock_init() which is run before accessing the dwc2 register, also fix freeRTOS config for secure mode. The speed isn't great for highspeed device, it could be dwc2 not optimized enough, will come back to this later.
nrf54lm20dk device/cdc_dual_ports ... OK in 1.5s
nrf54lm20dk device/dfu ... OK in 1.8s
nrf54lm20dk device/cdc_msc ... dd read: 1.6 MB/s, write: 1.5 MB/s OK in 2.3s
nrf54lm20dk device/dfu_runtime ... OK in 1.7s
nrf54lm20dk device/cdc_msc_freertos ... dd read: 1.2 MB/s, write: 1.2 MB/s OK in 2.5s
nrf54lm20dk device/hid_boot_interface ... OK in 1.7s
nrf54lm20dk device/msc_dual_lun ... OK in 2.9s
nrf54lm20dk device/hid_generic_inout ... OK in 2.1s
nrf54lm20dk device/printer_to_cdc ... OK in 5.1s
nrf54lm20dk device/midi_test ... OK in 5.9s
nrf54lm20dk device/mtp ... OK in 1.8s
nrf54lm20dk device/board_test ... OK in 0.6s
There was a problem hiding this comment.
Pull request overview
This PR adds initial TinyUSB BSP/port support for the Nordic nRF54LM20 DK, including DWC2 (USBHS) bring-up steps and build-system plumbing, plus a small refactor of the DWC2 FIFO sizing configuration to use DFIFO depth (words) instead of byte-sized SRAM constants.
Changes:
- Refactor DWC2 controller configuration to use
otg_dfifo_depth(32-bit words) and call a newdwc2_clock_init()hook before any DWC2 register access. - Add nRF54LM20 DK board support (linker script, board definitions, build presets) and nRF54LM20-specific clock/power init for the DWC2 core.
- Update multiple DWC2 port headers (STM32/ESP32/EFM32/GD32/XMC/AT32/BCM/NRF) to the new FIFO-depth configuration model.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/portable/synopsys/dwc2/hcd_dwc2.c | Switch host DFIFO sizing to otg_dfifo_depth and call dwc2_clock_init() early. |
| src/portable/synopsys/dwc2/dwc2_xmc.h | Update XMC controller config to otg_dfifo_depth; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_type.h | Replace ep_fifo_size with otg_dfifo_depth (words) and add a new core rev constant. |
| src/portable/synopsys/dwc2/dwc2_stm32.h | Convert STM32 DWC2 configuration to DFIFO depth model; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_nrf.h | Add nRF54LM20-specific USBHS/DWC2 clock+reset+PHY enable sequence; update DFIFO depth. |
| src/portable/synopsys/dwc2/dwc2_info.py | Update/add DWC2 register fingerprints for nRF54LM20 and minor formatting tweaks. |
| src/portable/synopsys/dwc2/dwc2_gd32.h | Update GD32 config to otg_dfifo_depth; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_esp32.h | Update ESP32 configs to otg_dfifo_depth; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_efm32.h | Update EFM32 config to otg_dfifo_depth; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_common.h | Document new required port symbol dwc2_clock_init(). |
| src/portable/synopsys/dwc2/dwc2_bcm.h | Update BCM config to otg_dfifo_depth; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_at32.h | Update AT32 config to otg_dfifo_depth; add dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dcd_dwc2.c | Switch device DFIFO sizing to otg_dfifo_depth and call dwc2_clock_init() early. |
| src/common/tusb_mcu.h | Mark nRF54 as high-speed capable (TUP_RHPORT_HIGHSPEED). |
| hw/bsp/nrf/nrfx_config/nrfx_config_common.h | Enable the correct UARTE instance for nRF54LM20A EngA. |
| hw/bsp/nrf/linker/nrf54lm20a_enga_xxaa_application.ld | Add linker script for nRF54LM20A EngA application build. |
| hw/bsp/nrf/FreeRTOSConfig/FreeRTOSConfig.h | Enable secure-only FreeRTOS CM33 config for nRF54 targets. |
| hw/bsp/nrf/family.mk | Add nRF54LM20A EngA variant handling and adjust nrfx source inclusion. |
| hw/bsp/nrf/family.cmake | Add nRF54LM20A EngA variant handling, linker/startup selection, and nrfx source selection. |
| hw/bsp/nrf/family.c | Add UART20 selection, USBHS IRQ path, UART RX buffering, and nRF54LM20 clock init. |
| hw/bsp/nrf/boards/nrf54lm20dk/board.mk | Define the new board’s MCU variant and flashing configuration. |
| hw/bsp/nrf/boards/nrf54lm20dk/board.h | Provide pin mappings for LED/button/UART for nRF54LM20 DK. |
| hw/bsp/nrf/boards/nrf54lm20dk/board.cmake | Add CMake board config (mirrors existing nRF54H20DK behavior). |
| hw/bsp/BoardPresets.json | Add build presets for the new nrf54lm20dk board. |
| docs/reference/boards.rst | Add nrf54lm20dk to the documented board list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The cdc_msc device example works fine. Isochronous OUT transfers hit a babble error (DOEPINT bit 12) on every packet I am not really sure why that is.
The nrfx 3.14 commit which is used in get_deps.py is a little outdated so it predates the renaming done in nrfx 4.1.0 which reads:
in the nrfx changelog