Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/soc/arm/atmel_sam/samv71/ @nandojve
/soc/arm/cypress/ @nandojve
/soc/arm/bcm*/ @sbranden
/soc/arm/gigadevice/ @nandojve
/soc/arm/infineon_xmc/ @parthitce
/soc/arm/nxp*/ @mmahadevan108 @dleach02
/soc/arm/nordic_nrf/ @ioannisg
Expand Down Expand Up @@ -99,6 +100,7 @@
/boards/arm/faze/ @mbittan @simonguinot
/boards/arm/frdm*/ @mmahadevan108 @dleach02
/boards/arm/frdm*/doc/ @dleach02 @MeganHansen
/boards/arm/gd32*/ @nandojve
/boards/arm/google_*/ @jackrosenthal
/boards/arm/hexiwear*/ @mmahadevan108 @dleach02
/boards/arm/hexiwear*/doc/ @dleach02 @MeganHansen
Expand Down Expand Up @@ -185,6 +187,7 @@
/drivers/debug/ @nashif
/drivers/*/*sam4l* @nandojve
/drivers/*/*cc13xx_cc26xx* @bwitherspoon
/drivers/*/*gd32* @nandojve
/drivers/*/*litex* @mateusz-holenko @kgugala @pgielda
/drivers/*/*mcux* @mmahadevan108 @dleach02
/drivers/*/*stm32* @erwango @ABOSTM @FRASTM
Expand Down Expand Up @@ -393,6 +396,7 @@
/dts/arm/atmel/ @galak
/dts/arm/broadcom/ @sbranden
/dts/arm/cypress/ @nandojve
/dts/arm/gigadevice/ @nandojve
/dts/arm/infineon/ @parthitce
/dts/arm64/ @carlocaione
/dts/arm64/armv8-r.dtsi @povergoing
Expand Down Expand Up @@ -441,6 +445,7 @@
/dts/bindings/modem/*hl7800.yaml @LairdCP/zephyr
/dts/bindings/serial/ns16550.yaml @dcpleung @nashif
/dts/bindings/wifi/*esp-at.yaml @mniestroj
/dts/bindings/*/*gd32* @nandojve
/dts/bindings/*/*npcx* @MulinChao @WealianLiao @ChiHuaL
/dts/bindings/*/*psoc6* @nandojve
/dts/bindings/*/nordic* @anangl
Expand Down Expand Up @@ -563,6 +568,7 @@
/lib/libc/arcmwdt/ @abrodkin @ruuddw @evgeniy-paltsev
/modules/ @nashif
/modules/mbedtls/ @ceolin @d3zd3z
/modules/hal_gigadevice/ @nandojve
/modules/trusted-firmware-m/ @ioannisg @microbuilder
/kernel/device.c @andyross @nashif
/kernel/idle.c @andyross @nashif
Expand Down
5 changes: 5 additions & 0 deletions boards/arm/gd32f403z_eval/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_library_sources(board.c)
8 changes: 8 additions & 0 deletions boards/arm/gd32f403z_eval/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2021 ATL-Electronics
# SPDX-License-Identifier: Apache-2.0

config BOARD_INIT_PRIORITY
int "Board initialization priority"
default 50
help
Board initialization priority.
6 changes: 6 additions & 0 deletions boards/arm/gd32f403z_eval/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

config BOARD_GD32F403Z_EVAL
bool "GigaDevice GD32F403Z Evaluation Kit"
depends on SOC_GD32F403Z
9 changes: 9 additions & 0 deletions boards/arm/gd32f403z_eval/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2021 ATL Electronics
# SPDX-License-Identifier: Apache-2.0

if BOARD_GD32F403Z_EVAL

config BOARD
default "gd32f403z_eval"

endif # BOARD_GD32F403Z_EVAL
18 changes: 18 additions & 0 deletions boards/arm/gd32f403z_eval/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2021 ATL Electronics
* SPDX-License-Identifier: Apache-2.0
*/

#include <init.h>

static int board_init(const struct device *dev)
{
rcu_periph_clock_enable(RCU_GPIOA);

gpio_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_10);

return 0;
}

SYS_INIT(board_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);
4 changes: 4 additions & 0 deletions boards/arm/gd32f403z_eval/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions boards/arm/gd32f403z_eval/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
.. _gd32f403z_eval:

GigaDevice GD32F403Z-EVAL
#########################


Overview
********

The GD32F403Z-EVAL board is a hardware platform that enables design and debug
of the GigaDevice F403 Cortex-M4F High Performance MCU.

The GD32F403ZE features a single-core ARM Cortex-M4F MCU which can run up
to 168-MHz with flash accesses zero wait states, 512kiB of Flash, 96kiB of
SRAM and 112 GPIOs.

.. image:: img/gd32f403z_eval.png
:width: 800px
:align: center
:alt: gd32f403z_eval


Hardware
********

- USB interface with mini-USB connector
- 4 user LEDs
- 4 user push buttons
- Reset Button
- CAN port
- ADC connected to a potentiometer
- 2 DAC channels
- GD25Q40 4Mib SPI Flash
- HY27UF081G2A 1GiB NAND Flash
- AT24C02C 2KiB EEPROM
- 3.2 TFT LCD (320x240)
- PCM1770 Stereo DAC with Headphone Amplifier
- Micro-SDHC interface
- GD-Link interface

- CMSIS-DAP swd debug interface over USB HID.


For more information about the GD32F403 SoC and GD32F403Z-Eval board:

- `GigaDevice Cortex-M4F High Performance SoC Website`_
- `GD32F403 Datasheet`_
- `GD32F403 Reference Manual`_
- `GD32F403Z Eval Schematics`_
- `GD32 ISP Console`_


Supported Features
==================

The board configuration supports the following hardware features:

+-----------+------------+-----------------------+
| Interface | Controller | Driver/Component |
+===========+============+=======================+
| NVIC | on-chip | nested vectored |
| | | interrupt controller |
+-----------+------------+-----------------------+
| SYSTICK | on-chip | system clock |
+-----------+------------+-----------------------+
| UART | on-chip | serial port-polling |
+-----------+------------+-----------------------+


Serial Port
===========

The GD32F403Z-EVAL board has 5 serial communication ports. The default port
is UART0 at PIN-9 and PIN-10.

Programming and Debugging
*************************

Before program your board make sure to configure boot setting and serial port.
The default serial port is USART0. This port uses header JP-5/6 to route
signals between USB VBUS/ID and USART J2.

+--------+--------+------------+
| Boot-0 | Boot-1 | Function |
+========+========+============+
| 1-2 | 1-2 | SRAM |
+--------+--------+------------+
| 1-2 | 2-3 | Bootloader |
+--------+--------+------------+
| 2-3 | Any | Flash |
+--------+--------+------------+

+------+------+-------------+
| JP-5 | JP-6 | Function |
+======+======+=============+
| 1-2 | 1-2 | USART0 / J2 |
+------+------+-------------+
| 2-3 | 2-3 | USB VBUS/ID |
+------+------+-------------+
| open | open | Free |
+------+------+-------------+

Using GD-Link
=============

The GD32F403Z-EVAL includes an onboard programmer/debugger (GD-Link) which
allow flash programming and debug over USB. There are also program and debug
headers J1 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: gd32f403z_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: gd32f403z_eval
:goals: flash
:compact:

You should see "Hello World! gd32f403z_eval" in your terminal.

#. To debug an image:

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: gd32f403z_eval
:goals: debug
:compact:


.. _GigaDevice Cortex-M4F High Performance SoC Website:
https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/high-performance-line/gd32f403-series/

.. _GD32F403 Datasheet:
http://www.gd32mcu.com/data/documents/shujushouce/GD32F403xx_Datasheet_Rev1.3.pdf

.. _GD32F403 Reference Manual:
http://www.gd32mcu.com/data/documents/yingyongbiji/GD32F403_User_Manual_Rev2.4.pdf

.. _GD32F403Z Eval Schematics:
http://www.gd32mcu.com/download/down/document_id/270/path_type/1

.. _GD32 ISP Console:
http://www.gd32mcu.com/download/down/document_id/175/path_type/1
26 changes: 26 additions & 0 deletions boards/arm/gd32f403z_eval/gd32f403z_eval.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2021, ATL Electronics
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <gigadevice/gd32f403zet6.dtsi>

/ {
model = "GigaDevice GD32F403Z Evaluation Kit";
compatible = "gd,gd32f403z";

chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &usart0;
zephyr,shell-uart = &usart0;
};
};

&usart0 {
status = "okay";

current-speed = <115200>;
};
13 changes: 13 additions & 0 deletions boards/arm/gd32f403z_eval/gd32f403z_eval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

identifier: gd32f403z_eval
name: GigaDevice GD32F403Z Evaluation Kit
type: mcu
arch: arm
ram: 96
flash: 512
toolchain:
- zephyr
- gnuarmemb
- xtools
14 changes: 14 additions & 0 deletions boards/arm/gd32f403z_eval/gd32f403z_eval_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2021, ATL Electronics
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_SERIES_GD32F4=y
CONFIG_SOC_GD32F403Z=y
CONFIG_BOARD_GD32F403Z_EVAL=y

CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_CORTEX_M_SYSTICK=y

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
26 changes: 26 additions & 0 deletions boards/arm/gd32f403z_eval/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2021 ATL-Electronics
# SPDX-License-Identifier: Apache-2.0
source [find interface/cmsis-dap.cfg]
transport select swd

# chip name
set CHIPNAME gd32f403ze
set ENDIAN little
set CPUTAPID 0x790007a3
set FLASH_SIZE 0x80000

source [find target/stm32f1x.cfg]

reset_config trst_and_srst separate

$_TARGETNAME configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}

$_TARGETNAME configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}

1 change: 1 addition & 0 deletions drivers/serial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ zephyr_library_sources_ifdef(CONFIG_USB_CDC_ACM ${ZEPHYR_BASE}/misc/empty_file.c
zephyr_library_sources_ifdef(CONFIG_UART_RCAR uart_rcar.c)
zephyr_library_sources_ifdef(CONFIG_UART_XEC uart_mchp_xec.c)
zephyr_library_sources_ifdef(CONFIG_UART_NEORV32 uart_neorv32.c)
zephyr_library_sources_ifdef(CONFIG_USART_GD32 usart_gd32.c)

zephyr_library_sources_ifdef(CONFIG_USERSPACE uart_handlers.c)

Expand Down
2 changes: 2 additions & 0 deletions drivers/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ source "drivers/serial/Kconfig.rcar"

source "drivers/serial/Kconfig.xec"

source "drivers/serial/Kconfig.gd32"

source "drivers/serial/Kconfig.test"

source "drivers/serial/Kconfig.neorv32"
Expand Down
14 changes: 14 additions & 0 deletions drivers/serial/Kconfig.gd32
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2021 ATL Electronics
# SPDX-License-Identifier: Apache-2.0

# Workaround for not being able to have commas in macro arguments
DT_COMPAT_GIGADEVICE_GD32_USART := gd,gd32-usart

config USART_GD32
bool "GD32 serial driver"
default $(dt_compat_enabled,$(DT_COMPAT_GIGADEVICE_GD32_USART))
depends on SOC_FAMILY_GD32
select SERIAL_HAS_DRIVER
select USE_GD32_USART
help
This option enables the USART driver for GD32 SoC family.
Loading