Flash issues on linux

Hi

i recently got a Odrive board but i have been having problems flashing the firmware to it.

i’ve installed gcc-arm-none-eabi, gdb-arm-none-eabi and OpenOCD on a debian machine and cloned the firmware from the madcowswe git and it compiles seems to compile just fine.

but when i try to run ‘make flash’ i fails as shown below

root@debian:~/ODrive/Firmware# make flash
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c reset\ halt -c flash\ write_image\ erase\ build/ODriveFirmware.elf -c reset\ run -c exit
Open On-Chip Debugger 0.8.0 (2014-10-20-21:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Error: session's transport is not selected.
Runtime Error: embedded:startup.tcl:20:
in procedure 'script'
at file "embedded:startup.tcl", line 58
in procedure 'swj_newdap' called at file "/usr/share/openocd/scripts/target/stm32f4x.cfg", line 37
in procedure 'transport' called at file "/usr/share/openocd/scripts/target/swj-dp.tcl", line 26
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 20
Makefile:185: recipe for target 'flash' failed
make: *** [flash] Error 1

i’ve been googling a bit but i can’t seem to find anything remotely relevant to my issue, so i was hooping i could get some help here.

Hm I’ve never seen that before. Googling it, it looks like the error you would get if you didn’t give it the -f interface/stlink-v2.cfg part, except that you clearly did.

so i’ve tried on two different debian system (a regular desktop version running in a virtual machine and raspbian running on a pi) with the same result.

i tried without the st-link plugged in and it gave the same result.

Maybe your st-link is just faulty? DM me your address and I’ll send you a new one.

I couldn’t get St - link to work with my Linux Mint install. I installed ghostbad and it worked (St - link) a charm

so i tried using the st-link utility on my windows desktop and it connects just fine to the machine so i’m thinking i might be missing something in the version of debian i’m using.

can anyone name a linux distro that they have been able to program from?

Sorry that was GhostBSD

Latest version just seemed to work on my old thinkpad

well i might have to give it a try then.
i have no real experience with bsd but i gues i would just have to run

pkg install gcc-arm-none-eabi gdb-arm-none-eabi OpenOCD
make flash

or am i totally off there?

You could try using target/stm32f4x_stlink.cfg instead of target/stm32f4x.cfg. Change it in the Makefile. The first target file got to be deprecated in OpenOCD 0.9.0 and newer ones, but had been usable before.

@HBDK Let me know if you are able to try the fix suggested by @fancer.

openocd package update might also work.

Ok, so i was using an older version of debian (8.8 i think) and it was using openocd 0.8 so i made a new virtuel machine and installed debian 9.2.1 and the prerequisites (+build-essential) this installed openocd 0.9.

so i tried flashing (with no changes to the make file) and it worked.

so i gues the lesson is: don’t use openocd 0.8

1 Like

very long way you’ve chosen.)
Could you still try to use your host OS, but set target/stm32f4x_stlink.cfg config in the Makefile?

i did and it programmed but still ended up giving an error, i can try doing it again and post the result here, it looked like it transferred everything going by the size of transfer reported before the error.

long way? it only took a couple of minutes to make a fresh Debian install without the gui and the vdi i have been cloning up til now was getting old anyways.

A post was split to a new topic: Issues compiling: stdlib.h missing