Open OCD not working for STM32F7 MCU?

Sysprogs forums Forums VisualGDB Open OCD not working for STM32F7 MCU?

Tagged: 

This topic contains 6 replies, has 2 voices, and was last updated by  support 3 weeks, 5 days ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #12719

    jeremyvnc
    Participant

    I’m trying to get a new board to compile and debug that is using the STM32F746VGT6 chip.  I am using an STLINK V2.1 to program the chip.  I can get STLink Utility to see, flash and verify the flashing just fine and Visual Studio isn’t throwing any errors when compiling.  But when I go to debug the chip within the visual studio, I get the following error: “timed out while waiting for target halted”

    Here is my output log from testing the stlink V2.1:
    Open On-Chip Debugger 0.10.0 (2017-08-21) [https://github.com/sysprogs/openocd]
    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
    adapter speed: 2000 kHz
    adapter_nsrst_delay: 100
    srst_only separate srst_nogate srst_open_drain connect_deassert_srst
    Info : Unable to match requested speed 2000 kHz, using 1800 kHz
    Info : Unable to match requested speed 2000 kHz, using 1800 kHz
    Info : clock speed 1800 kHz
    Info : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374B
    Info : using stlink api v2
    Info : Target voltage: 3.214145
    Warn : Silicon bug: single stepping will enter pending exception handler!
    Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
    Error: timed out while waiting for target halted
    TARGET: stm32f7x.cpu – Not halted
    in procedure ‘reset’
    in procedure ‘ocd_bouncer’

    Here is the log from a successful connection with the stlink utility:
    15:38:13 : ST-LINK SN : 0676FF515457725187243559
    15:38:13 : ST-LINK Firmware version : V2J25M14
    15:38:13 : Connected via SWD.
    15:38:13 : SWD Frequency = 4,0 MHz.
    15:38:13 : Connection mode : Connect Under Reset.
    15:38:13 : Debug in Low Power mode enabled.
    15:38:13 : Device ID:0x449
    15:38:13 : Device flash Size : 1MBytes
    15:38:13 : Device family :STM32F74x/F75x

    I have good communication through the STLink V2.1 through the STLink Utility but not through OpenOCD through Visual Studio/VisualGDB.  I have used the same SWD pinout as many other STM32 boards using F4, F1, L1, L4 chips but this is the first time I’ve used an F7. I have tried on several boards with the same result. Can you help me please?

    Thank you,
    Jeremy

    • This topic was modified 1 month ago by  jeremyvnc.
    #12723

    support
    Keymaster

    Hi,

    This could happen if your firmware was interfering with the SWD pins or power states, hence preventing the debugger from attaching. Please try setting the “connect under reset” flag in VisualGDB Project Properties -> Debug Settings.

    #12729

    jeremyvnc
    Participant

    Thank you for your response.  There is no hardware connected to the JTAG/SWD pins except the programming connector and I’m just trying to load the LEDBlink example so no software conflicts.

    I tried looking for the “connect under reset” under debug properties and I don’t see it.  I am using 5.3 Preview 7 (build 1744).  Also, I do want to note that the checkboxes under reset device “before” and “after” do not save when you hit apply.  “Before” is always set and I cannot set “After”  they revert after you click apply from whatever setting you point them to.

    Update:  Just updated to the latest build (1864) and the same issues as above.

    • This reply was modified 1 month ago by  jeremyvnc.
    • This reply was modified 1 month ago by  jeremyvnc.
    #12733

    support
    Keymaster

    Hi,

    Please try updating your VisualGDB to v5.3R3 (latest maintenance release) and also update your OpenOCD package via Tools->VisualGDB->Manage VisualGDB Packages.

    If you still don’t see the options, please try attaching a screenshot of your Debug Settings page so that we could see which version you are using and suggest a way to update it.

    #12751

    jeremyvnc
    Participant

    I have upgraded to the latest VisualGDB 5.3R3 and the latest OpenOCD.  I still cannot get it to connect to my F7 board under debug.  I also do not see an option to connect under reset under Debug Settings.

    I have attached screenshots.

    Attachments:
    You must be logged in to view attached files.
    #12756

    jeremyvnc
    Participant

    Okay, I got the main issue solved.  I needed to connect the reset line to NRST instead of the jtag JTNRST line.  Now it works in both STLink and visual studio without error.  Odd too because on the F4’s, I use the jtag reset line and it works everytime.

    So, as for the other issues I mentioned.  They still exist.  There is no “connect under reset” checkbox or setting and when I change the reset behavior “Before” or “After” programming then hit accept, the changes always revert back to only “Before” checked.  Not a big deal but thought you should know of the bug.

    Thanks,
    Jeremy

    #12763

    support
    Keymaster

    Hi,

    Thanks, looks like the ‘connect under reset’ indeed doesn’t work on STM32F7. We have fixed this in the upcoming update to the OpenOCD package.

    As a workaround, please try changing the following line in stm32f7x.cfg:

    replace it with the version from F4X:

    Then VisualGDB will recognize it and show the “connect under reset” option.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.