Open source minimal stack for the ch32 line of WCH processors, including the ch32v003, a 10¢ 48 MHz RISC-V Microcontroller - as well as many other chips within the ch32v/x line.
MIT License
971
stars
150
forks
source link
Can't load, set up breakpoint, reset from GDB + minichlink #201
Very simple example: Load a blinky.elf file into the chip, make it start from 0 and break in the main() function.
Chip: CH32V003, Debugger: WCH-Link(E), firmware version 2.9 (latest).
I can't get this to work at all. Producure:
Erase chp (minichlink -E)
Unplug and replug minichlink adapter
Start minichlink in GDB mode (minichlink -G)
Tell GDB to connect to the GDB server, load the binary, rest + halt the chip, set up the breakpoint, continue by using
Program received signal SIGTRAP, Trace/breakpoint trap.
HardFault_Handler () at src\main.c:61
61 }
(gdb) where
#0 HardFault_Handler () at src\main.c:61
#1 0x00000212 in handle_reset ()
at C:\Users\Max\.platformio\packages\framework-wch-noneos-sdk\Startup\startup_ch32v00x.S:170
it just hangs in the hardfault handler there.
Note that when I then exit minichlink and just do minichlink.exe -b to reboot the chip, the LED does blink normally.
So something is wrong with the reset procedure?
Firmware is attached here, blinky on PC1: firmware.zip
Now that I am getting back into the swing of things, I can take another look at this. That said, I really don't ever use/like GDB, so it's been hard getting myself to actually test and make this move forward.
Very simple example: Load a blinky.elf file into the chip, make it start from 0 and break in the
main()
function. Chip: CH32V003, Debugger: WCH-Link(E), firmware version 2.9 (latest).I can't get this to work at all. Producure:
minichlink -E
)minichlink -G
)with
my_gdbinit.txt
Output:
On
minichlink
side:When I Ctrl+C in GDB:
it just hangs in the hardfault handler there.
Note that when I then exit minichlink and just do
minichlink.exe -b
to reboot the chip, the LED does blink normally.So something is wrong with the reset procedure?
Firmware is attached here, blinky on PC1: firmware.zip