Skip to content

Commit 881561a

Browse files
committed
Error resolve, bug fix and 2 new targets information add
1. Resolve the Error: L6218E: Undefined symbol flash_get_erase_value 2. Bug fix (ADC, USART, etc.) 3. Modify the wrong name (TATGET_GigaDevice-->TARGET_GigaDevice) 4. Add new targets (GD32-F450ZI and GD32-E103VB) support to target.json 5. Add INITIAL_SP macro for GD32-F450ZI and GD32-E103VB
1 parent 95f7a97 commit 881561a

25 files changed

+1845
-1751
lines changed

targets/TARGET_GigaDevice/TARGET_GD32F30X/TATGET_GD32F307VG/PeripheralNames.h renamed to targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/PeripheralNames.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ typedef enum {
4343
UART_4 = (int)UART4
4444
} UARTName;
4545

46-
#define STDIO_UART_TX PORTA_9
47-
#define STDIO_UART_RX PORTA_10
48-
#define STDIO_UART UART_0
46+
#define STDIO_UART_TX PORTC_10
47+
#define STDIO_UART_RX PORTC_11
48+
#define STDIO_UART UART_2
4949

5050
typedef enum {
5151
SPI_0 = (int)SPI0,

targets/TARGET_GigaDevice/TARGET_GD32F30X/TATGET_GD32F307VG/PeripheralPins.c renamed to targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/PeripheralPins.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ const PinMap PinMap_UART_TX[] = {
272272
{PORTB_10, UART_2, 7},
273273
{PORTC_10, UART_2, 7 | (5 << 3)}, /* GPIO_USART2_TX_PARTIAL_REMAP */
274274
{PORTD_8, UART_2, 7 | (6 << 3)}, /* GPIO_USART2_TX_FULL_REMAP */
275-
{PORTC_10, UART_3, 7},
275+
{PORTC_10_MUL0, UART_3, 7},
276276
{PORTC_12, UART_4, 7},
277277
{NC, NC, 0}
278278
};
@@ -284,8 +284,8 @@ const PinMap PinMap_UART_RX[] = {
284284
{PORTD_6, UART_1, 1 | (4 << 3)}, /* GPIO_USART1_RX_REMAP */
285285
{PORTB_11, UART_2, 1},
286286
{PORTC_11, UART_2, 1 | (5 << 3)}, /* GPIO_USART2_RX_PARTIAL_REMAP */
287-
{PORTD_9, UART_2, 1 | (6 << 3)}, /* PGPIO_USART2_RX_PARTIAL_REMAP */
288-
{PORTC_11, UART_3, 1},
287+
{PORTD_9, UART_2, 1 | (6 << 3)}, /* GPIO_USART2_RX_FULL_REMAP */
288+
{PORTC_11_MUL0, UART_3, 1},
289289
{PORTD_2, UART_4, 1},
290290
{NC, NC, 0}
291291
};
@@ -317,7 +317,7 @@ const PinMap PinMap_SPI_MOSI[] = {
317317
};
318318

319319
const PinMap PinMap_SPI_MISO[] = {
320-
{PORTA_6, SPI_0, 1},
320+
{PORTA_6, SPI_0, 7},
321321
{PORTB_4, SPI_0, 7 | (1 << 3)}, /* GPIO_SPI0_REMAP */
322322
{PORTB_14, SPI_1, 7},
323323
{NC, NC, 0}

targets/TARGET_GigaDevice/TARGET_GD32F30X/TATGET_GD32F307VG/PinNames.h renamed to targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/PinNames.h

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ typedef enum {
102102
PORTC_9 = 0x29,
103103
PORTC_9_MUL0 = PORTC_9 | MUL0,
104104
PORTC_10 = 0x2A,
105+
PORTC_10_MUL0 = PORTC_10 | MUL0,
105106
PORTC_11 = 0x2B,
107+
PORTC_11_MUL0 = PORTC_11 | MUL0,
106108
PORTC_12 = 0x2C,
107109
PORTC_13 = 0x2D,
108110
PORTC_14 = 0x2E,
@@ -152,21 +154,19 @@ typedef enum {
152154
A1 = PORTC_1,
153155
A2 = PORTC_2,
154156
A3 = PORTC_3,
155-
A4 = PORTC_4,
156-
A4_I2C_SDA = PORTC_11,
157-
A4_I2C_SCL = PORTC_10,
158-
A5 = PORTC_5,
157+
A4 = PORTA_0,
158+
A5 = PORTB_1,
159159
D0 = PORTA_3,
160160
D1 = PORTA_2,
161-
D2 = PORTA_4,
162-
D3 = PORTC_6,
161+
D2 = PORTE_4,
162+
D3 = PORTD_12,
163163
D4 = PORTB_3,
164164
D5 = PORTC_7,
165-
D6 = PORTC_8,
165+
D6 = PORTB_0,
166166
D7 = PORTB_4,
167-
D8 = PORTB_5,
168-
D9 = PORTC_9,
169-
D10 = PORTA_1,
167+
D8 = PORTD_11,
168+
D9 = PORTE_5,
169+
D10 = PORTA_8,
170170
D11 = PORTB_15,
171171
D12 = PORTB_14,
172172
D13 = PORTB_13,
@@ -177,29 +177,44 @@ typedef enum {
177177
LED2 = PORTE_1,
178178
LED3 = PORTE_6,
179179

180-
KEY2 = PORTA_0,
181-
KEY3 = PORTB_1,
182-
183-
BUTTON1 = KEY2,
184-
BUTTON2 = KEY3,
185-
186-
SERIAL_TX = PORTA_9,
187-
SERIAL_RX = PORTA_10,
188-
USBTX = PORTA_9,
189-
USBRX = PORTA_10,
190-
191-
I2C_SCL = PORTB_6,
192-
I2C_SDA = PORTB_7,
193-
SPI_MOSI = PORTA_7,
194-
SPI_MISO = PORTA_6,
195-
SPI_SCK = PORTA_5,
196-
SPI_CS = PORTE_3,
197-
PWM_OUT = PORTA_7,
180+
KEY1 = PORTE_2,
181+
KEY2 = PORTE_7,
182+
183+
BUTTON1 = KEY1,
184+
BUTTON2 = KEY2,
185+
186+
SERIAL_TX = PORTC_10,
187+
SERIAL_RX = PORTC_11,
188+
USBTX = SERIAL_TX,
189+
USBRX = SERIAL_RX,
190+
191+
I2C_SCL = D15,
192+
I2C_SDA = D14,
193+
SPI_MOSI = D11,
194+
SPI_MISO = D12,
195+
SPI_SCK = D13,
196+
SPI_CS = D10,
197+
PWM_OUT = D9,
198+
199+
USBFS_VBUS = PORTA_9,
200+
USBFS_DM = PORTA_11,
201+
USBFS_DP = PORTA_12,
202+
203+
RMII_TX_EN = PORTB_11,
204+
RMII_TXD0 = PORTB_12,
205+
RMII_TXD1 = PORTB_13,
206+
RMII_RXD0 = PORTC_4,
207+
RMII_RXD1 = PORTC_5,
208+
RMII_CRS_DV = PORTA_7,
209+
RMII_MDC = PORTC_1,
210+
RMII_MDIO = PORTA_2,
211+
RMII_INT = PORTB_0,
212+
RMII_REF_CLK = PORTA_1,
198213

199214
NC = (int)0xFFFFFFFF
200215
} PinName;
201216

202-
/* BIT[7:4] port number (0=PORTA, 1=PORTB, 2=PORTC, 3=PORTD, 4=PORTE, 5=PORTF)
217+
/* BIT[7:4] port number (0=PORTA, 1=PORTB, 2=PORTC, 3=PORTD, 4=PORTE)
203218
BIT[3:0] pin number */
204219
#define GD_PORT_GET(X) (((uint32_t)(X) >> 4) & 0xF)
205220
#define GD_PIN_GET(X) (((uint32_t)(X) & 0xF))
@@ -208,7 +223,7 @@ typedef enum {
208223
#define GD_PIN_MODE_GET(X) (X & 0x07)
209224
#define GD_PIN_SPEED_GET(X) ((X >> 9) & 0x03)
210225
#define GD_PIN_REMAP_GET(X) ((X >> 3) & 0x3F)
211-
#define GD_PIN_CHANNEL_GET(X) ((X >> 11) & 0x0F)
226+
#define GD_PIN_CHANNEL_GET(X) ((X >> 11) & 0x1F)
212227

213228
/* Defines GPIO pin direction */
214229
typedef enum {
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
#! armcc -E
2-
; *************************************************************
3-
; *** Scatter-Loading Description File generated by uVision ***
4-
; *****
5-
6-
#if !defined(MBED_APP_START)
7-
#define MBED_APP_START 0x08000000
8-
#endif
9-
10-
#if !defined(MBED_APP_SIZE)
11-
#define MBED_APP_SIZE 0x100000
12-
#endif
13-
14-
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K)
15-
16-
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
17-
*.o (RESET, +First)
18-
*(InRoot$$Sections)
19-
.ANY (+RO)
20-
}
21-
22-
; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150)
23-
RW_IRAM1 (0x20000000+0x150) (0x18000-0x150) { ; RW data
24-
.ANY (+RW +ZI)
25-
}
26-
}
27-
1+
#! armcc -E
2+
; *************************************************************
3+
; *** Scatter-Loading Description File generated by uVision ***
4+
; *****
5+
6+
#if !defined(MBED_APP_START)
7+
#define MBED_APP_START 0x08000000
8+
#endif
9+
10+
#if !defined(MBED_APP_SIZE)
11+
#define MBED_APP_SIZE 0x100000
12+
#endif
13+
14+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K)
15+
16+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
17+
*.o (RESET, +First)
18+
*(InRoot$$Sections)
19+
.ANY (+RO)
20+
}
21+
22+
; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150)
23+
RW_IRAM1 (0x20000000+0x150) (0x18000-0x150) { ; RW data
24+
.ANY (+RW +ZI)
25+
}
26+
}
27+
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
#! armcc -E
2-
; *************************************************************
3-
; *** Scatter-Loading Description File generated by uVision ***
4-
; *****
5-
6-
#if !defined(MBED_APP_START)
7-
#define MBED_APP_START 0x08000000
8-
#endif
9-
10-
#if !defined(MBED_APP_SIZE)
11-
#define MBED_APP_SIZE 0x100000
12-
#endif
13-
14-
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K)
15-
16-
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
17-
*.o (RESET, +First)
18-
*(InRoot$$Sections)
19-
.ANY (+RO)
20-
}
21-
22-
; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150)
23-
RW_IRAM1 (0x20000000+0x150) (0x18000-0x150) { ; RW data
24-
.ANY (+RW +ZI)
25-
}
26-
}
27-
1+
#! armcc -E
2+
; *************************************************************
3+
; *** Scatter-Loading Description File generated by uVision ***
4+
; *****
5+
6+
#if !defined(MBED_APP_START)
7+
#define MBED_APP_START 0x08000000
8+
#endif
9+
10+
#if !defined(MBED_APP_SIZE)
11+
#define MBED_APP_SIZE 0x100000
12+
#endif
13+
14+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region (1024K)
15+
16+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
17+
*.o (RESET, +First)
18+
*(InRoot$$Sections)
19+
.ANY (+RO)
20+
}
21+
22+
; 84 vectors (16 core + 68 peripheral) * 4 bytes = 336 bytes to reserve (0x150)
23+
RW_IRAM1 (0x20000000+0x150) (0x18000-0x150) { ; RW data
24+
.ANY (+RW +ZI)
25+
}
26+
}
27+

0 commit comments

Comments
 (0)