Community-PIO-CH32V / platform-ch32v

PlatformIO platform for CH32V RISC-V chips (CH32V003, CH32V103, CH32V20x, CH32V30x, CH32X035) and CH56x, CH57x, CH58x, CH59x
Apache License 2.0
234 stars 37 forks source link

CH32V003 Debug Problems Windows #56

Open alexandrkolesnikov1 opened 6 months ago

alexandrkolesnikov1 commented 6 months ago

Hello everyone! I'm trying to set up debug on CH32V003. But it turns out that I only see assembler lines and do not see my code during debugging. How can I achieve that I can see the disassembled code?

image

platformio.ini


platform = ch32v 
board = genericCH32V003F4U6 
framework = arduino 
build_type = debug
board_build.core = openwch 
monitor_speed = 115200 ``` 
alexandrkolesnikov1 commented 6 months ago

Note: I use WCH-Link(E)

maxgerhardt commented 6 months ago

That shouldn't happen. Only initially on function entry, it does go into the __riscv_save_x function, but once you carefully step-into each instruction, it should return to the C/C++ code normally.

Does this also happen with the most simple blinky example? https://github.com/Community-PIO-CH32V/platform-ch32v/blob/develop/examples/blinky-arduino/src/main.cpp

alexandrkolesnikov1 commented 6 months ago

@maxgerhardt Yes it happens with blink example too. But I fix this problem when rewrite my code to noneos-sdk. I dont now why but it happens when i use Arduino sdk and it happens only with users code, for example "ch32v00x_usart.h"/"ch32v00x_usart.c" debug works normaly