This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot able to communicate with external target

Hi,

I am trying to flash one external module which is actually a BLE having (NRF52832) and I am using NRF52832 Development board. By doing all the necessary connections and using the DC power supply and setting the current and voltage to 11mA and 3.7V respectively. While running I am getting this error 

Connecting ‘J-Link’ using ‘USB’

Loaded /Applications/SEGGER Embedded Studio for ARM 7.22/bin/libjlinkarm.dylib

Firmware Version: J-Link OB-nRF5340-NordicSemi compiled Nov 7 2022 16:22:01

DLL Version: 7.88c

Hardware Version: V1.00

Target Voltage: 3.300

Device "NRF52832_XXAA" selected.

Current Speed: 2000 kHz

InitTarget() start

InitTarget() end - Took 102ms

Failed to attach to CPU. Trying connect under reset.

InitTarget() start

InitTarget() end - Took 106ms

Failed to connect to target.

Please help me. What steps do I need to follow now. I am getting stucked  

Parents
  • Hi,

     

    Kushagra12 said:

    Loaded C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 7.22/bin/JLink_x64.dll
    Firmware Version: J-Link OB-nRF5340-NordicSemi compiled Nov 7 2022 16:22:01
    DLL Version: 7.88m
    Hardware Version: V1.00
    Target Voltage: 3.300
    Device "NRF52832_XXAA" selected.
    Current Speed: 2000 kHz
    InitTarget() start
    InitTarget() end - Took 2.41ms
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x02880000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID 00000000 PID 00000000 ???
    [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    [0][5]: E0041000 CID B105900D PID 000BB925 ETM

    This is a good indication, as the debugger is able to read out the cpu core information.

     

    Kushagra12 said:
    sorry for the delay when I am running the nrf--jprog  in terminal.. I am getting this

    oh, it seems the family is not correct.

    Could you try this?

    nrfjprog --recover -f nrf52

     

    If it does not work, please add the "--log" to the above nrfjprog command and attach the generated "log.log" file.

     

    Kind regards,

    Håkon

  • hello sir,

    I did run nrfjprog --recover -f nrf52 --log and got this

    C:\Users\admin>nrfjprog --recover -f nrf52 --log
    Recovering device. This operation might take 30s.
    ERROR: [ JLink] - DAP error while reading AIRCR.
    ERROR: [SeggerBackend] - JLinkARM.dll WriteU32 returned error -1.
    ERROR: [SeggerBackend] - JLinkARM.dll WriteU32 returned error -1.
    ERROR: [SeggerBackend] - JLinkARM.dll WriteU32 returned error -1.
    Erasing user code and UICR flash areas.
    ERROR: [SeggerBackend] - JLinkARM.dll ReadMemU32 detected a read error 1.
    ERROR: [SeggerBackend] - This typically indicates the read was blocked by a memory protection mechanism.

    then I run this code nrfjprog --eraseall -f nrf52 and got this

    C:\Users\admin>nrfjprog --eraseall -f nrf52
    Erasing user available code and UICR flash areas.
    Applying system reset.

    after that I again run that code nrfjprog --recover -f nrf52 and got this

    C:\Users\admin>nrfjprog --recover -f nrf52
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.

    after that I tried to (flash) the program in segger embedded and got this

    Preparing target for download
    Executing Reset script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘s132_nrf52_6.1.1_softdevice.hex’ to J-Link
    Programming 2.7 KB of addresses 00000000 — 00000aff
    Programming 144.3 KB of addresses 00001000 — 0002514f
    Failed to preserve target RAM @ 0x20000000-0x2000FFFF.
    Failed to prepare for programming.
    Download failed

    and lastly the log file give this

    C:\Users\admin>nrfjprog --recover -f nrf52 --log
    Recovering device. This operation might take 30s.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    Erasing user code and UICR flash areas.
    ERROR: [SeggerBackend] - JLinkARM.dll WriteU32 returned error -1.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".

    please give your inputs what needs to be done. Thanks for giving your time.

    kind regards,

    Kushagra Agarwal

  • Hi,

     

    Could you try to adjust the SWD speed to for instance 125 kHz?

    That is done in the project settings in SES:

     

    And with nrfjprog, you can add the -c 125 switch:

    nrfjprog --recover -f nrf52 -c 125

     You can also flash via nrfjprog if you want:

    nrfjprog --program <hex file> --verify -f nrf52 --sectorerase

     

    Kind regards,

    Håkon

  • Hi,

    after adjusting the SWD speed to 125 kHz and running the code nrfjprog --recover -f nrf52 -c 125 I got this

    C:\Users\admin>nrfjprog --recover -f nrf52 -c 125
    ERROR: Unable to connect to a debugger.
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.

    and after flashing the program

    Current Speed: 125 kHz
    InitTarget() start
    InitTarget() end - Took 136ms
    InitTarget() start
    InitTarget() end - Took 136ms
    Failed to connect to target.

    and I am also attaching the log file. Please have a look

    C:\Users\admin>nrfjprog --recover -f nrf52 -c 125 --log
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: Unable to connect to a debugger.
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.

    C:\Users\admin>

     

    please suggest.

    Kind regards

    Kushagra

  • Hi,

     

    Can you attach the .log file?

    Do all your devices behave like this?

     

    Given that the debugger provides generic errors, it can indicate a hardware-wise connection problem between the debugger and the nRF.

     

    Kind regards,

    Håkon

Reply Children
No Data
Related