Expand description
Raw ATON register map. Exposed as an intentional low-level route for advanced users that need to compose their own streaming-engine helpers on top of the epoch-controller-oriented driver (e.g. a hardware-DMA transpose). Names mirror the ATON reference-manual naming; no stability guarantees are made about this module. Minimal register map for the ST Neural-ART accelerator (“ATON”) on STM32N6.
§Why this is not stm32_metapac::npu
Embassy’s usual convention is to reach peripherals through crate::pac::*
(i.e. stm32-metapac, which is generated from stm32-data chiptool YAML,
which in turn is derived from ST’s SVDs plus hand-authored overrides).
The STM32N657 SVD ST publishes today (checked against STM32N657.svd)
does describe the NPU at the system integration level — the five NVIC
lines (NPU_end_of_epoch, NPU1..3, NPUCACHE) and the RCC bits
(NPUEN, NPURST, NPUCACHEEN, NPULPEN, …) are all there and
reachable via stm32-metapac as usual. What is not described is the
ATON register block itself at 0x480E_0000: no <peripheral> entry for
the epoch controller, streaming engines, stream switch, bus interfaces,
interrupt controller or cache maintenance unit. That is roughly 140 KB of
register space that the reference manual documents but the SVD does not.
Names, offsets and bit positions are taken from the generated
ATON.h of the STM32N6 (Neural-ART machine description, ATON IP v1.x) as
shipped with ST Edge AI / X-CUBE-AI.
Clock/reset gating and NVIC unmasking still go through metapac (RCC and
crate::interrupt::typelevel::NPU*) — only the ATON-internal register
map is hand-rolled.
Only the units the epoch-controller execution model touches are described:
CLKCTRL— ATON-internal clock controller (unit clock gates)INTCTRL— ATON interrupt controller (4 output lines -> NVIC NPU0..3)BUSIF— 2 bus interface units (must be enabled for any traffic)STRENG— 10 streaming engines (only the IRQ register, for acks)EPOCHCTRL— the epoch controller, which executes command blobs
Register-name docs are omitted: identifiers mirror the ATON reference-manual
naming (<UNIT>_<REG>_<FIELD>_<LSB|EN|MASK>), so a per-item doc string
would just repeat the name. See the top-of-file summary for the semantics.
Constants§
- ATON_
BASE - ATON register block base address (non-secure alias, matches the address
space used by
stm32-metapacfor the N6 family).NPU_BASE_NS = PERIPH_BASE_NS (0x4000_0000) + 0x0802_0000 + 0x000C_0000. - BUSIF_
BASE - BUSIF_
CTRL_ EN - BUSIF_
NUM - Number of bus interface units.
- CLKCTRL_
AGATE S0 - Group-A clock gates (always-on infrastructure clocks), bits [31:0].
- CLKCTRL_
AGATE S1 - Group-A clock gates, upper word.
- CLKCTRL_
BASE - CLKCTRL_
BGATES - Group-B clock gates (one per accelerator unit; 27 used on N6).
- CLKCTRL_
CTRL - Clock controller CTRL register. Bit 0 = EN, bit 1 = CLR.
- CLKCTRL_
CTRL_ CLR - CLKCTRL_
CTRL_ EN - EPOCHCTRL_
ADDR - Blob start address (must be 8-byte aligned, points at the blob magic).
- EPOCHCTRL_
BASE - EPOCHCTRL_
BC - Opcode counter (debug).
- EPOCHCTRL_
CTRL - Epoch controller CTRL. Bit 0 = EN, bit 1 = CLR, bit 3 = SM (step mode), bit 30 = CONFCLR, bit 31 = RUNNING (read-only).
- EPOCHCTRL_
CTRL_ CLR - EPOCHCTRL_
CTRL_ CONFCLR - EPOCHCTRL_
CTRL_ EN - EPOCHCTRL_
CTRL_ RUNNING - EPOCHCTRL_
CTRL_ SM - EPOCHCTRL_
IRQ - Epoch controller IRQ status (write back the read value to ack).
- EPOCHCTRL_
LABEL - Label register (debug: label of the current/last executed blob section).
- INTCTRL_
BASE - INTCTRL_
CTRL - Interrupt controller CTRL. Bit 0 = EN, bit 1 = CLR, bit 30 = CONFCLR.
- INTCTRL_
CTRL_ CLR - INTCTRL_
CTRL_ CONFCLR - INTCTRL_
CTRL_ EN - INTCTRL_
INTCLR - Interrupt clear (write 1 to clear latched bits).
- INTCTRL_
INTREG - Latched interrupt status (one bit per ATON interrupt source).
- INTCTRL_
INTSET - Software interrupt set.
- INT_
BUSIF_ ERR_ MASK - Bus interface error interrupts (BUSIF0 = bit 25, BUSIF1 = bit 26).
- INT_
BUSIF_ ERR_ SHIFT - INT_
ECTRL_ ERR - Epoch controller error (illegal opcode, bus error, …).
- INT_
ECTRL_ EVT - Epoch controller “epoch interrupt” (EPOCH_INT instruction / end of blob).
- INT_
ECTRL_ NOACK - Epoch controller missing-acknowledge error.
- INT_
STRENG_ ERR_ MASK - Streaming engine error events, bits 10..=19.
- INT_
STRENG_ ERR_ SHIFT - INT_
STRENG_ EVT_ MASK - Streaming engine completion events, bits 0..=9.
- STRENG_
ADDR_ OFF - STRENG_
BASE - STRENG_
CID_ CACHE_ OFF - STRENG_
CTRL_ CLR - STRENG_
CTRL_ CONFCLR - STRENG_
CTRL_ CONT - STRENG_
CTRL_ DIR - STRENG_
CTRL_ EN - STRENG_
CTRL_ LSBMODE - STRENG_
CTRL_ NOBLK - STRENG_
CTRL_ NOINC - STRENG_
CTRL_ OFF - STRENG_
CTRL_ RAW - STRENG_
CTRL_ RUNNING - STRENG_
CTRL_ SIGNEXT - STRENG_
CTRL_ SINGLE - STRENG_
CTRL_ SIZE0_ LSB - STRENG_
CTRL_ SIZE1_ LSB - STRENG_
CTRL_ SIZE2_ LSB - STRENG_
DEPTH_ OFF - STRENG_
DEPTH_ OFFSET_ LSB - STRENG_
DESCRADDR_ OFF - STRENG_
EVENT_ EN_ ILLCFG - STRENG_
EVENT_ EN_ OFLOW_ ADD - STRENG_
EVENT_ EN_ OFLOW_ FRM - STRENG_
EVENT_ OFF - STRENG_
EXTSYN C2_ OFF - STRENG_
EXTSYNC_ OFF - STRENG_
FOFFSET_ OFF - STRENG_
FRAME_ RPT_ OFF - STRENG_
FRPTOFF_ OFF - STRENG_
FSIZE_ HEIGHT_ LSB - STRENG_
FSIZE_ OFF - STRENG_
IRQ_ OFF - STRENG_
LIMITADDR_ OFF - STRENG_
LIMITEN_ ADDRLIMIT - STRENG_
LIMITEN_ DOFF_ MSB_ LSB - STRENG_
LIMITEN_ FRAMELIMIT - STRENG_
LIMITEN_ OFF - STRENG_
LIMITEN_ STOPPREFTC - STRENG_
LIMIT_ OFF - STRENG_
NUM - Number of streaming engines.
- STRENG_
POS_ OFF - STRENG_
STOPTAG_ OFF - STRENG_
STRD_ OFF - STRSWITCH_
BASE - STRSWITCH_
CTRL - Stream switch CTRL. Bit 0 = EN, bit 1 = CLR, bit 30 = CONFCLR.
- STRSWITCH_
CTRL_ CLR - STRSWITCH_
CTRL_ CONFCLR - STRSWITCH_
CTRL_ EN - STRSW_
DST_ EN0 - STRSW_
DST_ LINK0_ LSB
Functions§
- busif_
ctrl - busif_
err - intctrl_
intandmsk - AND-mask for interrupt line
line(0..=3). The line fires when all sources left enabled (bit =0) are pending simultaneously; the reset value of all-ones disables the AND group entirely. - intctrl_
intormsk - OR-mask for interrupt line
line(0..=3). A1bit disables the corresponding source on that line; sources left at0raise the line whenever pending (“OR” semantics). - modify
- read
- streng_
irq - Streaming engine IRQ status register (write back the read value to ack).
- streng_
reg - strsw_
dst_ idx_ streng - Destination-index in the stream switch DST-register array for STRENG
n(matchesATON_STRSWITCH_0_DSTSTRENG_n_0_IDX == n). - strsw_
src_ streng - Source-port ID for STRENG
n(matchesATON_STRSWITCH_0_LINK_STRENG_n_0 == n). - strswitch_
dst - Stream-switch destination-port register for destination index
idx(0..=40). Layout is two independent 16-bit sub-contexts: ctx 0: EN0=bit0, LINK0=bits[6:1] (source port id), FNR0=bits[15:8] ctx 1: EN1=bit16, LINK1=bits[22:17], FNR1=bits[31:24] - write