St-linkv2 openocd error

It’s hard to be sure what’s going on, but my best guess is still a bad connection.

so I was able to get it flashed but I messed up the configuration so I did it again but now my ini files have funny characters. if I delete them and reflash will they be readded to the sd card?

Insufficient information…

How did you mess up?
Which INI file are you talking about?
Are you sure the funny characters aren’t supposed to be there?
When you re-flash, are you also re-compiling?
Do you have #define KEEP_SAVEFILES_WHEN_PROGRAMMING in your config file?

oh so sorry, I’ll test it later. I raged quit. I had backed up my *.ini files and deleted them from the sdcard and now my saber doesn’t turn on.

I just tried again and am currently getting this error.

root@Heironymous:/tmp/arduino_build_265075# openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ProffieOS.ino.elf verify reset exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate

Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.279255
Info : STM32L433.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for STM32L433.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x1fff3f36 msp: 0x20002c20
** Programming Started **
Info : device idcode = 0x10016435 (STM32L43/L44xx - Rev Z : 0x1001)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08038a68 .. 0x08038fff
Error: failed erasing sectors 0 to 113
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L433.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
** Programming Failed **
shutdown command invoked

the ini files where recreated but I haven’t put back the old files.

do you want to see what i’m using for the config. the keep_savefiles_when_programming is not enabled.

i’m using this command to flash the config on the proffie.

openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ProffieOS.ino.elf verify reset exit"

This looks a little weird to me. Did you connect with GDB?
If you halt the CPU, it might not be able to do the programming.
If that’s not it, then maybe you still have a bad connection?

I should also point out that even if you don’t have KEEP_SAVEFILES_WHEN_PROGRAMMING, it will keep using the savefiles if you program the same program again. It’s only when you compile that it creates a new upload, and then it will stop using the old savefiles.

Don’t think that’s the problem here, but I wanted to mention it anyways.

what’s gdb? It’s still in the same position as before. but I think you’re right about the connection.

did it again, did this compile successfully?

root@Heironymous:/tmp/arduino_build_265075# openocd -f /home/max/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-Proffieboard/openocd_scripts/stm32l433cc_butterfly.cfg -c "program ProffieOS.ino.elf verify reset exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate

Info : clock speed 500 kHz
Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.280851
Info : STM32L433.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for STM32L433.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x1fff3f36 msp: 0x20002c20
** Programming Started **
Info : device idcode = 0x10016435 (STM32L43/L44xx - Rev Z : 0x1001)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08038a68 .. 0x08038fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
shutdown command invoked

This is not a compilation.
This is an upload.
The upload seems to be successful though.
Compilation is when you use a compiler (g++/gcc) to convert source code into binaries, like ELF files.

so I compiled on arduino ide and then used the elf.ino to upload. but is the config in 7.9 case sensitive?

I misspelt the font directory there was meant to be spaces in the name. question, can you edit those in the edit mode so that it does find the font?

You can use the set_font command in the serial monitor.
The change will only be in the ini file of course.

can you use the st-linkv2 with the serial monitor? I thought that was only accessable via the usb.

And yes, Fett263’s edit mode should be able to do it to, as long as list_fonts can find the font. :slight_smile:

The st-link cannot access the serial monitor (AFAIK)
However, you can set up an USB TTL serial adapter and hook it up to RX/TX.
Of course, it’s easier to just re-flash… :slight_smile:

Edit: You need ENABLE_SERIAL in your config file to use RX/TX as a serial port.

DONE. thanks Profezzorn. so I need to hold it in place better. do you have way of attaching the pins better?

Maybe these:

They are a little hard on the through-holes though.

I’ve only used them a little, but I just soldered a wire to them rather than using them with test hooks.

oh yeah I got those. no wonder I was thinking this wasn’t that hard last time.

@Afrojedi Some additional info from my notes re: USB TTL

#define ENABLE_SERIAL

Hook up to RX/TX/GND.
Choose PORT in Arduino
To get all the STDOUT printouts, you need to run the "make_default_console" command.

 select 115200 baud and "newline" at the bottom of the serial monitor.
1 Like