aappleby / picorvd

GDB-compatible RISC-V Debugger for CH32V003 that runs on a Raspberry Pi Pico
MIT License
173 stars 11 forks source link

Doesn't seem to write Flash #14

Closed shabaz123 closed 1 month ago

shabaz123 commented 1 month ago

Hi, I've uploaded the picorvd.uf2 file to the Pico, and wish to transfer an .elf file that was built with Mounriver Studio, it is an elf file that is known working.

Here is what I'm typing at the MINGW command prompt:

$ gdb-multiarch.exe -x C:/development/pico/picorvd/example/gdbinit -ex 'load' -ex 'detach' -ex 'quit' C:/development/CH32V_projects/test_proj/obj/test_proj.elf

This is the output:

GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...

warning: A handler for the OS ABI "Windows" is not built into this configuration
of GDB.  Attempting to continue with the default riscv:rv32 settings.

Reading symbols from C:/development/CH32V_projects/test_proj/obj/test_proj.elf...
0x03ffffff in ?? ()
Loading section .init, size 0xa0 lma 0x0
Loading section .text, size 0x12ac lma 0xa0
Loading section .data, size 0x38 lma 0x134c
Start address 0x00000000, load size 4996
Transfer rate: 4 KB/sec, 1665 bytes/write.
Detaching from program: C:\development\CH32V_projects\test_proj\obj\test_proj.elf, Remote target
[Inferior 1 (Remote target) detached]

Is the above correct? It appears to be correct, but when I try it, I find that the CH32V003 still is executing old code that it had in it.

Any help would be appreciated.

shabaz123 commented 1 month ago

Hi, solved. I needed to press and release the reset button on the CH32V003 board, and then quickly execute the gdb-multiarch command line.

shabaz123 commented 1 month ago

Closing.