Skip to main content
Visitor II
October 29, 2025
Question

Problem programming STM32L081 with J-Link even though ST-Link is working fine.

  • October 29, 2025
  • 2 replies
  • 269 views

Hi everyone

We have designed a custom board around the STM32L081CZ and produced 3 prototypes. On the first board I started testing and debugging using STM32CubeIDE on Windows. This worked fine but only with ST-Link, not with J-Link.

After testing (and fixing) our hardware, we wanted to program our boards on Debian using Zephyr. I gave a second board (with identical hardware fixes) to my colleague and he was able to program it with a J-Link using West without any problems. My initial board however, that I can still program using ST-Link however does not work using the J-Link (tried West, J-Flash and STM32CubeProgrammer). We since tested the third board and it also works fine with the J-Link.

I used ST-Link with STM32CubeProgrammer to connect to all three boards and verified that they are all in the same state (Option Bytes and Registers). I have added a screenshot where I connect first to the device that only connects to ST-Link (Time: 16:33) and then to the one that connects to both (Time 16:35).

I added a second screenshot where I tried to connect to both using J-Flash and J-Link. First I successfully connect to the board that is J-Link compatible. And further down I unsuccessfully try to connect to the target that is only reachable via ST-Link.

The problem occurs when the J-Link ties to initialize DAP.

 

We did not reassign any of the debug pins and I have fully erased the board, so there should be no issues with the SWDIO or SWCLK pins being in a false state (also demonstrated by the ST-Link working fine).

I also added a screenshot of the debug connector from the schematic.
SWDIO -> PA13, SWCLK -> PA14, nRESET -> NRST

 

Does anyone have an Idea what the issue could be? Any help would be much appreciated.

 

    This topic has been closed for replies.

    2 replies

    Super User
    October 29, 2025

    @lecc wrote:

    This worked fine but only with ST-Link, not with J-Link.


    As the problem lies with J-Link, you should ask Segger about that:

    https://www.segger.com/support/technical-support/

    https://forum.segger.com/board/4-j-link-flasher-related/

    leccAuthor
    Visitor II
    November 4, 2025

    Hi @Andrew Neil 

    Thanks for the suggestion. I consider posting my question there as well.

    However I am not convinced, that the problem lies with J-Link. The J-Link I use works fine with 2 of 3 boards suggesting there is no issue with the J-Link or the associated tools.

    Are there any settings, registers, or something that might have been changed/reconfigured by initially using the STM32CubeIDE and ST-Link that could have changed the configuration of this MCU on the first board, making it different from the other two? Something that the ST-Link can handle either way, but prevents the J-Link from connecting properly...

    Super User
    November 4, 2025

    Have you just posted the exact same text again, or is the forum playing up and duplicating posts?

    leccAuthor
    Visitor II
    October 29, 2025

    Hei Neil

    Thanks for the suggestion. I consider posting my question there as well.

    However I am not convinced, that the problem lies with J-Link. The J-Link I use works fine with 2 of 3 boards suggesting there is no issue with the J-Link or the associated tools.

    Are there any settings, registers, or something that might have been changed/reconfigured by initially using the STM32CubeIDE and ST-Link that could have changed the configuration of this MCU on the first board, making it different from the other two? Something that the ST-Link can handle either way, but prevents the J-Link from connecting properly...