[SOLVED] High current consumption after programming

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

  • [SOLVED] High current consumption after programming

    Hi,

    We have been using the J-Link-OB-SAM3U128 on the Nordic NR51-DK (pca10028) from some time now. We've always programmed our targets with the easy to use drag-and-drop feature.
    Our target is a NRF51422_QFAC (the same as the NRF51-DK).

    Recently we moved to a J-Link Base and execute the following script to update our targets with JLinkExe:

    Source Code

    1. loadfile <target hex file>
    2. r
    3. g

    This loads our hex file into the target, NORMAL resets the MCU and sets to cpu to a running state.

    This looks pretty simple but we have recently come across a major issue.
    When programmed with the script above the MCU stays in a high current consumption after disconnecting the programmer. We’ve measured around 1.2mA continuous current. When programmed through drag-and-drop, our consumption is normal which is around 10uA.
    The high current consumption disappears after removing the power to the MCU, waiting some time and reapplying the power.
    It seems like something in the MCU stays active after programming our target.

    My question is: what does the drag-and-drop feature do apart from target programming, resetting and go?
  • It seems like the SWD interface stays active. For the NRF51 the reset pin is shared with the SWDIO. Trying to hard reset the target with the reset pin fails when the device current consumption is high. This might be because the SWD interface is still active. Hard resetting the target when the device is operating normally works as expected.
    Is there a way to stop the SWD interface on the target MCU? Seems like the drag-and-drop feature has a way to do this.
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    Which J-Link software version are you using for your setup?
    Does using the latest release change the behaviour?
    Could you provide us with an example application for the PCA10028 eval board where this issue is reproducible with?
    Do you get the same behaviour when using J-Link Commander with the J-Link OB and loadfile instead of drag-and-drop?

    Best regards,
    Nino
    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.
    Alternatively our support ticketing system can be used as well: segger.com/ticket/
  • Hi Nino,

    Thank you for your response.
    We're using the following setup:
    - Mac OS high sierra
    - J-Link Software and Documentation Pack v6.32f (also tried v6.32)

    Tested on the following programmers:
    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 12 2018 16:05:20
    Hardware: V1.00
    And:
    Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
    Hardware: V10.10

    I've tested it with an example application from the nordic SDK:
    nRF5_SDK_11.0.0_89a8197/examples/ble_peripheral/ble_app_beacon
    I've attached a version for the PCA10028: ble_app_beacon_s130_pca10028.hex.zip

    Result with drag-and-drop:


    Result with scripting:



    Also with our own application after programming:




    Very strange behaviour, it seems to be related with SWD that keeps being active.
  • Well... I've found the solution: devzone.nordicsemi.com/f/nordi…equivalent-using-jlinkexe
    It is a bit of an ugly hack to switch to JTAG and use the TMS and TCK as toggle pins to initiate a reset.
    Is there a better way to accomplish this?

    EDIT:
    This is mostly a ugly hack because of when switching to JTAG, JLink tries to connect to the nrf51422_xxac target which fails:


    Source Code

    1. Connecting to target via SWD
    2. Found SW-DP with ID 0x0BB11477
    3. Scanning AP map to find all available APs
    4. AP[1]: Stopped AP scan as end of AP map has been reached
    5. AP[0]: AHB-AP (IDR: 0x04770021)
    6. Iterating through AP map to find AHB-AP to use
    7. AP[0]: Core found
    8. AP[0]: AHB-AP ROM base: 0xF0000000
    9. CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
    10. Found Cortex-M0 r0p0, Little endian.
    11. FPUnit: 4 code (BP) slots and 0 literal slots
    12. CoreSight components:
    13. ROMTbl[0] @ F0000000
    14. ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB471 ROM Table
    15. ROMTbl[1] @ E00FF000
    16. ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    17. ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    18. ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    19. ROMTbl[0][1]: F0002000, CID: B105900D, PID: 000BB9A3 ???
    20. Cortex-M0 identified.
    21. Downloading file [/Users/melvinvandenberg/Downloads/firmware.hex]...
    22. Comparing flash [100%] Done.
    23. Verifying flash [100%] Done.
    24. J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    25. O.K.
    26. J-Link>w4 40000544 1
    27. Writing 00000001 -> 40000544
    28. J-Link>si 0
    29. Disconnecting from J-Link...O.K.
    30. Selecting JTAG as current target interface.
    31. Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    32. JTAGConf>tck0
    33. ERROR while parsing value for IRPre. Using default: -1.
    34. ERROR while parsing value for DRPre. Using default: -1.
    35. Device "NRF51422_XXAC" selected.
    36. Connecting to target via JTAG
    37. TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    38. TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    39. TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    40. TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    41. Cannot connect to target.
    42. J-Link>t0
    43. J-Link>t1
    Display All
    Is there a way to disconnect from the target?
    When I restart JLinkExe and execute "si 0" and "tck0" it works fine because it isn't connected to any target.

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

  • Hello,

    melvinvandenberg wrote:

    Is there a better way to accomplish this?
    A JLinkScript file can be used for this. More information can be found in the J-Link user guide (UM08001).

    Best regards,
    Nino
    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.
    Alternatively our support ticketing system can be used as well: segger.com/ticket/