targets: correct pin mapping for Arduino UNO Q STM32 MCU

Signed-off-by: deadprogram <ron@hybridgroup.com>

machine/stm32u585: fix PWR peripheral clock was never enabled

On STM32U5, PWR is on AHB3 and requires RCC.AHB3ENR.PWREN -
unlike some other STM32 families where PWR is always clocked.
Without this, all writes to PWR registers (including IO2SV for
VDDIO2) were silently dropped, so GPIOG pins could never drive.

Signed-off-by: deadprogram <ron@hybridgroup.com>

target: correct I2C pin mapping for Arduino UNO Q

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2026-03-17 20:16:03 +01:00
parent 323b62b405
commit 60fb4b95fa
4 changed files with 96 additions and 47 deletions
+6 -4
View File
@@ -3,6 +3,7 @@
package runtime
import (
"device/stm32"
"machine"
)
@@ -24,8 +25,9 @@ func buffered() int {
func initCLK() {
// Use MSI at 4MHz — the reset default clock configuration.
// This matches the known-working bare-metal C configuration for
// the Arduino Uno Q (STM32U585). The MCU boots with MSI at 4MHz,
// VOS Range 4, and 0 flash wait states. No additional configuration
// is needed.
// The MCU boots with MSI at 4MHz, VOS Range 4, and 0 flash wait states.
// Enable PWR peripheral clock (required on STM32U5 before accessing PWR registers).
stm32.RCC.AHB3ENR.SetBits(stm32.RCC_AHB3ENR_PWREN)
_ = stm32.RCC.AHB3ENR.Get() // read-back for clock stabilization
}