# at32_zephyr_lugl **Repository Path**: lugl/at32_zephyr_lugl ## Basic Information - **Project Name**: at32_zephyr_lugl - **Description**: Zephyr RTOS port for Artery AT32 series MCUs - **Primary Language**: C - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2026-03-01 - **Last Updated**: 2026-03-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AT32F423 Zephyr RTOS Port Zephyr RTOS support for Artery AT32F423 ARM Cortex-M4 microcontroller. ## Porting Progress ### Completed | Feature | Status | Notes | |---------|--------|-------| | GPIO Driver | ✅ Done | Basic GPIO read/write, interrupt support | | Clock Management (CRM) | ✅ Done | HICK clock configuration | | UART/Serial | ✅ Done | Using AT32 HAL module | | printk/Logging | ✅ Done | UART console output | | Shell Support | ✅ Done | Interactive shell commands | | LED Driver | ✅ Done | gpio-leds compatible | | Button/Input | ✅ Done | GPIO keys with interrupt | | Device Tree | ✅ Done | Board DTS with LEDs and button | ### In Progress - PWM driver - SPI driver - I2C driver - Timer (GPT) ## Hardware - MCU: AT32F423 (Cortex-M4, 120MHz) - Board: AT-START-F423 - Debugger: AT-Link-EZ (CMSIS-DAP) ## Quick Start ### Prerequisites - Zephyr RTOS installed - ARM toolchain (arm-none-eabi-gcc) - OpenOCD or J-Link software ### Installation 1. Clone this repository into your Zephyr project's modules directory: ```bash cd your_zephyr_project git clone https://gitee.com/lugl/at32_zephyr_lugl.git modules/at32 ``` Or add as submodule: ```bash git submodule add https://gitee.com/lugl/at32_zephyr_lugl.git modules/at32 ``` 2. Update west: ```bash west update ``` 3. Build the example: ```bash west build -b at32f423_start ``` 4. Flash to board: ```bash west flash ``` ## Shell Commands After flashing, use UART terminal (115200 8N1): ```bash # LED control (built-in Zephyr LED shell) led on 2 # Turn on LED2 led off 2 # Turn off LED2 led toggle 3 # Toggle LED3 led status # Show all LED status # Button read (custom command) button # Read button state (PA0) ``` ## Project Structure ``` at32_zephyr_lugl/ ├── boards/ │ └── at32/ │ └── at32f423_start/ # Board definition │ ├── Kconfig.board │ ├── Kconfig.defconfig │ ├── at32f423_start.dts │ └── at32f423_start.yaml ├── modules/ │ └── hal/ │ └── at32/ # HAL drivers │ ├── at32f423/ │ │ ├── core_support/ │ │ ├── device_support/ │ │ └── drivers/ │ ├── CMakeLists.txt │ └── Kconfig ├── docs/ # Documentation │ ├── printk_porting.md │ ├── shell_porting.md │ └── gpio_interrupt_porting.md └── test_at32/ # Example application ├── CMakeLists.txt ├── main.c └── prj.conf ``` ## Documentation - [UART/Serial Porting](docs/AT32F423_Zephyr_USART.md) - [printk Porting](docs/printk_porting.md) - [Shell Porting](docs/shell_porting.md) - [GPIO Interrupt Porting](docs/gpio_interrupt_porting.md) ## Configuration Key config options (see `prj.conf`): - `CONFIG_SOC_AT32F423` - Enable AT32F423 SoC - `CONFIG_GPIO_AT32` - Enable GPIO driver - `CONFIG_CLOCK_CONTROL_AT32` - Enable clock driver - `CONFIG_UART_AT32` - Enable UART driver - `CONFIG_LED_GPIO` - Enable LED driver - `CONFIG_INPUT_GPIO_KEYS` - Enable button input ## Debugging ### OpenOCD ```bash openocd -f interface/atlink.cfg -f target/at32f423xx.cfg ``` Then connect with GDB: ```bash arm-none-eabi-gdb -ex "target remote localhost:3333" build/zephyr/zephyr.elf ``` ### VSCode Use the included `.vscode/launch.json` for Cortex-Debug. ## License Apache 2.0 ## Notes - This is a community-driven port, not officially supported by Zephyr or Artery - Based on AT32F423_Firmware_Library from Artery Technology