Skip to content

Update BSP#3550

Merged
hathach merged 10 commits into
masterfrom
update-bsp
Mar 14, 2026
Merged

Update BSP#3550
hathach merged 10 commits into
masterfrom
update-bsp

Conversation

@hathach
Copy link
Copy Markdown
Owner

@hathach hathach commented Mar 13, 2026

Summary

  • Added support for CH32F20X family of MCUs and updated relevant board configuration files.
  • Renamed and migrated kinetis_k32l to use the updated mcux-devices framework.

Copilot AI review requested due to automatic review settings March 13, 2026 08:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the BSP and dependency plumbing to add CH32F20X MCU family support, refactor/modernize the Renesas RX BSP (including CMake support and additional flash tooling), and migrate/rename Kinetis K32L support to use updated NXP mcux-devices sources.

Changes:

  • Add CH32F20X family CMake support, update example skip lists accordingly, and adjust WCH build configuration for USBHS.
  • Refactor Renesas RX BSP by introducing a shared family.c/family.cmake, consolidating board responsibilities, and adding an RFP flashing target.
  • Update dependency fetching/docs/CI to reflect the Kinetis K32L migration (new NXP device repo, updated family naming).

Reviewed changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/get_deps.py Updates dependency mapping to fetch K32L via mcuxsdk-core + mcux-devices-kinetis and adjusts CMSIS family lists.
test/hil/tinyusb.json Reorders/relocates a HIL target entry (mimxrt1015_evk).
src/tusb_option.h Removes Espressif vendor macros.
src/osal/osal_freertos.h Switches Espressif detection to ESP_PLATFORM for spinlock handling.
src/common/tusb_verify.h Switches Espressif detection to ESP_PLATFORM for RISC-V breakpoint handling.
hw/bsp/rx/family.mk Adds shared RX family sources (rusb2_common.c, family.c).
hw/bsp/rx/family.cmake Introduces RX family CMake build integration and flash helpers.
hw/bsp/rx/family.c Adds shared RX board implementation (UART IRQ handling, USB IRQ forwarding, ticks, syscall stubs).
hw/bsp/rx/boards/rx65n_target/rx65n_target.c Moves board init responsibilities toward shared family code; keeps board-specific pin/clock setup.
hw/bsp/rx/boards/rx65n_target/board.h Adds board-specific macros for LED/button/UART/USB IRQ mapping and clocks.
hw/bsp/rx/boards/rx65n_target/board.cmake Adds RX65N board CMake config and global interrupt-macro compile definitions.
hw/bsp/rx/boards/gr_citrus/hwinit.c Removes redundant HardwareSetup implementation (moved into gr_citrus.c).
hw/bsp/rx/boards/gr_citrus/gr_citrus.c Refactors to board-specific pin init + HardwareSetup only (shared logic moved to RX family).
hw/bsp/rx/boards/gr_citrus/board.h Adds board-specific macros for LED/button/UART/USB and clocks.
hw/bsp/rx/boards/gr_citrus/board.cmake Adds GR-CITRUS CMake board config.
hw/bsp/rx/FreeRTOSConfig/FreeRTOSConfig.h Enables INCLUDE_xTaskGetCurrentTaskHandle.
hw/bsp/kinetis_k32l2/family.mk Removes old K32L2 make-family definition (migration/rename in progress).
hw/bsp/kinetis_k32l2/family.c Removes old K32L2 family implementation (migration/rename in progress).
hw/bsp/kinetis_k32l2/boards/kuiic/kuiic.ld Removes old K32L2 Kuiic linker script.
hw/bsp/kinetis_k32l2/boards/kuiic/clock_config.h Removes old K32L2 Kuiic clock config header.
hw/bsp/kinetis_k32l2/boards/kuiic/clock_config.c Removes old K32L2 Kuiic clock config source.
hw/bsp/kinetis_k32l2/boards/kuiic/board.mk Removes old K32L2 Kuiic make board config.
hw/bsp/kinetis_k32l2/boards/kuiic/board.h Removes old K32L2 Kuiic board header.
hw/bsp/kinetis_k32l2/boards/kuiic/board.cmake Removes old K32L2 Kuiic CMake board config.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2b/clock_config.h Removes old FRDM-K32L2B clock config header.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2b/clock_config.c Removes old FRDM-K32L2B clock config source.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2b/board.mk Removes old FRDM-K32L2B make board config.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2b/board.h Removes old FRDM-K32L2B board header.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2b/board.cmake Removes old FRDM-K32L2B CMake board config.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/clock_config.h Removes old FRDM-K32L2A4S clock config header.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/clock_config.c Removes old FRDM-K32L2A4S clock config source.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/board.mk Removes old FRDM-K32L2A4S make board config.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/board.h Removes old FRDM-K32L2A4S board header.
hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/board.cmake Removes old FRDM-K32L2A4S CMake board config.
hw/bsp/kinetis_k32l2/FreeRTOSConfig/FreeRTOSConfig.h Removes old K32L2 FreeRTOSConfig.
hw/bsp/family_support.cmake Adds family_flash_rfp() flashing target.
hw/bsp/ch32f20x/family.cmake Switches CH32F20X family CMake to WCH SDK layout and USBHS driver; updates flashing to STLink.
hw/bsp/ch32f20x/boards/ch32f205r-r0/board.cmake Adds a CH32F205R-R0 board CMake definition.
examples/host/cdc_msc_hid_freertos/skip.txt Skips CH32F20X for this host FreeRTOS example.
examples/device/midi_test_freertos/skip.txt Skips CH32F20X for this device FreeRTOS example.
examples/device/hid_composite_freertos/skip.txt Skips CH32F20X for this device FreeRTOS example.
examples/device/cdc_msc_freertos/skip.txt Skips CH32F20X for this device FreeRTOS example.
examples/device/audio_test_freertos/skip.txt Skips CH32F20X for this device FreeRTOS example.
examples/device/audio_4_channel_mic_freertos/skip.txt Skips CH32F20X for this device FreeRTOS example.
docs/reference/dependencies.rst Updates the mcux-sdk “Required by” list to use kinetis_k32l naming.
docs/reference/boards.rst Updates board family column from kinetis_k32l2 to kinetis_k32l.
.github/workflows/ci_set_matrix.py Updates CI matrix family key from kinetis_k32l2 to kinetis_k32l.
Comments suppressed due to low confidence (1)

hw/bsp/ch32f20x/family.cmake:76

  • For GNU builds this family no longer uses -nostartfiles, unlike other WCH families (e.g. ch32v20x/ch32v30x). This can pull in the toolchain's default startup objects in addition to the provided startup/vector code, potentially increasing size or causing init/entrypoint conflicts. Consider restoring -nostartfiles (or document why this family is intentionally different).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread hw/bsp/rx/boards/rx65n_target/rx65n_target.c
Comment thread hw/bsp/rx/boards/rx65n_target/board.cmake Outdated
Comment thread src/tusb_option.h
Comment thread docs/reference/dependencies.rst Outdated
Comment thread hw/bsp/family_support.cmake
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9eb6372b66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci_set_matrix.py Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 13, 2026

MemBrowse Memory Report

Top 10 targets by memory change (%) (out of 2156 targets) View Project Dashboard →

target .text .rodata .data .bss total % diff
frdm_k32l2a4s/board_test 6,820 → 7,468 (+648) 6,820 → 7,476 (+656) +9.6%
frdm_k32l2a4s/dfu_runtime 10,096 → 10,724 (+628) 10,096 → 10,732 (+636) +6.3%
frdm_k32l2a4s/hid_generic_inout 10,908 → 11,536 (+628) 10,908 → 11,544 (+636) +5.8%
frdm_k32l2a4s/hid_multiple_interface 11,712 → 12,340 (+628) 11,712 → 12,348 (+636) +5.4%
frdm_k32l2a4s/hid_boot_interface 11,724 → 12,352 (+628) 11,724 → 12,360 (+636) +5.4%
frdm_k32l2a4s/hid_composite 11,900 → 12,528 (+628) 11,900 → 12,536 (+636) +5.3%
frdm_k32l2a4s/midi_test 12,004 → 12,632 (+628) 12,004 → 12,640 (+636) +5.3%
frdm_k32l2a4s/msc_dual_lun 12,496 → 13,124 (+628) 12,496 → 13,132 (+636) +5.1%
frdm_k32l2a4s/cdc_dual_ports 12,924 → 13,552 (+628) 12,924 → 13,560 (+636) +4.9%
frdm_k32l2a4s/printer_to_cdc 12,960 → 13,588 (+628) 12,960 → 13,596 (+636) +4.9%

add cmake support for rx
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 13, 2026

Size Difference Report

Because 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 size

file .text .rodata .data .bss size % diff
cdc_device.c 1245 ➙ 1252 (+7) 16 1106 630 ➙ 682 (+52) 1874 ➙ 1932 (+58) +3.1%
dcd_ch32_usbhs.c 1649 ➙ 1469 (-180) 0 0 448 2097 ➙ 1917 (-180) -8.6%
dcd_ft9xx.c 0 ➙ 3276 (+3276) 0 0 0 ➙ 172 (+172) 0 ➙ 3448 (+3448) n/a
dfu_device.c 768 ➙ 777 (+9) 28 712 128 ➙ 140 (+12) 896 ➙ 916 (+20) +2.2%
midi_device.c 1145 ➙ 1150 (+5) 0 1007 578 ➙ 621 (+43) 1721 ➙ 1770 (+49) +2.8%
printer_device.c 826 ➙ 830 (+4) 0 706 519 ➙ 564 (+45) 1343 ➙ 1392 (+49) +3.6%
usbtmc_device.c 2176 ➙ 2196 (+20) 24 69 ➙ 68 (-1) 294 ➙ 316 (+22) 2502 ➙ 2544 (+42) +1.7%
vendor_device.c 637 ➙ 641 (+4) 0 534 518 ➙ 563 (+45) 1154 ➙ 1202 (+48) +4.2%
video_device.c 4394 ➙ 4443 (+49) 5 1852 ➙ 1235 (-617) 478 ➙ 479 (+1) 4865 ➙ 4914 (+49) +1.0%
TOTAL 12840 ➙ 16034 (+3194) 73 5986 ➙ 5368 (-618) 3593 ➙ 3985 (+392) 16452 ➙ 20035 (+3583) +21.8%

Changes <1% in size

file .text .rodata .data .bss size % diff
audio_device.c 2882 ➙ 2896 (+14) 0 1260 1616 ➙ 1623 (+7) 4493 ➙ 4514 (+21) +0.5%
dfu_rt_device.c 156 ➙ 157 (+1) 0 134 0 156 ➙ 157 (+1) +0.6%
hid_device.c 1118 ➙ 1125 (+7) 44 997 119 1236 ➙ 1244 (+8) +0.6%
msc_device.c 2517 ➙ 2525 (+8) 108 2286 546 ➙ 547 (+1) 3063 ➙ 3071 (+8) +0.3%
mtp_device.c 1689 ➙ 1696 (+7) 22 1449 ➙ 735 (-714) 587 ➙ 588 (+1) 2283 ➙ 2292 (+9) +0.4%
ncm_device.c 1512 ➙ 1538 (+26) 28 1408 ➙ 718 (-690) 5830 ➙ 5843 (+13) 7356 ➙ 7395 (+39) +0.5%
tusb.c 449 ➙ 451 (+2) 0 383 3 451 ➙ 453 (+2) +0.4%
tusb_fifo.c 848 ➙ 842 (-6) 0 480 0 843 ➙ 837 (-6) -0.7%
usbd.c 3214 ➙ 3225 (+11) 57 89 ➙ 88 (-1) 275 3554 ➙ 3565 (+11) +0.3%
usbd_control.c 535 ➙ 538 (+3) 0 484 79 613 ➙ 616 (+3) +0.5%
TOTAL 14920 ➙ 14993 (+73) 259 8970 ➙ 7565 (-1405) 9055 ➙ 9077 (+22) 24048 ➙ 24144 (+96) +0.4%
No changes
file .text .rodata .data .bss size % diff
cdc_host.c 6617 487 15 1498 8327 +0.0%
dcd_ch32_usbfs.c 1473 0 0 2444 3917 +0.0%
dcd_ci_fs.c 1925 0 0 1290 3215 +0.0%
dcd_ci_hs.c 1759 0 0 1344 2538 +0.0%
dcd_da146xx.c 3067 0 0 144 3211 +0.0%
dcd_dwc2.c 4176 25 0 265 4465 +0.0%
dcd_eptri.c 2271 0 0 259 2530 +0.0%
dcd_khci.c 1953 0 0 1290 3243 +0.0%
dcd_lpc17_40.c 1474 0 0 648 1798 +0.0%
dcd_lpc_ip3511.c 1463 0 0 264 1683 +0.0%
dcd_mm32f327x_otg.c 1478 0 0 1290 2768 +0.0%
dcd_msp430x5xx.c 1798 0 0 176 1974 +0.0%
dcd_musb.c 2445 0 0 160 2605 +0.0%
dcd_nrf5x.c 2918 0 0 292 3210 +0.0%
dcd_nuc120.c 1094 0 0 78 1172 +0.0%
dcd_nuc121.c 1168 0 0 101 1269 +0.0%
dcd_nuc505.c 0 0 1531 157 1688 +0.0%
dcd_rp2040.c 858 20 604 655 2137 +0.0%
dcd_rusb2.c 2919 0 0 156 3075 +0.0%
dcd_samd.c 1034 0 0 266 1300 +0.0%
dcd_samg.c 1320 0 0 72 1392 +0.0%
dcd_stm32_fsdev.c 2557 0 0 291 2848 +0.0%
dwc2_common.c 602 30 0 0 618 +0.0%
ecm_rndis_device.c 1037 0 1 2858 3896 +0.0%
ehci.c 2763 0 0 6043 7597 +0.0%
fsdev_common.c 180 0 0 0 180 +0.0%
hcd_ch32_usbfs.c 2484 0 0 498 2982 +0.0%
hcd_ci_hs.c 184 0 0 0 184 +0.0%
hcd_dwc2.c 4994 33 1 513 5540 +0.0%
hcd_khci.c 2442 0 0 449 2891 +0.0%
hcd_musb.c 3073 0 0 157 3230 +0.0%
hcd_pio_usb.c 262 0 240 0 502 +0.0%
hcd_rp2040.c 976 73 416 384 1849 +0.0%
hcd_rusb2.c 2923 0 0 245 3168 +0.0%
hcd_samd.c 2220 0 0 324 2544 +0.0%
hcd_stm32_fsdev.c 3287 0 1 420 3708 +0.0%
hid_host.c 1206 0 0 1251 2457 +0.0%
hub.c 1384 8 8 30 1418 +0.0%
midi_host.c 1358 7 7 3635 4996 +0.0%
msc_host.c 1587 0 0 394 1982 +0.0%
ohci.c 1940 0 0 2414 4353 +0.0%
rp2040_usb.c 172 75 717 4 968 +0.0%
rusb2_common.c 160 0 16 0 176 +0.0%
typec_stm32.c 820 8 2 12 842 +0.0%
usbc.c 420 2 20 166 608 +0.0%
usbh.c 4649 55 99 961 5731 +0.0%
TOTAL 86890 823 3678 33898 122785 +0.0%

@hathach hathach merged commit 8b59e62 into master Mar 14, 2026
310 checks passed
@hathach hathach deleted the update-bsp branch March 14, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants