diff --git a/boards/genericGD32A503CB.json b/boards/genericGD32A503CB.json index 21b3e45..dc7791f 100644 --- a/boards/genericGD32A503CB.json +++ b/boards/genericGD32A503CB.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503CB", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503CC.json b/boards/genericGD32A503CC.json index 6af2888..9f10a58 100644 --- a/boards/genericGD32A503CC.json +++ b/boards/genericGD32A503CC.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503CC", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503KB.json b/boards/genericGD32A503KB.json index f2d6e91..20b6712 100644 --- a/boards/genericGD32A503KB.json +++ b/boards/genericGD32A503KB.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503KB", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503KC.json b/boards/genericGD32A503KC.json index 991de92..5021253 100644 --- a/boards/genericGD32A503KC.json +++ b/boards/genericGD32A503KC.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503KC", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503RB.json b/boards/genericGD32A503RB.json index c120ff2..7a9931f 100644 --- a/boards/genericGD32A503RB.json +++ b/boards/genericGD32A503RB.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503RB", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503RC.json b/boards/genericGD32A503RC.json index 212ff81..ce6deb1 100644 --- a/boards/genericGD32A503RC.json +++ b/boards/genericGD32A503RC.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503RC", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503RD.json b/boards/genericGD32A503RD.json index 74d4d7a..3c609aa 100644 --- a/boards/genericGD32A503RD.json +++ b/boards/genericGD32A503RD.json @@ -13,7 +13,7 @@ }, "debug": { "jlink_device": "GD32A503RD", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503VB.json b/boards/genericGD32A503VB.json index 499ced9..b958703 100644 --- a/boards/genericGD32A503VB.json +++ b/boards/genericGD32A503VB.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503VB", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503VC.json b/boards/genericGD32A503VC.json index 1a859f3..bc1bcbb 100644 --- a/boards/genericGD32A503VC.json +++ b/boards/genericGD32A503VC.json @@ -10,7 +10,7 @@ }, "debug": { "jlink_device": "GD32A503VC", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/boards/genericGD32A503VD.json b/boards/genericGD32A503VD.json index 472c135..c0a6075 100644 --- a/boards/genericGD32A503VD.json +++ b/boards/genericGD32A503VD.json @@ -13,7 +13,7 @@ }, "debug": { "jlink_device": "GD32A503VD", - "openocd_target": "unknown", + "openocd_target": "stm32f1x", "svd_path": "GD32A50X.svd", "default_tools": [ "stlink" diff --git a/examples/gd32-spl-blinky/platformio.ini b/examples/gd32-spl-blinky/platformio.ini index dfbf628..c9cc29b 100644 --- a/examples/gd32-spl-blinky/platformio.ini +++ b/examples/gd32-spl-blinky/platformio.ini @@ -195,6 +195,10 @@ framework = spl board = genericGD32A503RD framework = spl upload_protocol = gdlinkcli +debug_tool = cmsis-dap +build_type = debug +debug_build_flags = -O0 -g3 -ggdb3 +debug_load_cmds = preload ; GD32L23x series diff --git a/examples/gd32-spl-blinky/src/main.c b/examples/gd32-spl-blinky/src/main.c index 27538b4..8b1f746 100644 --- a/examples/gd32-spl-blinky/src/main.c +++ b/examples/gd32-spl-blinky/src/main.c @@ -61,9 +61,9 @@ int main(void) while (1) { gpio_bit_set(LEDPORT, LEDPIN); - delay_1ms(100); + delay_1ms(1000); gpio_bit_reset(LEDPORT, LEDPIN); - delay_1ms(100); + delay_1ms(1000); } } diff --git a/examples/zephyr-blink/platformio.ini b/examples/zephyr-blink/platformio.ini index 3ea8078..6973ac3 100644 --- a/examples/zephyr-blink/platformio.ini +++ b/examples/zephyr-blink/platformio.ini @@ -11,3 +11,6 @@ platform = gd32 framework = zephyr board = genericGD32A503RD +upload_protocol = gdlinkcli +debug_tool = cmsis-dap +debug_load_cmds = preload diff --git a/examples/zephyr-blink/zephyr/prj.conf b/examples/zephyr-blink/zephyr/prj.conf index 91c3c15..f8bf0b3 100644 --- a/examples/zephyr-blink/zephyr/prj.conf +++ b/examples/zephyr-blink/zephyr/prj.conf @@ -1 +1,2 @@ CONFIG_GPIO=y +CONFIG_DEBUG_THREAD_INFO=y \ No newline at end of file diff --git a/misc/scripts/board_generator.py b/misc/scripts/board_generator.py index fa43349..39ecc9c 100644 --- a/misc/scripts/board_generator.py +++ b/misc/scripts/board_generator.py @@ -112,6 +112,7 @@ def __repr__(self) -> str: "GD32L23x": "gd32e23x", # works per user comment "GD32C10X": "stm32f4x", # try Cortex-M4 compatible target "GD32W51x": "gd32e50x", # buest guess with Cortex-M33 + "GD32A50X": "stm32f1x", # no flashing supported } known_arduino_variants = { diff --git a/platform.py b/platform.py index bf991a5..0ed4163 100644 --- a/platform.py +++ b/platform.py @@ -166,7 +166,7 @@ def _add_default_debug_tools(self, board): ]) if str(debug.get("rtos", "no")) in ("true", "yes", "1"): server_args.extend([ - "-c", "$_TARGETNAME configure -rtos FreeRTOS" + "-c", "$_TARGETNAME configure -rtos auto" ]) server_args.extend(debug.get("openocd_extra_args", []))