0
\$\begingroup\$

I'm on a system with external flash, so I'm unable to program it easily. However, I can load firmware through JTAG - OpenOCD - GDB chain. I automated it as far as I'm able with bash and .gdbinit, but it's, well... shit. Doesn't work most of the time, I have to constantly fix it by hand or power cycle the board.

So I was wondering, does anyone knows a way to load a program using only OpenOCD?

In essence I'm looking to implement following GDB commands in OpenOCD script:

monitor reset halt
load
continue

EDIT:

The board is for Kendryte K210 risc-v microcontroller. The board is using an external flash and normally programmed through USB-UART converter (bootloader flag maybe?).

They've got their own fork of OpenOCD. I'm pretty sure I can't use OpenOCD's program or flash commands, it's the first thing I tried.

\$\endgroup\$
  • 1
    \$\begingroup\$ What's your hardware? OpenOCD does support flashing on many configurations: openocd.org/doc/html/Flash-Programming.html \$\endgroup\$ – Eugene Sh. Feb 1 at 19:00
  • \$\begingroup\$ You can set up OpenOCD so that you can telnet into it, and use commands from that interface. That's how my workflow with the tool goes -- I command flash loads from OpenOCD, and often use it for inspecting the device's memory-mapped peripherals without going through GDB. You do realize that there's a chance that the problem is the custom fork of OpenOCD, yes? \$\endgroup\$ – TimWescott Feb 1 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.