mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user