[WIP] Add STM32U585 support for Arduino UNO Q (3-axis CNC)#291
[WIP] Add STM32U585 support for Arduino UNO Q (3-axis CNC)#291hoshigarasu wants to merge 1 commit into
Conversation
Target: Arduino UNO Q (Qualcomm QRB2210 + STM32U585 Cortex-M33)
Shield: Arduino CNC Shield V3 + A4988 stepper drivers
Changes:
- Inc/driver.h: Wrap BITBAND_PERI/DIGITAL_IN/DIGITAL_OUT in
#ifdef STM32U585xx, include bitband_compat.h for Cortex-M33.
Add BOARD_UNO_Q_CNC board map entry.
- Inc/bitband_compat.h: New file. BSRR/BRR-based replacements for
BITBAND_PERI macros (Cortex-M33 has no bit-band region).
- Inc/boards/uno_q_cnc_map.h: New board map for Arduino UNO Q.
3-axis (X/Y/Z) pin assignments confirmed from Zephyr DTS
(boards/arduino/uno_q/arduino_r3_connector.dtsi):
X_STEP=PB3(D2), X_DIR=PA11(D5)
Y_STEP=PB0(D3), Y_DIR=PB1(D6)
Z_STEP=PA12(D4), Z_DIR=PB2(D7)
EN=PB4(D8)
STEP/DIRECTION outmode: GPIO_BITBAND (mixed GPIO ports require
per-axis DIGITAL_OUT; DIGITAL_OUT is BSRR-based via bitband_compat.h)
- Src/main.c: Add STM32U585xx SystemClock_Config block with early
return. MSIS(4MHz)->PLL1(M=1,N=80,R=2)->SYSCLK 160MHz.
Parameters confirmed from arduino_uno_q-common.dtsi.
- Inc/main.h: Update HAL header to stm32u5xx_hal.h for U585 builds.
Status: WIP
- HAL/CMSIS library swap (STM32F4xx->STM32U5xx) not yet done
- flash.c QUADWORD adaptation pending
- Compile and hardware verification pending (hardware not yet available)
- USB CDC disabled (QRB2210 Linux side handles communication)
Architecture:
grblHAL runs on STM32U585 (real-time step generation).
QRB2210 (Debian Linux) handles G-code sending and process monitoring
via bridge UART on D0/D1 (PB7/PB6 = USART1).
Related project: rs274ngc-grbl-bridgeWhile working on this STM32U585 port, a broader architectural opportunity emerged The problem: GRBL's loop limitationGRBL and grblHAL support O-codes when streaming from local storage (SD card). The solution: rs274ngc as a portable interpreter layerLinuxCNC's Proposed architecture: Why this matters for the grblHAL community
Why this matters for the LinuxCNC community
Connection to this PRThe Arduino UNO Q (target of this port) has a Qualcomm QRB2210 running The 7ms bridge latency between the two chips is irrelevant because Current statusHardware (Arduino UNO Q) is on order. Will open a separate repository |
grblHAL supports O-code etc. when streaming from local storage (SD card). BTW a support for a new processor family needs a separate driver. Or is the STM32U585 fully compatible with the F4 family? |
|
Thank you for the correction and the question. On O-code support: Apologies for the inaccurate statement. I was not aware that grblHAL The rs274ngc-grbl-bridge concept I described is still relevant, but for On STM32U585 / F4 compatibility: The STM32U585 (Cortex-M33) is not fully compatible with the F4 family.
I used |
Yes it is. I would prefer that you (or somebody else) take care of maintaining the driver since I do not have the bandwidth (or the boards) to do it myself. The STM32H7xx driver is an example of one not maintained by me - derived from the STM32F7xx driver. |
|
Thank you - this is very clear. I will create a separate repository My Arduino UNO Q hardware arrived today and active development I will close PR #291 once the new repository is in place. |
|
Thank you for your feedback on this PR. Following your suggestion, I have moved the STM32U585 (Arduino UNO Q) port to its own dedicated repository rather than merging it into the STM32F4xx driver:
The port is now fully functional — grblHAL runs on the STM32U585, settings persist to internal flash, and motor movement has been verified via the CNC Shield V3. The companion bridge translates rs274ngc canon calls (canned cycles, subroutines, coordinate transforms) to grblHAL commands over the board's internal UART ( I am closing this PR accordingly. I hope the work documented in the new repositories is useful to others exploring the STM32U5 family with grblHAL. |
|
The repositories mentioned above are not available, are they set as private? |
Overview
First grblHAL driver targeting STM32U585 (Cortex-M33) on the Arduino UNO Q board.
Hardware
Key changes
bitband_compat.h: BSRR/BRR-based replacements forBITBAND_PERI(Cortex-M33 has no bit-band region)
boards/uno_q_cnc_map.h: Pin map confirmed from Zephyr DTSmain.c: STM32U585SystemClock_Config(MSIS→PLL1→160MHz,confirmed from
arduino_uno_q-common.dtsi)driver.h:#ifdef STM32U585xxguard for BITBAND macrosStatus: WIP⚠️
flash.cQUADWORD adaptationHardware is on order. Will update to ready-for-review once compiled and verified.