cjj66619 opened a new pull request, #18885:
URL: https://github.com/apache/nuttx/pull/18885
This patch adds a new BSP for the ALIENTEK M144Z-M4 development board, an
inexpensive STM32F407ZGT6 minimum-system board widely used by Chinese
electronics students and hobbyists.
Chip: STM32F407ZGT6 (Cortex-M4F, 168 MHz, 1 MiB flash, 192 KiB SRAM)
Crystal: 8 MHz HSE (yields 168 MHz SYSCLK / 84 MHz APB1 / 168 MHz APB2)
LEDs: 2 user LEDs (PF9 / PF10), active-low
Buttons: 4 user buttons (PA0/PE2/PE3/PE4)
SPI1: W25Q128 16 MiB NOR flash (CS=PB14)
USB: OTG FS on PA11/PA12 (device-mode console gadget supported)
The on-board W25Q128 NOR flash is auto-mounted as a littlefs filesystem at
/data when CONFIG_FS_LITTLEFS=y (probe + mount sequence factored out into
stm32_w25_bringup()).
The defconfig provided here (configs/nsh/) brings up a serial NSH console on
USART1 (PA9/PA10) at 115200 8N1. Additional configs (USB CDC/ACM, SD card,
ADC/DAC, CAN) can be derived from this baseline.
Documentation/platforms/arm/stm32f4/boards/alientek-m144z-m4/index.rst is
added for Sphinx integration; a README.txt covers wiring/pinmux for people who
prefer offline docs.
This board is the target hardware for an entry in the 2026 Xiaomi Cup
Embedded AI competition; making the BSP part of the upstream tree helps the
broader student community working with this very common F407 board.
## Summary
This PR adds a new BSP for the **ALIENTEK M144Z-M4** development board — an
inexpensive STM32F407ZGT6 minimum-system board widely used by Chinese
electronics students and hobbyists. The BSP is the target hardware for an
entry in the 2026 Xiaomi Cup Embedded AI competition; making it part of
the upstream tree helps the broader student community working with this
very common F407 board.
| Item | Value |
|------------|-------|
| Chip | STM32F407ZGT6 (Cortex-M4F, 168 MHz, 1 MiB flash, 192 KiB
SRAM) |
| Crystal | 8 MHz HSE → 168 MHz SYSCLK / 84 MHz APB1 / 168 MHz APB2 |
| LEDs | 2 user LEDs (PF9 / PF10), active-low |
| Buttons | 4 user buttons (PA0 / PE2 / PE3 / PE4) |
| Serial | NSH console on USART1 (PA9 / PA10) @ 115200 8N1 |
| SPI1 | W25Q128 16 MiB NOR flash (CS = PB14) |
| USB | OTG FS on PA11 / PA12 (device-mode CDC/ACM supported) |
The on-board W25Q128 NOR flash is auto-mounted as a **littlefs** filesystem
at `/data` when `CONFIG_FS_LITTLEFS=y` (probe + mount sequence factored
into `stm32_w25_bringup()` inside `src/stm32_bringup.c`).
## Files added
- `Documentation/platforms/arm/stm32f4/boards/alientek-m144z-m4/index.rst`
- `boards/arm/stm32/alientek-m144z-m4/` — full BSP (15 .c/.h sources +
CMakeLists / Kconfig / Make.defs / linker scripts + `configs/nsh/`
defconfig + `README.txt`)
- `boards/Kconfig` — registers `ARCH_BOARD_ALIENTEK_M144Z_M4` config /
path mapping / Kconfig source line.
## Pre-flight checks (local)
- ✅ `pre-commit run --files <changed>`: all five hooks pass on every
changed file:
- `end-of-file-fixer`, `trailing-whitespace`, `check-added-large-files`,
`cmake-format`, `nxstyle` (which runs `tools/checkpatch.sh -c -f`
internally, including `codespell` + `nxstyle` binary).
- ✅ Three codespell typos inherited from the original olimex-stm32-e407
copy were fixed (`Presumeably`, `inialization`, `intrface`).
- ✅ No `olimex` / `boot_timing` / `boot_mark` residue:
`grep -rn 'olimex\|boot_timing\|boot_mark'
boards/arm/stm32/alientek-m144z-m4/`
returns empty.
## Testing
This BSP has been validated on physical ALIENTEK M144Z-M4 hardware as
part of the Xiaomi Cup 2026 work:
- **ostest**: 18 / 18 cases pass on the physical board (`uname`, `pwd`,
`mount`, `df`, `free`, all `nsh` builtins + scheduler tests).
- **Cross-build (openvela GCC 9.2.1 aarch64 prebuilt on Jetson Orin)**:
produces a working `nuttx.bin` with ROM **~19.4 %** (203 044 / 1 048 576 B)
and RAM **~3.9 %** (7 472 / 196 608 B).
- **Serial console**: USART1 NSH @ 115200 8N1 boots in < 0.5 s from POR.
- **W25Q128**: JEDEC ID `EF 40 18` (Winbond 16 MiB), littlefs mounted at
`/data`, round-trip read/write verified.
Apache NuttX CI is expected to provide the canonical cross-build
verification across all targets; if any config fails I will iterate.
## Notes for reviewers
- The W25Q128 probe + mount sequence was factored into a static helper
`stm32_w25_bringup()` for `nxstyle` cleanliness (variable declarations
at function scope, no anonymous nested blocks).
- The BSP intentionally enables only the core peripherals exercised by
`nsh` (UART1, GPIO LEDs/buttons, SPI1 + W25Q128, USB OTG-FS). ADC, DAC,
CAN, IEEE 802.15.4 MRF24J40, USB host etc. are present in the source
tree but gated behind their respective `CONFIG_*` switches so other
users can derive richer defconfigs from this baseline.
- Apache ICLA was filed (will be auto-prompted by the GitHub bot if not
yet matched). Author / committer / DCO `Signed-off-by` all use
`cjj66619 <[email protected]>`.
Signed-off-by: cjj66619 <[email protected]>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]