I was riding my skateboard the otherday when it suddenly lost power and wouldnt reboot. It now only displays a blue light when on (no green like my other working vesc). From my research I found that this could perhaps be a firmware or bootloader issue so I have been trying to redo it using a raspberry pi running openocd and the GPIO pins connected to the vesc.
I have managed to get it to connect to the vesc (can be seen in the openocd output.txt) but it won't program due to the device being protected. Anyone got any ideas on how I can fix? Also included is the openocd.cfg file.
Open OCD output:
Open On-Chip Debugger 0.10.0+dev-00954-gded67990 (2019-10-24-21:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : SysfsGPIO JTAG/SWD bitbang driver
Info : JTAG and SWD modes enabled
Warn : gpio 2 is already exported
Warn : gpio 18 is already exported
Info : This adapter doesn't support configurable speed
Info : SWD DPIDR 0x2ba01477
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Error: Translation from khz to jtag_speed not implemented
Error executing event reset-start on target stm32f4x.cpu:
embedded:startup.tcl:214: Error:
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 214
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : device id = 0x10076413
Info : SWD DPIDR 0x2ba01477
Error: Failed to read memory at 0x1fff7a24
Warn : STM32 flash size failed, probe inaccurate - assuming 1024k flash
Info : flash size = 1024 kbytes
Info : Device Security Bit Set
Error: Translation from khz to jtag_speed not implemented
Error executing event reset-start on target stm32f4x.cpu:
embedded:startup.tcl:214: Error:
in procedure 'program' called at file "openocd.cfg", line 11
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 214
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Error: Translation from khz to jtag_speed not implemented
Error executing event reset-init on target stm32f4x.cpu:
embedded:startup.tcl:214: Error:
in procedure 'program' called at file "openocd.cfg", line 11
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 214
** Programming Started **
Error: stm32x device protected
Error: failed erasing sectors 11 to 11
embedded:startup.tcl:449: Error: ** Programming Failed **
in procedure 'script'
at file "embedded:startup.tcl", line 26
in procedure 'program' called at file "openocd.cfg", line 11
in procedure 'program_error' called at file "embedded:startup.tcl", line 514
at file "embedded:startup.tcl", line 449
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Openocd.cfg config file:
source [find interface/sysfsgpio-raspberrypi.cfg]
transport select swd
source [find target/stm32f4x.cfg]
init
targets
reset halt
stm32f4x unlock 0
program bootloader.elf verify
reset
shutdown