machine/stm32: add STM32U585 target definition and runtime

Add processor target (cortex-m33), linker script (2048K flash, 768K RAM),
and arduino-uno-q board target. Runtime initializes 160MHz clock via PLL1
from HSI16, with PWR Range 1 and EPOD booster.

Also add psctype abstraction for timer PSC register width, needed because
the U5 SVD defines PSC as a 16-bit register.
This commit is contained in:
deadprogram
2026-03-15 15:43:56 +01:00
parent 1f00425eb3
commit 47115f0380
15 changed files with 159 additions and 1 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ func (t *TIM) setPeriod(period uint64, updatePrescaler bool) error {
psc = ceil(top, ARR_MAX)
top = top / psc
t.Device.PSC.Set(uint32(psc - 1))
t.Device.PSC.Set(psctype(psc - 1))
} else {
psc = uint64(t.Device.PSC.Get()) + 1
top = top / psc
+1
View File
@@ -731,6 +731,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -607,6 +607,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -712,6 +712,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -554,6 +554,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -189,6 +189,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -246,6 +246,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -532,6 +532,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -542,6 +542,7 @@ func (t *TIM) enableMainOutput() {
}
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (
+1
View File
@@ -433,6 +433,7 @@ func initRNG() {
//----------
type arrtype = uint32
type psctype = uint32
type arrRegType = volatile.Register32
const (