This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

STLINK-V2 -> ChipID = 0 / timed out while waiting for target halted

I'm beginner with nrf chips.

I have a custom board with ntf52840 module. I connect board to stlink via swd interface, then check:

st-info --probe
Found 1 stlink programmers
 serial: 2c38010032124353354b4e00
openocd: "\x2c\x38\x01\x00\x32\x12\x43\x53\x35\x4b\x4e\x00"
  flash: 0 (pagesize: 0)
   sram: 0
 chipid: 0x0000
  descr: unknown device

openocd -f /usr/share/openocd/scripts/interface/stlink-v2.cfg -f /usr/share/openocd/scripts/target/nrf52.cfg -d2

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
    openocd.org/.../bugs.html
debug_level: 2
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 10000 kHz
Info : Unable to match requested speed 10000 kHz, using 4000 kHz
Info : Unable to match requested speed 10000 kHz, using 4000 kHz
Info : clock speed 4000 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.167187
Info : nrf52.cpu: hardware has 0 breakpoints, 2 watchpoints

telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> init
> reset halt
timed out while waiting for target halted
TARGET: nrf52.cpu - Not halted
in procedure 'reset'
in procedure 'ocd_bouncer'


Something wrong?

Parents Reply Children
  • that problem solved.

    /usr/local/bin/openocd -f $(OPENOCD_HOME)/interface/stlink-dap.cfg -f $(OPENOCD_HOME)/target/nrf52.cfg

    and

    >dap apreg 1 0x04 0x01

    unlocking chip.

    And next. Chip is 52840

    I download SDK nrf5_SDK_for_Mesh_v4.2.0_src.

    Then upload softdevice: s140_nrf52_6.0.0_softdevice.hex (or s140_nrf52_7.0.1_softdevice.hex)

    and demo: blinky_nrf52840_xxAA_s140_6.0.0.hex (or blinky_nrf52840_xxAA_s140_7.0.1.hex)

    by:

    write_blinky600:
        $(OCD) -c init -c "reset halt" -c "flash write_image $(BLINKY_FILE_140_600)" -c "flash write_image $(BLINKY_FILE_140_600)" -c reset -c exit

    write_blinky701:
        $(OCD) -c init -c "reset halt" -c "flash write_image $(SOFTDEV_140_701)" -c "flash write_image $(BLINKY_FILE_140_701)" -c reset -c exit

    Output log:

    Open On-Chip Debugger 0.10.0+dev-01321-ge8cfdd4a-dirty (2020-07-10-11:52)
    Licensed under GNU GPL v2
    For bug reports, read
        openocd.org/.../bugs.html
    Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

    nRF52 device has a CTRL-AP dedicated to recover the device from AP lock.
    A high level adapter (like a ST-Link) you are currently using cannot access
    the CTRL-AP so 'nrf52_recover' command will not work.
    Do not enable UICR APPROTECT.

    Info : clock speed 1000 kHz
    Info : STLINK V2J29S7 (API v2) VID:PID 0483:3748
    Info : Target voltage: 3.176563
    Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : starting gdb server for nrf52.cpu on 3333
    Info : Listening on port 3333 for gdb connections
    target halted due to debug-request, current mode: Thread
    xPSR: 0x01000000 pc: 0x00000880 msp: 0x20000400
    Info : nRF52840-xxAA(build code: C0) 1024kB Flash, 256kB RAM
    Warn : Flash protection of this nRF device is not supported
    wrote 1656 bytes from file /home/shubin/electronic/firmware/nrf/nrf5_SDK_for_Mesh_v4.2.0_src/bin/blinky/blinky_nrf52840_xxAA_s140_6.0.0.hex in 0.097093s (16.656 KiB/s)

    wrote 1656 bytes from file /home/shubin/electronic/firmware/nrf/nrf5_SDK_for_Mesh_v4.2.0_src/bin/blinky/blinky_nrf52840_xxAA_s140_6.0.0.hex in 0.091625s (17.650 KiB/s)

    Looking for device at nRF Blinky Android software. Nothing found

    Led not blinked.

    One time, i don't remember, what combination was used, the diode began to blink with a frequency of 2 Hz, but device scanner nothing found.

Related