-
Notifications
You must be signed in to change notification settings - Fork 8.2k
boards: arm: GD32F450I-EVAL: add initial support #39958
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
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0e50aa9
soc: arm: gigadevice: use specific series for GD32F403
gmarull d6db6ba
soc: arm: gigadevice: gd32f403: simplify soc selection
gmarull 083a73a
soc: arm: gigadevice: gd32f403: cleanup soc.h
gmarull 6ed8ac0
modules: hal_gigadevice: adjust CMake
gmarull 7c27095
dts: arm: gigadevice: organize dts files in folders
gmarull 6c8fa69
manifest: update hal_gigadevice
gmarull c67b3b5
modules: hal_gigadevice: make compile definitions global
gmarull 5496c16
modules: hal_gigadevice: add missing drivers
gmarull 0979117
dts: arm: gigadevice: add initial support for gd32f4xx
gmarull 8e3fe37
dts: arm: gigadevice: add support for gd32f450ik
gmarull 81c68e9
soc: arm: gigadevice: add support for GD32F4XX SoCs
gmarull 383abae
boards: arm: gd32f450i_eval: add initial support
gmarull 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
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) 2021, Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| zephyr_library() | ||
| zephyr_library_sources(board.c) |
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) 2021 Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_INIT_PRIORITY | ||
| int "Board initialization priority" | ||
| default 50 | ||
| help | ||
| Board initialization priority. |
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) 2021, Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_GD32F450I_EVAL | ||
| bool "GigaDevice GD32F450I-EVAL" | ||
| depends on SOC_GD32F450 |
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) 2021 Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if BOARD_GD32F450I_EVAL | ||
|
|
||
| config BOARD | ||
| default "gd32f450i_eval" | ||
|
|
||
| endif # BOARD_GD32F450I_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,27 @@ | ||
| /* | ||
| * Copyright (c) 2021, Teslabs Engineering S.L. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <init.h> | ||
|
|
||
| static int board_init(const struct device *dev) | ||
| { | ||
| rcu_periph_clock_enable(RCU_GPIOA); | ||
|
|
||
| /* PA9: USART0 TX */ | ||
| gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_9); | ||
| gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_9); | ||
| gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO_PIN_9); | ||
|
|
||
| /* PA10: USART0 RX */ | ||
| gpio_af_set(GPIOA, GPIO_AF_7, GPIO_PIN_10); | ||
| gpio_mode_set(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO_PIN_10); | ||
| gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO_PIN_10); | ||
|
|
||
| rcu_periph_clock_disable(RCU_GPIOA); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| SYS_INIT(board_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); |
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,4 @@ | ||
| # Copyright (c) 2021, Teslabs Engineering S.L. | ||
| # 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.
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,146 @@ | ||
| .. _gd32f450i_eval: | ||
|
|
||
| GigaDevice GD32F450I-EVAL | ||
| ######################### | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| The GD32F450I-EVAL board is a hardware platform that enables prototyping | ||
| on GD32F450IK Cortex-M4F Stretch Performance MCU. | ||
|
|
||
| The GD32F450IK features a single-core ARM Cortex-M4F MCU which can run up | ||
| to 200 MHz with flash accesses zero wait states, 3072kiB of Flash, 256kiB of | ||
| SRAM and 140 GPIOs. | ||
|
|
||
| .. image:: img/gd32f450i_eval.png | ||
| :align: center | ||
| :alt: gd32f450i_eval | ||
|
|
||
|
|
||
| Hardware | ||
| ******** | ||
|
|
||
| - GD32F450IKT6 MCU | ||
| - AT24C02C 2Kb EEPROM | ||
| - GD25Q32C 16Mbit SPI and QSPI NOR Flash | ||
| - GD9FS1G8F2A 1Gbit NAND Flash | ||
| - Micron MT48LC16M16A2P-6AIT 256Mbit SDRAM | ||
| - 3 x User LEDs | ||
| - 3 x User Push buttons | ||
| - 1 x USART (RS-232 at J1 connector) | ||
| - 1 x POT connected to an ADC input | ||
| - Headphone interface | ||
| - Micro SD Card Interface | ||
| - USB FS connector | ||
| - USB HS connector | ||
| - 1 x CAN | ||
| - Ethernet Interface | ||
| - 3.5" RGB-LCD (320x480) | ||
| - OV2640 Digital Camera | ||
| - GD-Link on board programmer | ||
| - J-Link/JTAG connector | ||
|
|
||
| For more information about the GD32F450 SoC and GD32F450I-EVAL board: | ||
|
|
||
| - `GigaDevice Cortex-M4F Stretch Performance SoC Website`_ | ||
| - `GD32F450xx Datasheet`_ | ||
| - `GD32F4xx User Manual`_ | ||
| - `GD32F450I-EVAL User Manual`_ | ||
|
|
||
| Supported Features | ||
| ================== | ||
|
|
||
| The board configuration supports the following hardware features: | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
|
|
||
| * - Peripheral | ||
| - Kconfig option | ||
| - Devicetree compatible | ||
| * - NVIC | ||
| - N/A | ||
| - :dtcompatible:`arm,v7m-nvic` | ||
| * - SYSTICK | ||
| - N/A | ||
| - N/A | ||
| * - USART | ||
| - :kconfig:`CONFIG_SERIAL` | ||
| - :dtcompatible:`gd,gd32-usart` | ||
|
|
||
| Serial Port | ||
| =========== | ||
|
|
||
| The GD32F450I-EVAL board has one serial communication port. The default port | ||
| is USART0 with TX connected at PA9 and RX at PA10. | ||
|
|
||
| Programming and Debugging | ||
| ************************* | ||
|
|
||
| Before programming your board make sure to configure boot and serial jumpers | ||
| as follows: | ||
|
|
||
| - J2/3: Select 2-3 for both (boot from user memory) | ||
| - J5: Select 1-2 position (labeled as ``USART0``) | ||
|
|
||
| Using GD-Link | ||
| ============= | ||
|
|
||
| The GD32F450I-EVAL includes an onboard programmer/debugger (GD-Link) which | ||
| allows flash programming and debugging over USB. There is also a JTAG header | ||
| (J1) which can be used with tools like Segger J-Link. | ||
|
|
||
| #. Build the Zephyr kernel and the :ref:`hello_world` sample application: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: gd32f450i_eval | ||
| :goals: build | ||
| :compact: | ||
|
|
||
| #. Run your favorite terminal program to listen for output. On Linux the | ||
| terminal should be something like ``/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: gd32f450i_eval | ||
| :goals: flash | ||
| :compact: | ||
|
|
||
| You should see "Hello World! gd32f450i_eval" in your terminal. | ||
|
|
||
| #. To debug an image: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: gd32f450i_eval | ||
| :goals: debug | ||
| :compact: | ||
|
|
||
|
|
||
| .. _GigaDevice Cortex-M4F Stretch Performance SoC Website: | ||
| https://www.gigadevice.com/products/microcontrollers/gd32/arm-cortex-m4/stretch-performance-line/ | ||
|
|
||
| .. _GD32F450xx Datasheet: | ||
| https://gd32mcu.21ic.com/data/documents/shujushouce/GD32F450xx_Datasheet_Rev1.1.pdf | ||
|
|
||
| .. _GD32F4xx User Manual: | ||
| https://www.gigadevice.com/manual/gd32f450xxxx-user-manual/ | ||
|
|
||
| .. _GD32F450I-EVAL User Manual: | ||
| http://www.gd32mcu.com/download/down/document_id/120/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,25 @@ | ||
| /* | ||
| * Copyright (c) 2021, Teslabs Engineering S.L. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
|
|
||
| #include <gigadevice/gd32f4xx/gd32f450ik.dtsi> | ||
|
|
||
| / { | ||
| model = "GigaDevice GD32F450I-EVAL"; | ||
| compatible = "gd,gd32f450i-eval"; | ||
|
|
||
| chosen { | ||
| zephyr,sram = &sram0; | ||
| zephyr,flash = &flash0; | ||
| zephyr,console = &usart0; | ||
| zephyr,shell-uart = &usart0; | ||
| }; | ||
| }; | ||
|
|
||
| &usart0 { | ||
| status = "okay"; | ||
| current-speed = <115200>; | ||
| }; |
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 @@ | ||
| # Copyright (c) 2021, Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| identifier: gd32f450i_eval | ||
| name: GigaDevice GD32F450I-EVAL | ||
| type: mcu | ||
| arch: arm | ||
| ram: 112 | ||
| flash: 3072 | ||
| toolchain: | ||
| - zephyr | ||
| - gnuarmemb | ||
| - xtools |
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) 2021, Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| CONFIG_SOC_SERIES_GD32F4XX=y | ||
| CONFIG_SOC_GD32F450=y | ||
| CONFIG_BOARD_GD32F450I_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 |
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,25 @@ | ||
| # Copyright (c) 2021, ATL-Electronics | ||
| # Copyright (c) 2021, Teslabs Engineering S.L. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| source [find interface/cmsis-dap.cfg] | ||
| transport select swd | ||
|
|
||
| set CHIPNAME gd32f450ik | ||
| set CPUTAPID 0x790007a3 | ||
|
|
||
| source [find target/stm32f4x.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 | ||
| } | ||
|
|
||
File renamed without changes.
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,18 @@ | ||
| /* | ||
| * Copyright (c) 2021 Teslabs Engineering S.L. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <mem.h> | ||
| #include <gigadevice/gd32f4xx/gd32f4xx.dtsi> | ||
|
|
||
| / { | ||
| soc { | ||
| flash-controller@40023c00 { | ||
| flash0: flash@8000000 { | ||
| reg = <0x08000000 DT_SIZE_K(3072)>; | ||
| }; | ||
| }; | ||
| }; | ||
| }; |
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.