Ripped off Usb connector

i read the manual and it’s a bit thin of how to configure the st-link have you done it before and what cables do I need and is it just the 2 pads as per the diagram below.

oops I meant

You can program it with an st-link v2, but not from arduino. (Although that might be fixable.) You need to hook up GND, SWDIO and SWDCLK. You can then compile the program by hitting “verify” in arduino, then find the compiled binary and upload it using openocd from the command line. I would have to look up the actual command line though.

so, I was looking at this, I take it that you can wire it up with 30 awg. and this programmer

oh. maybe I was thinking TTL?

Yes.
Most ST-link v2 programmers are full of fake ST-micro chips, but they usually still work just fine.

do i need to solder the pins on or can I use the breadboard pin wires? and if I can use those pins is there a specific method to connect to the st-link. e.g. gnd first, swdclk, swdio? or it doesn’t matter.

Breadboard is fine if connected right I would think.
Make all connections then apply power.

1 Like

the pins I have are too thin I might get some other pins, what is the pitch on the proffieboard, it looks about 2.5mm but I’d prefer to have confirmation of that.

The pitch is 0.1", or 2.54mm.

You might consider these:

1 Like

Thanks proffezorn how would connect those to the female connectors st_link v2?

Breadboard jumper wires?
Test clips (the spring loaded little hook ones) with a male pin on the other end?
Temporary solder?
Anything could really work. It’s just sitting still on a bench and doesn’t need to survive combat really, right?

2 Likes

so I got my parts should be here before september (at the latest) hopefully sometime this week. all parts incoming from australia and 1 tem from china. i’ll test it out. now, once I connect it to the board and my Manjaro Laptop. do I change the option in my ArduinoIDE Tools Menu > Programmer: STML BOOTLOADER to Programmer: ST-Link V2?

I don’t think that works (or does anything).
You need to press verify in Arduino, then find the generated elf file.
Then you run

openocd -f stm32l433.cfg -c "program ProffieOS.elf verify reset exit"

ProffieOS.elf is the file generated by the arduino when you pressed verify. (you might need to specify a full path or copy the file to where you are running openocd.)
OpenOCD can be found in the arduino-proffieboard plugin directory under the Arduino15 directory. (The arduino15 directory can be found in the arduino preferences.)

2 Likes

Hi Proffezorn,

I’m running linux manjaro and I wasn’t able to find the ProffieOS.elf file.

though I did find the openocd directory. does this look right?

/home/maxb/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-ProffieboardV2/openocd_scripts/

found another directory I think this is it.

/home/maxb/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/linux/openocd/

AAAH, found the file ProffieOS.ino.elf, this url shows you how to find it in windows and the information is true for linux as well.

on a linux box it’s in

/tmp/arduino_build_597057/ProffieOS.ino.elf

Looks like you found all the files, now you just have to put the command line together with those files and bob’s yer uncle. :slight_smile:

where am I putting those commands? in the arduino or terminal session?

Terminal.
Like

openocd -f stm32l433.cfg -c "program /tmp/arduino_build_597057/ProffieOS.ino.elf verify reset exit"
1 Like

so I tested the command without connecting the saber but I get this error.

[maxb@max-laptop bin]$ pwd
/home/maxb/.arduino15/packages/proffieboard_beta/hardware/stm32l4/3.6.0/tools/linux/openocd/bin
[maxb@max-laptop bin]$ openocd -f stm32l433.cfg -c "program /tmp/arduino_build_597057/ProffieOS.ino.elf verify reset exit"
bash: openocd: command not found
[maxb@max-laptop bin]$ 

is that expected? seeing as it’s not connected?

a bit more work but that cfg file isn’t present on my linux server.

what I did find was the following cfg

/home/maxb/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/variants/STM32L433CC-ProffieboardV2/openocd_scripts/stm32l433cc_butterfly.cfg

[maxb@max-laptop bin]$ ./openocd -f stm32l433cc_butterfly.cfg -c "program /tmp/arduino_build_597057/ProffieOS.ino.elf verify reset exit"
Open On-Chip Debugger 0.10.0-dev-00272-gf17dc4a (2016-10-10-15:18)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:60: Error: Can't find stm32l433cc_butterfly.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
[maxb@max-laptop bin]$ 

Probably need to just do ./openocd
Unless you added openocd to your $PATH, it’s not going to know where to find that program. Tell it where it is… in your current directory, so (dot) is where you are, then the app is the next thing in the path. So,

`./openocd -f stm32l433.cfg -c "program /tmp/arduino_build_597057/ProffieOS.ino.elf verify reset exit"`

yeah i did that but i got the script stm32l433.cfg couldn’t be found.

so I found multiple directories with cfg files, however, that particular cfg file is not present.

every cfg i put after -f isn’t found.

e.g.

[maxb@max-laptop bin]$ ./openocd -f stm32l433cc_butterfly.cfg -c "program /tmp/arduino_build_597057/ProffieOS.ino.elf verify reset exit"
Open On-Chip Debugger 0.10.0-dev-00272-gf17dc4a (2016-10-10-15:18)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:60: Error: Can't find stm32l433cc_butterfly.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 60
[maxb@max-laptop bin]$ 

i tried to use the absolute path for the cfg file but then I get another error

[maxb@max-laptop bin]$ ./openocd -f /home/maxb/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/target/stm32l4x.cfg -c "program /tmp/arduino_build_597057/ProffieOS.ino.elf verify reset exit"
Open On-Chip Debugger 0.10.0-dev-00272-gf17dc4a (2016-10-10-15:18)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
/home/maxb/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/target/stm32l4x.cfg:6: Error: Can't find target/swj-dp.tcl
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "/home/maxb/.arduino15/packages/proffieboard/hardware/stm32l4/3.6.0/tools/share/openocd/scripts/target/stm32l4x.cfg", line 6
[maxb@max-laptop bin]$