Menu

#146 Connection under reset on ST-LINK-v2 doesn't work-NRST looks like inverted?

0.9.0
new
nobody
None
2017-03-07
2017-03-06
RayeR
No

Hi, I use ST-LINK-v2 (the FW updated to the latest ver. V2J27M15) from nucleo board for programming an external target with STM32F030C6T6 MCU via CN4 (VDD, SWDCLK, GND, SWDIO, NRST are connected to the target). In case if I reconfigure GPIO used by SWD by a mistake I need to use "Connection Under Reset" option in ST-Link Windows utility to be able to connect. It works fine. But I'd like to do the same with OpenOCD (0.10.0-00113-g0f83948 24.1.2017). When SWD GPIOs are not reconfigued then OpenOCD works fine. But I cannot reproduce "Connection Under Reset" behavior. I tried many reset_config options, e.g. reset_config srst_only srst_nogate connect_assert_srst that I had found on this forum but nothing works. I hooked the scope to ST-LINK and watch what's going on. If connect_assert_srst then it starts to control NRST pin but it seems the signal is inverted! And I cannot find any OpenOCD option how to invert it back to desired level (normal level should be 1, active 0).

So let's see, here's the scope of how ST-Link utility is doing "Connection Under Reset":
http://rayer.g6.cz/1tmp/nrst_stlink.png

And here's how OpenOCD do it with reset_config srst_only srst_nogate connect_assert_srst
http://rayer.g6.cz/1tmp/nrst_openocd.png

Could it be an OpenOCD bug? Or did I miss something?
BTW I also found that delays options like adapter_nsrst_delay doesn't change the waveform when different values used.

Discussion

  • Tomas Vanek

    Tomas Vanek - 2017-03-07

    If you set connect_assert_srst in OpenOCD, srst stays active until manually released. The easiest command to do so is 'reset' (or 'reset halt', 'reset init').

     
    • RayeR

      RayeR - 2017-03-07

      Thanks for quick reply. It works now.
      http://rayer.g6.cz/1tmp/nrst_openocd2.png
      The problem was that I had placed
      flash probe 0 command between init and later reset in my config so the OpenOCD failed at probe command and didn't continued to reset the MCU. So it can be closed now.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.