[ABANDONED] J-link seems to have a problem with Cortex-M0 at SWD

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] J-link seems to have a problem with Cortex-M0 at SWD

    Hello,
    in deepest despair I would like to ask you for help. I have J-link EDU and I am developing some automotive circuit, where I need CAN.

    I used to work with arm7tdmi (In my opinion the best ARM) and cortex-r4 on JTAG interface with j-link with no problem. But the market has changed. Therefore, I am forced to use Cortex-M0 in my design.

    So, I made circuit with STM32F043F6, then I connected it via SWD.

    See, what happens:

    Source Code

    1. SEGGER J-Link Commander V6.30b (Compiled Feb 2 2018 18:37:08)
    2. DLL version V6.30b, compiled Feb 2 2018 18:36:54
    3. Connecting to J-Link via USB...O.K.
    4. Firmware: J-Link V9 compiled Mar 2 2018 17:07:57
    5. Hardware version: V9.30
    6. S/N: 26930XXXX
    7. License(s): FlashBP, GDB
    8. OEM: SEGGER-EDU
    9. VTref = 3.396V
    10. Type "connect" to establish a target connection, '?' for help
    11. J-Link>connect
    12. Please specify device / core. <Default>: LPC11C14/301
    13. Type '?' for selection dialog
    14. Device>?
    15. Please specify target interface:
    16. J) JTAG (Default)
    17. S) SWD
    18. TIF>s
    19. Specify target interface speed [kHz]. <Default>: 4000 kHz
    20. Speed>
    21. Device "STM32F042F6" selected.
    22. Connecting to target via SWD
    23. Found SW-DP with ID 0x0BB11477
    24. STM32 (connect): Can not attach to CPU. Trying connect under reset.
    25. Found SW-DP with ID 0x0BB11477
    26. Found SW-DP with ID 0x0BB11477
    27. STM32 (connect): Can not attach to CPU. Trying connect under reset.
    28. Found SW-DP with ID 0x0BB11477
    29. ****** Error: STM32: Connecting to CPU via connect under reset failed.
    30. Found SW-DP with ID 0x0BB11477
    31. STM32 (connect): Can not attach to CPU. Trying connect under reset.
    32. Found SW-DP with ID 0x0BB11477
    33. Found SW-DP with ID 0x0BB11477
    34. STM32 (connect): Can not attach to CPU. Trying connect under reset.
    35. Found SW-DP with ID 0x0BB11477
    36. ****** Error: STM32: Connecting to CPU via connect under reset failed.
    37. Cannot connect to target.
    38. J-Link>
    Display All


    Lowering speed does not help. Nothing does not help. Hardware is ok, I am 100% sure, I was checking it infinite times.
    Strange is, that the SW-DP with Cortex-M0 is found! The same behaviour with BOOT0 high/low.

    So, I said, ok,flush ST. I bought NXP LPC11C14 hoping that everything will be ok with it. But see this:

    Source Code

    1. SEGGER J-Link Commander V6.30b (Compiled Feb 2 2018 18:37:08)
    2. DLL version V6.30b, compiled Feb 2 2018 18:36:54
    3. Connecting to J-Link via USB...O.K.
    4. Firmware: J-Link V9 compiled Mar 2 2018 17:07:57
    5. Hardware version: V9.30
    6. S/N: 26930XXXX
    7. License(s): FlashBP, GDB
    8. OEM: SEGGER-EDU
    9. VTref = 3.377V
    10. Type "connect" to establish a target connection, '?' for help
    11. J-Link>connect
    12. Please specify device / core. <Default>: LPC11C14/301
    13. Type '?' for selection dialog
    14. Device>
    15. Please specify target interface:
    16. J) JTAG (Default)
    17. S) SWD
    18. TIF>s
    19. Specify target interface speed [kHz]. <Default>: 4000 kHz
    20. Speed>
    21. Device "LPC11C14/301" selected.
    22. Connecting to target via SWD
    23. Found SW-DP with ID 0x0BB11477
    24. Found SW-DP with ID 0x0BB11477
    25. ****** Error: DAP error while reading DP-Ctrl-Stat register.
    26. Found SW-DP with ID 0x0BB11477
    27. Found SW-DP with ID 0x0BB11477
    28. Cannot connect to target.
    29. J-Link>
    Display All


    I am getting absolutely crazy about this.
    Don't you have a problem with cortex-m0' that you do not know about? ?(

    I have a Keil uvision 5. There it is the same, in debug options I am trying everything - connect under reset, SWD speed tuning etc. and only output is Can not connect to target.

    Thank you
    Milan

    The post was edited 2 times, last by mrkvo ().

  • Hello Milan,

    Thank you for your inquiry.
    Such an issue is not known to us.
    You wrote that you use a STM32F043F6. Is this a typo and you meant 042 instead? I ask because we could not find any documentation about a 043 device by ST.
    Are you using custom hardware or an eval board?
    What happens if you select generic Cortex-M0 instead of the specific device name. Does connect work then?

    Regarding the LPC. We tried to reproduce the issue with a LPC1114 on a MCB1000 eval board and connect was working just fine. Successful connect sequence is attached.
    Are you using custom hardware or an eval board?
    You seem to be using an older software version. Does updating to the latest version change the behaviour?

    Don't you have a problem with cortex-m0' that you do not know about? ?(

    We are not aware of any issues with Cortex-M0. Most of our customers use various Cortex-M0 chips and have no issues with it.

    Best regards,
    Nino
    Images
    • Capture.PNG

      32.04 kB, 677×594, viewed 85 times
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us

  • "You wrote that you use a STM32F043F6. Is this a typo and you meant 042 instead?"

    Yes, I am sorry. STM32F042F6.

    This IC I have on temporary solder prototyping board, 20pin TSSOP is not difficult to wire. There are only 2 power supply pins and one ground. It is weird that the STM32F042F6 runs normally when it is in bootloader mode (BOOT0 high). DP DM and GND pins are connected to PC and the Windows Devices list shows ST device in DFU mode. Also DFU uploader is working.

    That shows the IC is properly powered, etc. When I change pin BOOT0 to not run the bootloader, the SWD connection unsuccessful as I described before (NOTE: In bootloader mode SWD connection is also unsuccessful, but I think it is expected). I am sure that when trying to connect it via SWD I am not in bootloader mode, because the IC's USB does shows ST device in DFU mode in Windows Devices list.

    But, back to LPC11C14 (I have it also on temporary solder prototyping board).
    Updating to version V6.30g does not help. Selecting Cortex-M0 is without effect.

    Source Code

    1. SEGGER J-Link Commander V6.30g (Compiled Mar 12 2018 17:22:23)
    2. DLL version V6.30g, compiled Mar 12 2018 17:22:05
    3. Connecting to J-Link via USB...O.K.
    4. Firmware: J-Link V9 compiled Mar 2 2018 17:07:57
    5. Hardware version: V9.30
    6. S/N: 26930XXXX
    7. License(s): FlashBP, GDB
    8. OEM: SEGGER-EDU
    9. VTref = 3.335V
    10. Type "connect" to establish a target connection, '?' for help
    11. J-Link>connect
    12. Please specify device / core. <Default>: LPC11C14/301
    13. Type '?' for selection dialog
    14. Device>?
    15. Please specify target interface:
    16. J) JTAG (Default)
    17. S) SWD
    18. TIF>s
    19. Specify target interface speed [kHz]. <Default>: 4000 kHz
    20. Speed>1000
    21. Device "CORTEX-M0" selected.
    22. Connecting to target via SWD
    23. Found SW-DP with ID 0x0BB11477
    24. Found SW-DP with ID 0x0BB11477
    25. ****** Error: DAP error while reading DP-Ctrl-Stat register.
    26. Found SW-DP with ID 0x0BB11477
    27. Found SW-DP with ID 0x0BB11477
    28. Cannot connect to target.
    29. J-Link>
    Display All


    I completely do not understand, if there is ID 0x0BB11477 found, why the connection flow stops. Power, XTAL, grounding - everything seems to be ok. When I disconnect for ex. SWDIO connection, nothing is found and it says Cannot connect to target only. If the programmer is able to read "such a difficult and valid hex value", why the connection is unsuccessful? I do not know what should block it. nRESET I have tested and it is working. I used manual toggling (r0 and r1 commands) and just at the LQFP leg at the correct pin is the right voltage.

    It is totally crazy that I tried 2 ICs from different manufacturers and the issue is absolutely the same.

    But if you say, you and others had no problems I will give up and i will try another manufacturer and core because of time pressure. Last idea I have is that maybe I have somehow my J-link partially blown. But, when I connect TMS570LS3137 on JTAG, everything is fine.

    It really seems there is problem at my side, but I had no greater mystery in past 10 years.

    Thank you
    Milan

    The post was edited 1 time, last by mrkvo ().

  • Hello Milan,

    Yes, I am sorry. STM32F042F6.

    Ok, we retested with a STM32F042_Nucleo eval board. Attached is the successful connect with the on board J-Link.
    We suggest comparing that hardware design and see if you have missed some mandatory components for external debug probes to work.
    Last time we had a customer with a not working ST custom board it was due to some capacitor that was mandatory and he forgot to mount.

    The same suggestion goes for the NXP chip. What is different in the MCB1000 eval board schematics compared to your design in regards to debug interface and chip wiring.
    Generally we suggest first getting a running setup with an affordable eval board and then use this base design for your own hardware.

    Last idea I have is that maybe I have somehow my J-link partially blown. But, when I connect TMS570LS3137 on JTAG, everything is fine.

    It is possible that the J-Link is defective, but then on the other hand connect through JTAG would usually also not work. To rule this out we suggest measuring the SWDIO and SWCLK pins with an oscilloscope to see if they reach their expected voltage levels of 0 V and 3.3 V respectively.

    Best regards,
    Nino
    Images
    • Capture.PNG

      31.08 kB, 677×558, viewed 87 times
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support contact us per e-mail.
    The following contact form can be used for this: Contact Us