AT32F421G8U7
Reference-derived Cortex-M4 target with 64 KiB flash, 16 KiB SRAM and the QFN28 (exposed pad 29) pin identity. It runs the committed Artery SDK smoke firmware. This is a functional simulation target: no physical AT32 capture exists, and nothing here qualifies an ESC, motor or aircraft.
The bare-chip ID is at32f421g8u7. It is not an alias for an STM32 part; where an AT32 block is register-compatible with an STM32 block it uses the shared model with an explicit at32f421 profile, and every such reuse was checked against the Artery headers.
Status at a glance
| Property | Contract |
|---|---|
| CPU | Cortex-M4, software floating point, declared 120 MHz timebase |
| Flash | 0x08000000, 65,536 bytes, 1,024-byte erase sectors |
| SRAM | 0x20000000, 16,384 bytes |
| Package | QFN28 with exposed VSS pad 29; 23 bonded GPIO labels |
| Supply | 3.3 V nominal; POR 2.06 V / LVR 1.88 V typical (DS Table 13); NRST limits from DS Table 35 |
| Qualification | Source-derived smoke and register tests; no silicon differential evidence |
The CPU timebase is the descriptor's declared frequency. Clock-source ready bits have functional semantics; oscillator start-up, PLL lock time and dynamic CPU clock scaling are not calibrated.
Bonded GPIO pins
| Package pad | GPIO | Package pad | GPIO |
|---|---|---|---|
| 2 | PF0 | 3 | PF1 |
| 6 | PA0 | 7 | PA1 |
| 8 | PA2 | 9 | PA3 |
| 10 | PA4 | 11 | PA5 |
| 12 | PA6 | 13 | PA7 |
| 14 | PB0 | 15 | PB1 |
| 18 | PA8 | 19 | PA9 |
| 20 | PA10 | 21 | PA13 |
| 22 | PA14 | 23 | PA15 |
| 24 | PB3 | 25 | PB4 |
| 26 | PB5 | 27 | PB6 |
| 28 | PB7 |
Pads 1/4 are BOOT0/NRST, 5/17 VDDA/VDD, 16/29 VSS. The GPIOC bank exists on the die but no PC pin is bonded; PA11, PA12 and PB2 are absent. ADC inputs are PA0-PA7 (channels 0-7) and PB0/PB1 (8/9). Comparator external inputs are PA0, PA1, PA2, PA4 and PA5.
Implemented support
| Block | Model | Boundary |
|---|---|---|
| CRM | rcc profile at32f421: HICK/HEXT/PLL readiness, source switch, clock gates, reset-cause flags |
HEXT needs an explicitly fitted source. Peripheral resets are accepted only for GPIO, CMP and ADC; timer, USART, EXINT and APB1 resets return an error |
| GPIO | Shared STM32 V2 port with reset_registers: true |
No HDRV or electrical timing |
| USART1/2 | Shared classic (F1) USART subset, AF1 TX routes | No AT32-specific USART qualification |
| Flash | flash profile at32f421: key unlock, word/halfword program, sector and mass erase, lock |
No operation latency, protection or user-system-data programming (refused with PRGMERR) |
| DMA1 | dma profile at32f421: five channels, IRQ groups 9/10/11, Artery memory-to-memory direction |
Fixed request map of RM §9.3.7 Table 9-3 (default remap) for ADC, USART1/2 TX/RX and TMR1/3/6/15/16/17; dynamic SCFG DMA remaps are not implemented |
| Timers | Shared timer with input_capture/pad_map: at32f421; TMR1 channel flags on their own vector (IRQ14) |
Shared advanced-timer complementary outputs/dead-time and source-gated update/channel/trigger/commutation DMA requests; no AT32 silicon differential capture |
| ADC1 | Ordinary software-triggered 12-bit scan, DMA handshake | Explicit channel voltages only; unbound inputs and unsupported modes error |
| CMP + EXINT | Comparator mux/polarity/lock; EXINT line 21 rising/falling masks to IRQ12 | No hysteresis, blanking, filter or direct timer route (writes error) |
| WDT | Shared IWDG with reset_on_expiry at a nominal 40 kHz LICK |
RC tolerance not modelled |
Firmware artifact
The fixture is at32f421g8u7-smoke.elf, built by examples/at32f421g8u7/firmware/build.sh against ArteryTek/AT32F421_Firmware_Library at 2fd0bfbc812d7e4984203039cba838345d3058f1 (BSP 2.1.9). It switches to the PLL, erases and programs the last 1 KiB flash sector, performs a four-word DMA copy and counts eight TMR6 interrupts that toggle PA5, reporting each step on USART2.
Run
cargo test -p labwired-core --test vendor -- at32f421_contract::
cargo test -p labwired-core --features event-scheduler --test vendor -- at32f421_contract::
cargo run -p labwired-cli -- test --script examples/at32f421g8u7/io-smoke.yaml
Native DShot protocol check
The ignored at32_am32_protocol test loads the complete AM32 flash ELF through
the ordinary loader. It executes the real PB4 bootloader, application and bench
settings. It drives PB4 with conventional DShot600 edges; it does not write
firmware RAM or force arming. The test checks protocol acquisition, repeated
accepted zero commands, rejected bad checksum and accepted command 100 while
still unarmed. It does not establish bidirectional telemetry, six-gate motor
commutation or a complete flight-controller/ESC system.
The application ELF is pinned to
2dc65fec5924f31548cc3041690b9b5a1645466832a09e46d012c33b14f8452d
and the complete flash ELF to
c6ae7b29e1fe35dd56070435aa271b18ec9cba77ec5329f092b3296776664e2a.
The corresponding source, reproducible build and images are in the LabWired
examples quadrotor package's firmware/native-esc directory.
AT32_NATIVE_ARTIFACTS=/absolute/package/firmware/native-esc/artifacts \
AT32_NATIVE_PROTOCOL_REPORT=/absolute/output/native-protocol.json \
cargo test --locked -p labwired-core --features event-scheduler \
--test vendor at32_am32_protocol:: -- --ignored --nocapture
Timer DMA requests use the existing bus DMA routing and scheduler. Each request
is a pulse independent of a sticky interrupt flag. IDEN gates the source;
CTRL2.DRS selects capture/compare versus overflow for channel requests;
CTRL1.OVFEN/OVFS control update generation. The native request-map and shared
timer tests include repeated requests, disabled sources, wrong channels,
filtered capture, DMA-only deadlines and software update restrictions.
Sources
- AT32F421 datasheet Ver 2.03: supply/reset thresholds (Tables 13, 35), GPIO thresholds (Table 32), VDDA range (Table 39).
- RM_AT32F421 V2.05 (2025-05-14): CRM (§4.3), DMA request mapping (§9.3.7 Table 9-3), timer CTRL1/CTRL2/IDEN (§14).
- Artery firmware library at 2fd0bfbc: CMSIS
at32f421.hmemory map and IRQ numbers; driver headers for register layouts.
Related files
Output-compare events above the period
The native AM32 F421 telemetry path uses TMR3 PWM with PR=76 and C1DT values 0 or 128. A value above the period still produces the channel compare flag/DMA event at natural overflow in the shared STM32-compatible timer model. Software update and input-capture mode do not synthesize that event. The primary STM32 rule is RM0386, general-purpose TIMx_SR, CC1IF: https://www.st.com/resource/en/reference_manual/rm0386-stm32f469xx-and-stm32f479xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf .
AT32F421 RM v2.05 defines the corresponding TMR3 capture/compare DMA selection but does not explicitly state the above-period corner case in its English C1IF description. The AT32 compatibility behavior is therefore cross-checked against the unchanged native AM32 source and executable telemetry path; it is not a physical AT32 timing measurement. The existing counter model remains upcounting only. Down/center-aligned event timing is not newly qualified by this change.