---

** [tickets:#167] STLink v2 doesn't work in jtag mode with target stm32f1x**

**Status:** new
**Milestone:** 0.9.0
**Labels:** jtag stlink-v2 
**Created:** Tue Nov 14, 2017 03:49 AM UTC by Fabián Inostroza
**Last Updated:** Tue Nov 14, 2017 03:49 AM UTC
**Owner:** nobody


Hi,

I tried to use an STLink v2 as a JTAG interface (hla_jtag) to an STM32F103 mcu 
and it throws the following error:
~~~
/usr/bin/../share/openocd/scripts/target/stm32f1x.cfg:41: Error: invalid 
subcommand "newtap stm32f1x bs -irlen 5"
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "/home/fabian/.openocd/stm32f103.cfg", line 11
in procedure 'jtag' called at file 
"/usr/bin/../share/openocd/scripts/target/stm32f1x.cfg", line 41
~~~
I modified the file target/stm32f1x.cfg in line 40 to look like this:
~~~
if {[using_jtag]} {
   if {[using_hla]} {
      hla newtap $_CHIPNAME bs -irlen 5
   } else {
      jtag newtap $_CHIPNAME bs -irlen 5
   }
}
~~~
and now works fine with the STLink v2 and jtag-lock-pick tiny v2 in swd and 
jtag mode.

The other target/stm32fxx.cfg files share the same problem but I haven't tested 
the modifications with real hardware.

Also note that there is an implied 'else' in line 30 of the stm32f1x.cfg file, 
I think that would be nice to put an explicit else for consistency.

I'm using openocd 0.10.0 from Debian testing.



---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to