VisualGDB with STM32L432KC

Sysprogs forums Forums VisualGDB VisualGDB with STM32L432KC

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #9050
    honestapple
    Participant

    Hello,everyone. I am newbie to VisualGDB. I have downloaded the VisualGDB 5.1r6 for Windows 7 32bit and tried to debug Nucleo STM32L432KC. The OpenOCD test is ok.

    Open On-Chip Debugger 0.9.0 (2016-09-01) [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: 500 kHz
    adapter_nsrst_delay: 100
    none separate
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : clock speed 480 kHz
    Info : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374B
    Info : using stlink api v2
    Info : Target voltage: 3.257369
    Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    adapter speed: 480 kHz
    stm32l4x.cpu: target state: halted
    target halted due to debug-request, current mode: Thread
    xPSR: 0x01000000 pc: 0x080001a0 msp: 0x20000408

    When I pressed “F5” to debug the device, the program could be downloaded into the device successfully. The debug process could not be started and the following error was reported.

    “The memroy location used for the stack (0x2000bffc) is not writable. Please check the selected device type and the link script. You can disable automatic stack checking via VisualGDB Project Properties”

    The VisualGDB output:

    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: 500 kHz
    adapter_nsrst_delay: 100
    none separate
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : clock speed 480 kHz
    Info : STLINK v2 JTAG v25 API v2 SWIM v14 VID 0x0483 PID 0x374B
    Info : using stlink api v2
    Info : Target voltage: 3.255790
    Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    Info : Unable to match requested speed 500 kHz, using 480 kHz
    adapter speed: 480 kHz
    stm32l4x.cpu: target state: halted
    target halted due to debug-request, current mode: Thread
    xPSR: 0x01000000 pc: 0x080001a0 msp: 0x20000408
    adapter speed: 4000 kHz
    VisualGDB_OpenOCD_Ready
    Info : accepting ‘gdb’ connection on tcp/50665
    Info : device id = 0x10016435
    Warn : Cannot identify target as a STM32L4 family.
    Error: auto_probe failed
    Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use ‘gdb_memory_map disable’.
    Error: attempted ‘gdb’ connection rejected

    I checked the user manual of STM32L432KC.It seems that the memory address 0x2000bffc locates in SRAM1(0x20000000-0x2000C000). I couldn’t understand why this memory address could not be writable. I tried to disable automatic stack checking through uncheck the option for validate the stack pointer, visualgdb did not check stack memory, but the above error remain.

    Would anyone help me to solve this problems?
    “Warn : Cannot identify target as a STM32L4 family”.
    Does this warning indicate that there some wrong with the config file of OpenOCD? How to disable gdb_memory_map?

    #9052
    support
    Keymaster

    Hi,

    This is a known issue. Basically, OpenOCD does not know the current device ID and cannot detect the FLASH characteristics for it:

    Warn : Cannot identify target as a STM32L4 family.

    Normally the device IDs are added by the OpenOCD maintainers fairly quickly, so we would recommend simply waiting a month or two until an update is available. We could also provide brief instructions on building OpenOCD from scratch and patching it to support the new device if you don’t want to wait for the OpenOCD guys to do that for you.

    #9054
    honestapple
    Participant

    Thank you.

    Would you like to give me the url about how to build and patch OpenOCD from scratch?

    #9065
    support
    Keymaster

    Hi,

    You can build the OpenOCD fork that we use from the sources here: https://github.com/sysprogs/openocd

    You can use this MinGW environment that has all the necessary libraries: http://sysprogs.com/files/tmp/MinGW.7z

    Simply search the source code for the “Cannot identify target as a STM32L4 family” line and you will see the table that checks the device IDs and selects the FLASH size based on them. Adding your device there should solve the problem.

    #9264
    MartinF
    Participant

    Hi,

    I’m having the same issue (I’m trying to use VisualGDB with the STM32L443RCT6) and am having some trouble getting the dependencies for this version of OpenOCD. Would you please provide a link again to the MinGW environment?

    Thank you,

    Martin

    #9266
    support
    Keymaster

    Hi,

    No problem. We have re-uploaded the MinGW archive to the old location mentioned above.

    #9269
    MartinF
    Participant

    Thank you!

    #10969
    sdzienge
    Participant

    Is the MinGW environment linked above current?  I’m having trouble with the STM32L496 series not being supported by OpenOCD.  I pulled down the most recent source from the fork linked above and the MinGW environment, but I’m getting errors when running ./bootstrap about libtoolsize being required but not found.

    #10975
    support
    Keymaster

    The bootstrap script (and other autotools) don’t work very well on Windows.

    We would recommend getting a checkout of our OpenOCD fork that uses CMake and manually merging it with the latest code from the main OpenOCD repository. We will also do that on our side in the next couple of weeks, so you can simply wait for that.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.