Skip to content

Commit 2e47962

Browse files
authored
Merge pull request #63 from RationalAsh/main
Adding basic support for GD32F425
2 parents e4c4b1f + 0a95a6b commit 2e47962

File tree

9 files changed

+55072
-1
lines changed

9 files changed

+55072
-1
lines changed

.github/workflows/ci.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- gd32f1
2020
- gd32f2
2121
- gd32f3
22+
- gd32f4
2223
env:
2324
CRATES: ${{ matrix.crate }}
2425
CARGO_INCREMENTAL: 0

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [unreleased]
4+
5+
- GD32F4xx
6+
- Added support for GD32F425 in new `gd32f4` crate.
7+
38
## [0.9.1]
49

510
- Re-enabled re-export of `cortex_m_rt::interrupt` macro.

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ all: patch svd2rust
55

66
SHELL := /usr/bin/env bash
77

8-
CRATES ?= gd32c1 gd32e1 gd32e2 gd32e5 gd32f1 gd32f2 gd32f3
8+
CRATES ?= gd32c1 gd32e1 gd32e2 gd32e5 gd32f1 gd32f2 gd32f3 gd32f4
99

1010
# All yaml files in devices/ will be used to patch an SVD
1111
YAMLS := $(foreach crate, $(CRATES), \

devices/common_patches/gd32f425.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2024 The gd32-rs authors.
2+
#
3+
# SPDX-License-Identifier: MIT OR Apache-2.0
4+
5+
RCU:
6+
_modify:
7+
CTL:
8+
name: "CTL0"
9+
ADDINT:
10+
_modify:
11+
IRC48MSTBIC:
12+
access: write-only
13+
VKEY:
14+
_modify:
15+
KEY:
16+
access: write-only
17+
USART0:
18+
STAT1:
19+
_modify:
20+
EBF:
21+
access: write-only
22+
RTF:
23+
access: write-only
24+
TLI:
25+
_modify:
26+
CPPOS:
27+
access: read-only

devices/gd32f425.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright 2024 The gd32-rs authors.
2+
#
3+
# SPDX-License-Identifier: MIT OR Apache-2.0
4+
5+
_svd: ../svd/gd32f425.svd
6+
7+
_modify:
8+
name: "GD32F425"
9+
_include:
10+
- common_patches/gd32f425.yaml

gd32_part_table.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,11 @@ gd32f3:
147147
rm_url: https://www.gigadevice.com/manual/gd32f307xxxx-user-manual/
148148
members:
149149
- GD32F307
150+
gd32f4:
151+
gd32f425:
152+
url: https://www.gigadevice.com/product/mcu/high-performance-mcus/gd32f4xx-series/gd32f425
153+
rm: GD32F425
154+
rm_title: GD32F425
155+
rm_url: https://www.gigadevice.com/datasheet/gd32f425xxxx-datasheet/
156+
members:
157+
- GD32F425

scripts/makecrates.py

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"gd32f1": ["rt", "gd32f130", "gd32f190"],
2828
"gd32f2": ["rt", "gd32f205", "gd32f207"],
2929
"gd32f3": ["rt", "gd32f303", "gd32f307"],
30+
"gd32f4": ["rt", "gd32f425"],
3031
}
3132

3233
CRATE_DOC_TARGETS = {
@@ -37,6 +38,7 @@
3738
"gd32f1": "thumbv7m-none-eabi",
3839
"gd32f2": "thumbv7m-none-eabi",
3940
"gd32f3": "thumbv7em-none-eabihf",
41+
"gd32f4": "thumbv7em-none-eabihf",
4042
}
4143

4244
CARGO_TOML_TPL = """\

svd/extract.sh

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ cp vendor/GD32F30x_XD.svd gd32f303.svd
2727
cp vendor/GD32F30x_CL.svd gd32f305.svd
2828
cp vendor/GD32F30x_CL.svd gd32f307.svd
2929

30+
cp vendor/GD32F4xx.svd gd32f425.svd
31+
3032
unzip -juLL vendor/gd32f207_svd.zip '**.svd'
3133
cp gd32f20x_cl.svd gd32f205.svd
3234
cp gd32f20x_cl.svd gd32f207.svd

0 commit comments

Comments
 (0)