-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Boards: arm: gd32a503v_eval: introduce gd32a503v_eval board #52774
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
Merged
carlescufi
merged 16 commits into
zephyrproject-rtos:main
from
feilongfl:dev-gd32a503v_eval
Jan 12, 2023
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
08f64e4
west: hal_gigadevice: add gd32a50x hal code
feilongfl f4a0784
dt-bindings: clock: gd32: add gd32a50x series support
feilongfl fd6bb2e
dt-bindings: gd32: reset: add support for gd32a50x
feilongfl dbdc2eb
dts: gd32a50x: introduce gd32a50x series
feilongfl 4d25fc0
soc: gd32a50x: introduce gd32a50x soc series
feilongfl e7bf5d0
drivers: pinctrl: gd32: add gd32a50x support
feilongfl edc4b8f
drivers: clock: gd32: add gd32a50x support
feilongfl c17bf8d
drivers: gd32-dac: add support for gd32a50x
feilongfl 4568cbc
drivers: gd32_spi: drop APB marco
feilongfl 43d93c3
drivers: gd32_adc: add support for gd32a50x series.
feilongfl fce9f4c
boards: arm: gd32a503v_eval: introduce gd32a503v_eval board
feilongfl 0d01b75
samples: drivers: dac: add support for gd32a50x
feilongfl d656ad5
samples: spi_flash: add support for gd32a503v_eval board
feilongfl 449addd
samples: jesd216: add support for gd32a503v_eval board
feilongfl 28832d6
samples: adc: add support for gd32a503v_eval board.
feilongfl 3792efa
test: adc: add unit test for gd32a503v_eval
feilongfl 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Copyright (c) 2022 YuLong Yao <[email protected]> | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_GD32A503V_EVAL | ||
| bool "GigaDevice GD32A503V-EVAL" | ||
| depends on SOC_GD32A503 |
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,9 @@ | ||
| # Copyright (c) 2022 YuLong Yao <[email protected]> | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if BOARD_GD32A503V_EVAL | ||
|
|
||
| config BOARD | ||
| default "gd32a503v_eval" | ||
|
|
||
| endif # BOARD_GD32A503V_EVAL |
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 YuLong Yao <[email protected]> | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| board_runner_args(pyocd "--target=gd32a503vd" "--tool-opt=--pack=${ZEPHYR_HAL_GIGADEVICE_MODULE_DIR}/${CONFIG_SOC_SERIES}/support/GigaDevice.GD32A50x_DFP.1.0.0.pack") | ||
| include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) | ||
|
|
||
| board_runner_args(gd32isp "--device=GD32A503VDT3") | ||
| include(${ZEPHYR_BASE}/boards/common/gd32isp.board.cmake) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,223 @@ | ||
| .. _gd32a503v_eval: | ||
|
|
||
| GigaDevice GD32A503V-EVAL | ||
| ######################### | ||
|
|
||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| The GD32A503V-EVAL board is a hardware platform that enables design and debug | ||
| of the GigaDevice A503 Cortex-M4F High Performance MCU. | ||
|
|
||
| The GD32A503VD features a single-core ARM Cortex-M4F MCU which can run up | ||
| to 120-MHz with flash accesses zero wait states, 384kiB of Flash, 48kiB of | ||
| SRAM and 88 GPIOs. | ||
|
|
||
| .. image:: img/gd32a503v_eval.jpg | ||
| :align: center | ||
| :alt: gd32a503v_eval | ||
|
|
||
|
|
||
| Hardware | ||
| ******** | ||
|
|
||
| - 2 user LEDs | ||
| - 2 user push buttons | ||
| - Reset Button | ||
| - ADC connected to a potentiometer | ||
| - 1 DAC channels | ||
| - GD25Q16 2Mib SPI Flash | ||
| - AT24C02C 2KiB EEPROM | ||
| - CS4344 Stereo DAC with Headphone Amplifier | ||
| - GD-Link interface | ||
|
|
||
| - CMSIS-DAP swd debug interface over USB HID. | ||
|
|
||
| - 2 CAN port(support CAN-FD) | ||
|
|
||
| For more information about the GD32A503 SoC and GD32A503V-EVAL board: | ||
|
|
||
| - `GigaDevice Cortex-M33 High Performance SoC Website`_ | ||
| - `GD32A503 Datasheet`_ | ||
| - `GD32A503 Reference Manual`_ | ||
| - `GD32A503V Eval Schematics`_ | ||
| - `GD32 ISP Console`_ | ||
|
|
||
|
|
||
| Supported Features | ||
| ================== | ||
|
|
||
| The board configuration supports the following hardware features: | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
|
|
||
| * - Peripheral | ||
| - Kconfig option | ||
| - Devicetree compatible | ||
| * - EXTI | ||
| - :kconfig:option:`CONFIG_GD32_EXTI` | ||
| - :dtcompatible:`gd,gd32-exti` | ||
| * - GPIO | ||
| - :kconfig:option:`CONFIG_GPIO` | ||
| - :dtcompatible:`gd,gd32-gpio` | ||
| * - NVIC | ||
| - N/A | ||
| - :dtcompatible:`arm,v8m-nvic` | ||
| * - PWM | ||
| - :kconfig:option:`CONFIG_PWM` | ||
| - :dtcompatible:`gd,gd32-pwm` | ||
| * - SYSTICK | ||
| - N/A | ||
| - N/A | ||
| * - USART | ||
| - :kconfig:option:`CONFIG_SERIAL` | ||
| - :dtcompatible:`gd,gd32-usart` | ||
| * - PINMUX | ||
| - :kconfig:option:`CONFIG_PINCTRL` | ||
| - :dtcompatible:`gd,gd32-pinctrl-af` | ||
| * - ADC | ||
| - :kconfig:option:`CONFIG_ADC` | ||
| - :dtcompatible:`gd,gd32-adc` | ||
| * - DAC | ||
| - :kconfig:option:`CONFIG_DAC` | ||
| - :dtcompatible:`gd,gd32-dac` | ||
| * - FMC | ||
| - N/A | ||
| - :dtcompatible:`gd,gd32-flash-controller` | ||
| * - SPI | ||
| - :kconfig:option:`CONFIG_SPI` | ||
| - :dtcompatible:`gd,gd32-spi` | ||
|
|
||
| Serial Port | ||
| =========== | ||
|
|
||
| The GD32A503V-EVAL board has 3 serial communication ports. The default port | ||
| is UART0 at PIN-72 and PIN-73. | ||
|
|
||
| Programming and Debugging | ||
| ************************* | ||
|
|
||
| Before program your board make sure to configure boot setting and serial port. | ||
| The default serial port is USART0. | ||
|
|
||
| +--------+--------+------------+ | ||
| | Boot-0 | Boot-1 | Function | | ||
| +========+========+============+ | ||
| | 1-2 | 1-2 | SRAM | | ||
| +--------+--------+------------+ | ||
| | 1-2 | 2-3 | Bootloader | | ||
| +--------+--------+------------+ | ||
| | 2-3 | Any | Flash | | ||
| +--------+--------+------------+ | ||
|
|
||
| Using GD-Link | ||
| ============= | ||
|
|
||
| The GD32A503V-EVAL includes an onboard programmer/debugger (GD-Link) which | ||
| allow flash programming and debug over USB. There are also program and debug | ||
| headers J2 and J100 that can be used with any ARM compatible tools. | ||
|
|
||
| #. Build the Zephyr kernel and the :ref:`hello_world` sample application: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: gd32a503v_eval | ||
| :goals: build | ||
| :compact: | ||
|
|
||
| #. Run your favorite terminal program to listen for output. Under Linux the | ||
| terminal should be :code:`/dev/ttyUSB0`. For example: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ minicom -D /dev/ttyUSB0 -o | ||
|
|
||
| The -o option tells minicom not to send the modem initialization | ||
| string. Connection should be configured as follows: | ||
|
|
||
| - Speed: 115200 | ||
| - Data: 8 bits | ||
| - Parity: None | ||
| - Stop bits: 1 | ||
|
|
||
| #. To flash an image: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: gd32a503v_eval | ||
| :goals: flash | ||
| :compact: | ||
|
|
||
| You should see "Hello World! gd32a503v_eval" in your terminal. | ||
|
|
||
| #. To debug an image: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: gd32a503v_eval | ||
| :goals: debug | ||
| :compact: | ||
|
|
||
|
|
||
| Using ROM bootloader | ||
| ==================== | ||
|
|
||
| The GD32A503 MCU have a ROM bootloader which allow flash programming. User | ||
| should install `GD32 ISP Console`_ software at some Linux path. The recommended | ||
| is :code:`$HOME/.local/bin`. | ||
|
|
||
| #. Build the Zephyr kernel and the :ref:`hello_world` sample application: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: gd32a503v_eval | ||
| :goals: build | ||
| :compact: | ||
|
|
||
| #. Enable board bootloader: | ||
|
|
||
| - Remove boot-0 jumper | ||
| - press reset button | ||
|
|
||
| #. To flash an image: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| west flash -r gd32isp [--port=/dev/ttyUSB0] | ||
|
|
||
| #. Run your favorite terminal program to listen for output. Under Linux the | ||
| terminal should be :code:`/dev/ttyUSB0`. For example: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ minicom -D /dev/ttyUSB0 -o | ||
|
|
||
| The -o option tells minicom not to send the modem initialization | ||
| string. Connection should be configured as follows: | ||
|
|
||
| - Speed: 115200 | ||
| - Data: 8 bits | ||
| - Parity: None | ||
| - Stop bits: 1 | ||
|
|
||
| Press reset button | ||
|
|
||
| You should see "Hello World! gd32a503v_eval" in your terminal. | ||
|
|
||
|
|
||
| .. _GigaDevice Cortex-M33 High Performance SoC Website: | ||
| https://www.gigadevice.com.cn/product/mcu/arm-cortex-m33/gd32a503vdt3 | ||
|
|
||
| .. _GD32A503 Datasheet: | ||
| https://www.gd32mcu.com/download/down/document_id/401/path_type/1 | ||
|
|
||
| .. _GD32A503 Reference Manual: | ||
| https://www.gd32mcu.com/download/down/document_id/402/path_type/1 | ||
|
|
||
| .. _GD32A503V Eval Schematics: | ||
| https://www.gd32mcu.com/download/down/document_id/404/path_type/1 | ||
|
|
||
| .. _GD32 ISP Console: | ||
| http://www.gd32mcu.com/download/down/document_id/175/path_type/1 | ||
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,35 @@ | ||
| /* | ||
| * Copyright (c) 2022 YuLong Yao <[email protected]> | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <dt-bindings/pinctrl/gd32a503v(b-c-d)xx-pinctrl.h> | ||
|
|
||
| &pinctrl { | ||
| usart0_default: usart0_default { | ||
| group1 { | ||
| pinmux = <USART0_TX_PA10>, <USART0_RX_PA11>; | ||
| }; | ||
| }; | ||
|
|
||
| adc0_default: adc0_default { | ||
| group1 { | ||
| pinmux = <ADC0_IN1_PC10>; | ||
| }; | ||
| }; | ||
|
|
||
| dac_default: dac_default { | ||
| group1 { | ||
| pinmux = <DAC_OUT_PA7>; | ||
| }; | ||
| }; | ||
|
|
||
| spi0_default: spi0_default { | ||
| group1 { | ||
| pinmux = <SPI0_SCK_PE14>, <SPI0_MOSI_PA2>, | ||
| <SPI0_MISO_PE13>, | ||
| /* Use pinmux to pullup pg10 and pg11. */ | ||
| <SPI0_IO2_PE15>, <SPI0_IO3_PB10>; | ||
| }; | ||
| }; | ||
| }; |
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,103 @@ | ||
| /* | ||
| * Copyright (c) 2022 YuLong Yao <[email protected]> | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
|
|
||
| #include <gigadevice/gd32a50x/gd32a503vdt3.dtsi> | ||
| #include "gd32a503v_eval-pinctrl.dtsi" | ||
|
|
||
| / { | ||
| model = "GigaDevice GD32A503V-EVAL"; | ||
| compatible = "gd,gd32a503v-eval"; | ||
|
|
||
| chosen { | ||
| zephyr,sram = &sram0; | ||
| zephyr,flash = &flash0; | ||
| zephyr,console = &usart0; | ||
| zephyr,shell-uart = &usart0; | ||
| zephyr,flash-controller = &fmc; | ||
| }; | ||
|
|
||
| leds { | ||
| compatible = "gpio-leds"; | ||
| led1: led1 { | ||
| gpios = <&gpioc 0 GPIO_ACTIVE_LOW>; | ||
| label = "LED1"; | ||
| }; | ||
| led2: led2 { | ||
| gpios = <&gpioc 1 GPIO_ACTIVE_LOW>; | ||
| label = "LED2"; | ||
| }; | ||
| }; | ||
|
|
||
| aliases { | ||
| led0 = &led1; | ||
| led1 = &led2; | ||
| spi-flash0 = &nor_flash; | ||
| }; | ||
| }; | ||
|
|
||
| &gpioa { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpiob { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpioc { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpiod { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpioe { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &gpiof { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &usart0 { | ||
| status = "okay"; | ||
| current-speed = <115200>; | ||
| pinctrl-0 = <&usart0_default>; | ||
| pinctrl-names = "default"; | ||
| }; | ||
|
|
||
| &adc0 { | ||
| status = "okay"; | ||
| pinctrl-0 = <&adc0_default>; | ||
| pinctrl-names = "default"; | ||
| }; | ||
|
|
||
| &dac { | ||
| status = "okay"; | ||
| pinctrl-0 = <&dac_default>; | ||
| pinctrl-names = "default"; | ||
| }; | ||
|
|
||
| &fwdgt { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &spi0 { | ||
| status = "okay"; | ||
| pinctrl-0 = <&spi0_default>; | ||
| pinctrl-names = "default"; | ||
| cs-gpios = <&gpioa 1 GPIO_ACTIVE_LOW>; | ||
|
|
||
| nor_flash: gd25q16@0 { | ||
| compatible ="jedec,spi-nor"; | ||
| size = <0x1000000>; | ||
| reg = <0>; | ||
| spi-max-frequency = <4000000>; | ||
| status = "okay"; | ||
| jedec-id = [c8 40 15]; | ||
| }; | ||
| }; |
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.