Repository navigation
Add NUC126 support (continues #341) - #454
Merged
Merged
Conversation
hal.h on chibios-21.11.x calls hal_lld_get_clock_point(); without it the NUC126 port no longer builds. Use the same static stub as the NUC123 port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Newer binutils refuse to link the Thumb call to the untyped usb_memcpy symbol. Same fix as USBv1 got in ChibiOS#423 (2fb815d), placed the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
USBD_ATTR bit 9 (PWRDN, transceiver power, active low) is not named in the NUC126 header, so usb_lld_start() left the PHY powered down: ATTR read back 0x190 and the host never saw the device. The vendor BSP writes ATTR = 0x7D0, and the NUC123 port sets the same bit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With NUC126_PLL_ENABLED FALSE and NUC126_HSI48_ENABLED TRUE, run HCLK straight from HIRC48 (48 MHz) and clock USB from HIRC48 (CLKSEL3.USBDSEL = 0) instead of failing with "HSI48 not yet supported for use with USB". Crystal-less boards need this. The PLL/crystal path is unchanged. Spec-accurate crystal-less USB also needs HIRC48 auto-trim against USB SOF (SYS->IRCTCTL1); board code does that for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hal.h on chibios-21.11.x now requires _CHIBIOS_HAL_CONF_VER_9_1_, so the 2022 demo configs (8.0) stopped building with "obsolete or unknown configuration file". Regenerate both from ChibiOS's halconf.h template, keeping the original driver selection (PAL; PAL + USB for USB_HID), the serial buffer size and the halconf_community.h include. chconf.h (RT 7.0) is still current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As requested in ChibiOS#341. NUC126 only: the NUC123 testhal projects predate the current makefiles and configs (ccportab.h / HAL config errors) and are left for a separate change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
fpoussin
approved these changes
Oct 4, 2026
Member
|
Thank you very much! |
1 of 4 tasks
|
Freaking THANK YOU! |
4 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This picks up #341 by @FlamingCupcake, which stalled in 2022, and takes it to a mergeable state. Their commit is included unchanged and keeps their authorship; the fixes are separate commits on top, rebased onto the current
chibios-21.11.x.Tested on hardware: a NUC1261SG4AE (peripheral-identical to the NUC126 parts) in a Ducky One 3 keyboard running QMK on this HAL (keyboard port): USB HID (keyboard incl. NKRO, consumer/system keys, console), PAL, ST (system tick) and crystal-less HIRC48 clocking. The NUTINY-SDK-NUC126 demos are build-tested only; I don't have that board.
Commits on top of #341
hal_lld_get_clock_point()stub:hal.honchibios-21.11.xneeds it (same stub as the NUC123 port).usb_memcpy:.type usb_memcpy, %function, without which newer binutils refuse to link. Same fix USBv1 got in Fix compilation issue with newer binutils #423.USBD_ATTRbit 9 (PWRDN, active low) was never set, so the device never appeared on the bus. The vendor BSP writes0x7D0, and the NUC123 port sets the same bit.NUC126_HSI48_ENABLED), replacing the#error. The PLL/crystal path is unchanged. Crystal-less USB still needs HIRC48 auto-trim against SOF (SYS->IRCTCTL1); board code does that for now.halconf.hupdated to HAL config 9.1 (the 8.0 configs no longer build). Driver selection unchanged.testhal/NUMICRO/NUC126, as requested in Add NUC126 support #341.Build check:
tools/chbuild.sh testhal/NUMICRO/NUC126against ChibiOSstable_21.11.x, set up the way the workflow does it: 3 builds ok, 0 failed (arm-none-eabi-gcc 14.3).Not included: #341's
lgtm.ymlchange (LGTM.com shut down in 2022), and the NUC123 testhal projects, which fail on current ChibiOS (ccportab.hmissing, old HAL config version); those are left for a separate PR. Note that the build workflow has been failing onchibios-21.11.x(last push run, 2026-04-08), so the new step may not be reached until that is fixed.Happy to rework anything, or to close this if @FlamingCupcake would rather update #341.
🤖 Generated with Claude Code