[SOLVED] SWD connect fails on PSoC in low-power mode

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

  • [SOLVED] SWD connect fails on PSoC in low-power mode

    PSoCs have a mode where the SWD interface is enabled only in RESET mode; in order to reduce the power consumption.
    Cypress call this "SWD in GPIO mode", check in the PSoC Creator IDE under System tab.

    However it seems that JLink does not support a connect-under-RESET for PSoC devices.
    When in SWD-GPIO mode, JLink can't connect at all, actually it does not even detect the SWD interface.

    Trying to change rsettype to 3 returns an UNKNOWN type, and does not solve the problem.

    Also, programming the PSoC with Cypress SWD programmer works without problem.

    Device used : CYBL10461-56LQXI (PRoC with BLE) / can be tested with Cypress dev boards as well.
    JLink version : V510i

    Thanks,
    Florent
  • Hi Florent,


    sorry for the delay in response.
    Could you point me to the section of the reference manual where this type of low power mode is described?
    "SWD in GPIO mode" gives no results except this forum, and I can not find any similar term in the Cypress manuals.

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Florent,


    thanks for the information.
    Could you provide us with an example project for reproduction purposes?

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Niklas,
    this issue is not be related to a specific project.

    Just open any sample PSoC BLE project from Cypress in PSoC Creator, make the change SWD > GPIO as stated in AN92584, and that should do it.
    Once the PSoC is flashed, JLink won't be able to connect to it again.

    Florent
  • Hi Florent,

    I just flashed a compiled .elf file of a BLE example with J-Link Debugger.
    I could start/halt/reset the target without any problem using J-Link Commander.

    Did you use the Project -> Export to IDE feature of PSoC Creator or did you download the application using Cypress SWD programmer / J-Link manually and tried to use J-Link afterwards?

    Which example did you use?

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • No, you don't need to export the code to another IDE to reproduce the problem. I used only JLink to flash the .hex files and the issue is reproduced.

    I tried with BLE_Battery_Level example. Check the attachement. Note that if you don't switch the SWD interface into GPIO mode, the issue is not present.
    I also attached the .hex file with SWD in GPIO mode, you can also generate it with the IDE (in CortexM0\ARM_GCC_493\Debug\BLE_Battery_Level.hex).

    I use the Cypress BLE Pionneer Kit, and I use the black daughter board (PRoC / CYBL10563), but the bug has been reproduced with other boards / devices as well (CYBL10461).
    In JLink Commander : device CYBL10XXX, then I manually select SWD interface at default speed.
    You can erase / loadfile BLE_Battery_Level.hex, but once done, JLink is unable to re-connect :
    - directly on the Pionneer Kit board, it displays "WARNING: RESET (pin 15) high but should be low" and then ultimately "Can not connect to target".
    - using the daughter board directly connected to JLink with some wires, when trying "connect" it just displays "Can not connect to target". With an oscilloscope we can see that JLink switches RESET pin high / low / high / low serveral times but that doesn't help. I think you need to have the RESET pin being low for some time before the SWD interface is enabled (and obviously if at any time during connecting JLink switch the RESET to high, the SWD interface will be disabled immediately).
    - typing r0 in JLink Commander does switch RESET to low, but as soon as we try "connect", JLink switches the RESET pin back to high , which disables the SWD interface and prevents JLink from connecting.

    As JLink can't be used anymore, you need to use the Cypress SWD Programmed (integrated on the Cypress BLE Pionneer Kit main board) to flash the MCU again.

    Florent
    Files

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

  • Hi Florent,


    confirmed with BLE_Battery_Level.hex.
    We will take a look at it tomorrow.
    Thanks for your detailed information regarding this issue.

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Florent,


    we fixed this issue in our internal version of the J-Link software.
    Fixing this issue requires to do some changes to functions which are frequently used in the J-Link software, therefore we will take the time necessary to implement the best solution and to do some testing.
    A fixed version will be available presumably after embedded World 2016.


    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Florent,


    this issue will be fixed in the upcoming version 5.10p of the J-Link software & documentation pack.

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link
  • Hi Florent,

    thanks for providing feedback.
    Good to hear it is working four you now.
    This thread will be marked [SOLVED] .

    Best regards,
    Niklas
    Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
    Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
    Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
    Notification for Embedded Studio: Link