Skip to content

Commit afbf04e

Browse files
committed
README.md: add pllmf and pack exception for gd32a50x
- gd32a50x have pllmf calculate error, explain how to fix it. - gigadevice not upload pack to mdk website, explain how to storage pack - update arm library structure Signed-off-by: YuLong Yao <[email protected]>
1 parent 4040618 commit afbf04e

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ Each ARM firmware library is organized in the following structure:
2222
   ├── cmsis
2323
   │   └── gd
2424
   │   └── gd32xxx
25-
   └── standard_peripheral
26-
   ├── include
27-
   └── source
25+
   ├── standard_peripheral
26+
   │ ├── include
27+
   │ └── source
28+
└── support (optional)
29+
└── GigaDevice.GD32xxx_DFP.1.0.0.pack (Only for packs not in [Keil MDK5 Software Packs](https://www.keil.com/dd2/pack/))
2830
```
2931

3032
### RISC-V
@@ -125,3 +127,19 @@ conflict resolution. See below list with the proposed solution:
125127

126128
- i2c have different implement than current gd32 i2c driver. no need to patch
127129
upper i2c speed requirement.
130+
131+
- gd32a50x
132+
133+
- `SystemCoreClockUpdate` function contain an `pllmf` calculate error.
134+
Fix by change `0xFU` to `RCU_CFG0_PLLMF`:
135+
``` diff
136+
/* PLL multiplication factor */
137+
pllmf = GET_BITS(RCU_CFG0, 18, 21);
138+
pllmf += ((RCU_CFG0 & RCU_CFG0_PLLMF_4) ? 15U : 0U);
139+
- pllmf += ((0xFU == (RCU_CFG0 & RCU_CFG0_PLLMF)) ? 1U : 2U);
140+
+ pllmf += ((RCU_CFG0_PLLMF == (RCU_CFG0 & RCU_CFG0_PLLMF)) ? 1U : 2U);
141+
```
142+
- For debug this board, `pyocd` need a pack file from Gigadevice,
143+
But Gigadevice don't upload pack file to [keil packs repo](https://www.keil.com/dd2/pack/).
144+
Fix: Storage pack as `gd32a50x/support/GigaDevice.GD32A50x_DFP.1.0.0.pack`
145+
(Download from https://gd32mcu.com/cn/download/7?kw=GD32A5 -> GD32A50x AddOn)

0 commit comments

Comments
 (0)