Failed to program STM8 via SWIM

Sysprogs forums Forums VisualGDB Failed to program STM8 via SWIM

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33644
    Laura_0623
    Participant

    I am trying to program an STM8 using VisualGDB in Visual Studio.

    Whenever I try to start debugging (F5 key) I get the message “target halted due to debug-request, pc: 0x00006000”
    I have noticed that the nReset pin state does not change whenever it tries to program. The SWIM-pin is changed correctly according to ST (“UM0470” document) (low, then four pulses at 1 kHz followed by four pulses at 2 kHz).
    The reset pin should be low before this sequence is sent, but this doesn’t happen.

    However, I do see this (nReset pin state change) happening when programming (same hardware setup) using IAR workbench or ST Visual Develop.

    Is there something I can do to tell VisualGDB to pull the nReset pin low before sending the SWIM starting sequence?

    • This topic was modified 1 year, 3 months ago by Laura_0623.
    #33646
    support
    Keymaster

    Hi,

    VisualGDB manages the STM8 debugging via OpenOCD – an open-source tool for interfacing gdb to various hardware debuggers. The STM8-specific logic is contributed by ST and is mostly located in the stm8.c file.

    If you would like to change how OpenOCD handles the reset sequence, we would advise first locating the related logic in the OpenOCD sources. If there is an existing option for changing it, you can try adding it to the relevant OpenOCD script, or directly to the command line (use VisualGDB Project Properties -> Debug Settings -> Advanced to edit the OpenOCD command line directly). If there is no such option, you would need to patch OpenOCD and build a modified version yourself. We would advise following this tutorial to build our OpenOCD fork – it uses CMake and is much easier to build  on Windows, compared to the mainline version.

    If you end up patching OpenOCD to fix the issue, feel free to either submit a pull request to us, or send a patch to the OpenOCD mailing list, so that your patch gets included in subsequent releases.

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