kanflo / opendps

Give your DPS5005 the upgrade it deserves
MIT License
879 stars 124 forks source link

Support Request: build/upload doesn't work #236

Closed sixtyfive closed 3 years ago

sixtyfive commented 3 years ago

Hi, could somebody help me get through this?

$ make -C libopencm3
make: Entering directory '/home/jrs/Builds/opendps/libopencm3'
  GENHDR  include/libopencm3/lpc13xx/irq.json
  GENHDR  include/libopencm3/lpc17xx/irq.json
  GENHDR  include/libopencm3/lpc43xx/m4/irq.json
  GENHDR  include/libopencm3/lpc43xx/m0/irq.json
  GENHDR  include/libopencm3/vf6xx/irq.json
  GENHDR  include/libopencm3/stm32/l1/irq.json
  GENHDR  include/libopencm3/stm32/f0/irq.json
  GENHDR  include/libopencm3/stm32/f4/irq.json
  GENHDR  include/libopencm3/stm32/f1/irq.json
  GENHDR  include/libopencm3/stm32/f2/irq.json
  GENHDR  include/libopencm3/stm32/l0/irq.json
  GENHDR  include/libopencm3/stm32/l4/irq.json
  GENHDR  include/libopencm3/stm32/f7/irq.json
  GENHDR  include/libopencm3/stm32/f3/irq.json
  GENHDR  include/libopencm3/sam/3x/irq.json
  GENHDR  include/libopencm3/sam/3n/irq.json
  GENHDR  include/libopencm3/sam/3s/irq.json
  GENHDR  include/libopencm3/sam/d/irq.json
  GENHDR  include/libopencm3/sam/3a/irq.json
  GENHDR  include/libopencm3/sam/3u/irq.json
  GENHDR  include/libopencm3/lm3s/irq.json
  GENHDR  include/libopencm3/efm32/g/irq.json
  GENHDR  include/libopencm3/efm32/lg/irq.json
  GENHDR  include/libopencm3/efm32/tg/irq.json
  GENHDR  include/libopencm3/efm32/gg/irq.json
  BUILD   lib/stm32/f0
/bin/sh: -c: line 1: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 2: syntax error: unexpected end of file
make: *** [Makefile:64: lib/stm32/f0] Error 2
make: Leaving directory '/home/jrs/Builds/opendps/libopencm3'

Line 64 of libopencm3/Makefile reads

  $(Q)$(MAKE) --directory=$@ SRCLIBDIR="$(SRCLIBDIR)"

Fwiw, all the quotes look in order in that Makefile, and if I proceed to lib/stm32/?? and type make there, it works just fine. I can then go back to following the tutorial, but upon the incantation of openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg, this happens:

Open On-Chip Debugger 0.11.0+dev-00062-g6405d35f3 (2021-04-04-21:32)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter driver' not 'interface'
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
DEPRECATED! use 'swj_newdap' not 'hla newtap'
[repeats about a hundred times]
embedded:startup.tcl:265: Error: Infinite eval recursion
in procedure 'script' 
at file "embedded:startup.tcl", line 26
in procedure 'swj_newdap' called at file "target/stm32f1x.cfg", line 38
in procedure 'hla' called at file "target/swj-dp.tcl", line 28
[repeats about 300 times]
at file "embedded:startup.tcl", line 265

Unfortunately:

$ cp /usr/share/openocd/scripts/interface/stlink.cfg interface/
$ cp /usr/share/openocd/scripts/target/stm32f1x.cfg target/
$ openocd -f interface/stlink.cfg -f target/stm32f1x.cfg

Still exhibits the same problem. Is it possible that some of the software on my laptop is too new? Trying outside of the openocd/scripts directory then:

$ openocd -f interface/stlink.cfg -f target/stm32f1x.cfg
Open On-Chip Debugger 0.11.0+dev-00062-g6405d35f3 (2021-04-04-21:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V6J56S32 (API v0) VID:PID 0483:3748
Warn : target stm32f1x.cpu examination failed
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms

Still no dice. Have I got a hardware problem then perhaps? But the STLink is working fine and the connection to the module seems good, too... SWDIO on the bottom row, far right, SWDCLK to its left, GND in the middle, right?

sixtyfive commented 3 years ago

nm was a broken stlink after all ... sorry for the hassle