Skip to content

Commit

Permalink
Try out some things regarding debugging, needs newer and modded openocd
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgerhardt committed Dec 24, 2024
1 parent ae1b721 commit cb2fad9
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion boards/genericGD32A503CB.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503CB",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503CC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503CC",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503KB.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503KB",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503KC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503KC",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503RB.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503RB",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503RC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503RC",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503RD.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"debug": {
"jlink_device": "GD32A503RD",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503VB.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503VB",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503VC.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"debug": {
"jlink_device": "GD32A503VC",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
2 changes: 1 addition & 1 deletion boards/genericGD32A503VD.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"debug": {
"jlink_device": "GD32A503VD",
"openocd_target": "unknown",
"openocd_target": "stm32f1x",
"svd_path": "GD32A50X.svd",
"default_tools": [
"stlink"
Expand Down
4 changes: 4 additions & 0 deletions examples/gd32-spl-blinky/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions examples/gd32-spl-blinky/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 3 additions & 0 deletions examples/zephyr-blink/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
platform = gd32
framework = zephyr
board = genericGD32A503RD
upload_protocol = gdlinkcli
debug_tool = cmsis-dap
debug_load_cmds = preload
1 change: 1 addition & 0 deletions examples/zephyr-blink/zephyr/prj.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_GPIO=y
CONFIG_DEBUG_THREAD_INFO=y
1 change: 1 addition & 0 deletions misc/scripts/board_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", []))

Expand Down

0 comments on commit cb2fad9

Please sign in to comment.