-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add Support Artery Technology AT32F405(ARM Cortex M4F) SoC. #91273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Maxjta
wants to merge
12
commits into
zephyrproject-rtos:main
Choose a base branch
from
Maxjta:zephyr-rtos
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
48dd819
soc: artery: Add AT32F405 soc related code and configuration files.
Maxjta c7d0bf3
driver: clock_control: add clock control driver
Maxjta c56465a
driver: gpio: add gpio driver to support AT32F405
Maxjta 866c8dc
driver: interrupt_controller: add interrupt controller driver.
Maxjta 7158916
driver: usart: add usart driver to support AT32F405
Maxjta 696dfe7
driver: pinctrl: add pinctrl driver.
Maxjta f831b57
driver: reset: add reset driver.
Maxjta 333a2e3
dts: bingdings/arm: Add devicetree and dirver tree
Maxjta 314b1ed
include: add clock control/interrupt controller api.
Maxjta 360bd98
board: artery: add AT32F405 AT-START board support.
Maxjta 4d73a06
modules: artery: add new modules hal_at32 to support AT32F405.
Maxjta ac80b36
MAINTAINERS: Add West project hal_at32.
Maxjta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2018 Philémon Jaermann | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_AT_START_F405 | ||
select SOC_AT32F405 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2025, Maxjta | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <dt-bindings/pinctrl/at32f405r(c-g-m)xx-pinctrl.h> | ||
|
||
&pinctrl { | ||
usart1_default: usart1_default { | ||
group1 { | ||
pinmux = <USART1_TX_PA9>, <USART1_RX_PA10>; | ||
}; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* Copyright (c) 2025 Maxjta | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/dts-v1/; | ||
#include <artery/at32f402_405/at32f405rct7.dtsi> | ||
#include "at_start_f405-pinctrl.dtsi" | ||
#include <zephyr/dt-bindings/input/input-event-codes.h> | ||
|
||
/ { | ||
model = "Artery AT-START-F405 board"; | ||
compatible = "artery,at_start_f405"; | ||
|
||
chosen { | ||
zephyr,console = &usart1; | ||
zephyr,shell-uart = &usart1; | ||
zephyr,sram = &sram0; | ||
zephyr,flash = &flash0; | ||
}; | ||
|
||
leds: leds { | ||
compatible = "gpio-leds"; | ||
|
||
red_led: led2 { | ||
Maxjta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
gpios = <&gpiof 4 GPIO_ACTIVE_HIGH>; | ||
label = "User LED2"; | ||
}; | ||
|
||
yellow_led: led3 { | ||
gpios = <&gpiof 5 GPIO_ACTIVE_HIGH>; | ||
label = "User LED3"; | ||
}; | ||
|
||
green_led: led4 { | ||
gpios = <&gpiof 6 GPIO_ACTIVE_HIGH>; | ||
label = "User LED4"; | ||
}; | ||
}; | ||
|
||
gpio_keys { | ||
compatible = "gpio-keys"; | ||
|
||
user_button: button { | ||
label = "User"; | ||
gpios = <&gpioa 0 GPIO_ACTIVE_HIGH>; | ||
zephyr,code = <INPUT_KEY_0>; | ||
}; | ||
}; | ||
|
||
aliases { | ||
led0 = &red_led; | ||
led1 = &yellow_led; | ||
led2 = &green_led; | ||
sw0 = &user_button; | ||
}; | ||
}; | ||
|
||
&gpioa { | ||
status = "okay"; | ||
}; | ||
|
||
&gpiob { | ||
status = "okay"; | ||
}; | ||
|
||
&gpioc { | ||
status = "okay"; | ||
}; | ||
|
||
&gpiod { | ||
status = "okay"; | ||
}; | ||
|
||
&gpiof { | ||
status = "okay"; | ||
}; | ||
|
||
&clk_hick { | ||
status = "okay"; | ||
}; | ||
|
||
&clk_hext { | ||
clock-frequency = <12000000>; | ||
status = "okay"; | ||
}; | ||
|
||
&sysclk { | ||
clock-frequency = <DT_FREQ_M(216)>; | ||
status = "okay"; | ||
}; | ||
|
||
&pll { | ||
div-ms = <1>; | ||
mul-ns = <72>; | ||
div-fp = <2>; | ||
div-fu = <5>; | ||
clocks = <&clk_hext>; | ||
status = "okay"; | ||
}; | ||
|
||
&crm { | ||
clocks = <&pll>; | ||
ahb-prescaler = <1>; | ||
clock-frequency = <216000000>; | ||
apb1-prescaler = <2>; | ||
apb2-prescaler = <1>; | ||
status = "okay"; | ||
}; | ||
|
||
&usart1 { | ||
pinctrl-0 = <&usart1_default>; | ||
pinctrl-names = "default"; | ||
current-speed = <115200>; | ||
status = "okay"; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
identifier: at_start_f405 | ||
name: Artery AT-START-F405 | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
- xtools | ||
supported: | ||
- gpio | ||
ram: 96 | ||
flash: 256 | ||
vendor: artery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (c) 2025, Jun Tan <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Enable MPU | ||
CONFIG_ARM_MPU=y | ||
|
||
# Enable HW stack protection | ||
CONFIG_HW_STACK_PROTECTION=y | ||
|
||
# Enable GPIO | ||
CONFIG_GPIO=y | ||
|
||
# Enable Console | ||
CONFIG_SERIAL=y | ||
CONFIG_CONSOLE=y | ||
CONFIG_UART_CONSOLE=y | ||
|
||
# Enable reset | ||
CONFIG_RESET=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# keep first | ||
board_runner_args(pyocd "--target=at32f405rc") | ||
board_runner_args(jlink "--device=AT32F405RC" "--speed=4000") | ||
|
||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
board: | ||
name: at_start_f405 | ||
vendor: artery | ||
socs: | ||
- name: at32f405 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
.. zephyr:board:: at_start_f405 | ||
|
||
Overview | ||
******** | ||
|
||
The AT START F405 board features an ARM Cortex-M4 based AT32F405 MCU | ||
with a wide range of connectivity support and configurations. | ||
|
||
Hardware | ||
******** | ||
|
||
- ARM Cortex-M4F Processor | ||
- Core clock up to 216 MHz | ||
- 256KB Flash memory | ||
- 96 KB SRAM | ||
- 1x12-bit 2MSPS ADC | ||
- Up to 6x USART and 2x UART | ||
- Up to 3x I2C | ||
- Up to 3x SPI | ||
- 1x QSPI interface | ||
- 1x CAN interface(2.0B Active) | ||
- 1x OTGHS on chip phy, Support usb2.0 high speed | ||
- 1x OTGFS Support usb2.0 Full speed | ||
- Up to 14 times | ||
Maxjta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 2 x 7-channel DMA controllers | ||
|
||
Supported Features | ||
================== | ||
|
||
.. zephyr:board-supported-hw:: | ||
|
||
Serial Port | ||
=========== | ||
|
||
The AT-START-F405 board has one serial communication port. The default port | ||
is USART1 with TX connected at PA9 and RX at PA10. | ||
|
||
Programming and Debugging | ||
************************* | ||
|
||
.. zephyr:board-supported-runners:: | ||
|
||
Using ATLink or J-Link | ||
======================= | ||
The board comes with an embedded AT-Link programmer. | ||
You need to install CMSIS-Pack which is required by pyOCD | ||
when programming or debugging by the AT-Link programmer. | ||
Execute the following command to install CMSIS-Pack for AT32F405CCT7 | ||
if not installed yet. | ||
|
||
.. code-block:: console | ||
|
||
pyocd pack install at32f405cct7 | ||
|
||
Also, J-Link can be used to program the board via the SWD interface | ||
(PA13/SWDIO and PA14/SWCLK). | ||
|
||
#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample application: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/basic/blinky | ||
:board: at_start_f405 | ||
:goals: build | ||
:compact: | ||
|
||
#. To flash an image: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/basic/blinky | ||
:board: at_start_f405 | ||
:goals: flash | ||
:compact: | ||
|
||
When using J-Link, append ``--runner jlink`` option after ``west flash``. | ||
|
||
You should see blink LED2 on board AT-START-F405. | ||
|
||
#. To debug an image: | ||
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/basic/blinky | ||
:board: at_start_f405 | ||
:goals: debug | ||
:compact: | ||
|
||
When using J-Link, append ``--runner jlink`` option after ``west debug``. | ||
|
||
References | ||
********** | ||
|
||
.. _microbit website: https://www.arterychip.com/en/product/AT32F405.jsp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _boards-artery: | ||
|
||
Artery Technology | ||
################# | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
**/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright (c) 2022 Teslabs Engineering S.L. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
config CLOCK_CONTROL_AT32 | ||
bool "AT32 clock control" | ||
default y | ||
depends on DT_HAS_ARTERY_AT32_CCTL_ENABLED | ||
help | ||
Enable driver for AT32 Reset Clock Unit (CRM). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.