question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Target type is nrf52840 No ACK received

See original GitHub issue

Hi,

I’m using the Agora board Agora Board. I’m trying to setup the Mbed Studio: 1.2.1 on debian 10, however I receive the error “PyOCD deploy failed, deploying using mass storage device on Agora Board”. Some info on the issue I have written on Mbed Studio

My System has the following setup:

gcc-arm-none-eabi-9-2019-q4-major
debian 10 
mbed 1.10.4
pyocd 0.28.1

I have been checking around trying to understand the error, and it seems that the pyocd cannot connect to my device. By executing pyocd list I receive:

0 ep_agora [nrf52840] 2600360253274e450012800df7c3002fd811000097969900

However when I’m using pyocd erase -t nrf52840 --chip or pyocd flash -t nrf52840 mbed-os-example-blinky.hex

I receive:

0000581:CRITICAL:__main__:No ACK received
Traceback (most recent call last):
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/cmsis_dap_probe.py", line 250, in read_dp
    result = self._link.read_reg(reg_id, now=now)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 839, in read_reg
    return read_reg_cb()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 833, in read_reg_cb
    res = transfer.get_result()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 143, in get_result
    self.daplink.flush()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/utility/concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 667, in flush
    self._read_packet()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/utility/concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 918, in _read_packet
    decoded_data = cmd.decode_data(raw_data)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 449, in decode_data
    data = self._decode_transfer_block_data(data)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 418, in _decode_transfer_block_data
    self._check_response(data[3])
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 341, in _check_response
    raise DAPAccessIntf.TransferError("No ACK received")
pyocd.probe.pydapaccess.dap_access_api.DAPAccessIntf.TransferError: No ACK received

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/__main__.py", line 398, in run
    self._COMMANDS[self._args.cmd](self)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/__main__.py", line 568, in do_flash
    with session:
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/core/session.py", line 343, in __enter__
    self.open()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/core/session.py", line 461, in open
    self._board.init()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/board/board.py", line 85, in init
    self.target.init()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/core/soc_target.py", line 120, in init
    seq.invoke()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/utility/sequencer.py", line 213, in invoke
    resultSequence.invoke()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/utility/sequencer.py", line 208, in invoke
    resultSequence = call()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/coresight/dap.py", line 303, in _connect
    connector.connect(self._protocol)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/coresight/dap.py", line 167, in connect
    self._idr = self.read_idr()
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/coresight/dap.py", line 194, in read_idr
    dpidr = self._probe.read_dp(DP_IDR, now=True)
  File "/home/symeon/.local/lib/python3.7/site-packages/pyocd/probe/cmsis_dap_probe.py", line 252, in read_dp
    six.raise_from(self._convert_exception(error), error)
  File "<string>", line 3, in raise_from
pyocd.core.exceptions.TransferError: No ACK received

Any suggestions?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
symeonmattescommented, Oct 10, 2020

Hi @flit,

You said:

This most often means that the device is asleep. Please make sure you are using a debug build of your code that disables sleep.

To be honest I’m not sure what it means what you said. I done the following steps:

  1. git clone git@github.com:ARMmbed/mbed-os-example-blinky.git
  2. mbed compile -m EP_AGORA -t GCC_ARM --flash This compiles the software and flashes it onto the board correctly…it led is blinking for some seconds and then stops
  3. I just want to do debugging, i.e. from an IDE put a breakpoint and see what I have in the env variables.
  4. I have tried diffferent IDEs with no success, and in all I have receiving that PYOCD No ACK received. That’s why I have tried to find why pyocd is as such.

I have tried the

You might try change to the under-reset connect mode by passing --connect=under-reset on the command line. This only works if the MCU has a hardware nRESET signal. It forces the device to wake by reset as pyOCD connects.

So I run

pyocd erase -t nrf52840 --chip --connect=under-reset
pyocd flash -t nrf52840 mbed-os-example-blinky.hex --connect=under-reset

But again I receive the same error.

Thanks

1reaction
symeonmattescommented, Oct 9, 2020

Hi,

I have some more logs in case they are useful:

In https://github.com/pyocd/pyOCD/blob/master/udev/README.md. it says about some dev rules that could help although they are installed automatically by pyocd. I have run dmesg, as requested and when plug in the board I receive:

[ 4208.436839] usb 2-2: new full-speed USB device number 4 using xhci_hcd
[ 4208.591366] usb 2-2: New USB device found, idVendor=0d28, idProduct=0204, bcdDevice=10.00
[ 4208.591370] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4208.591373] usb 2-2: Product: DAPLink CMSIS-DAP
[ 4208.591375] usb 2-2: Manufacturer: ARM
[ 4208.591377] usb 2-2: SerialNumber: 2600360253274e450012800df7c3002fd811000097969900
[ 4208.593844] usb-storage 2-2:1.0: USB Mass Storage device detected
[ 4208.594181] scsi host3: usb-storage 2-2:1.0
[ 4208.594831] cdc_acm 2-2:1.1: ttyACM0: USB ACM device
[ 4208.598358] hid-generic 0003:0D28:0204.0003: hiddev0,hidraw0: USB HID v1.00 Device [ARM DAPLink CMSIS-DAP] on usb-0000:00:14.0-2/input3
[ 4209.613609] scsi 3:0:0:0: Direct-Access     MBED     VFS              0.1  PQ: 0 ANSI: 2
[ 4209.614268] sd 3:0:0:0: Attached scsi generic sg2 type 0
[ 4209.614425] sd 3:0:0:0: [sdb] 131200 512-byte logical blocks: (67.2 MB/64.1 MiB)
[ 4209.614598] sd 3:0:0:0: [sdb] Write Protect is off
[ 4209.614600] sd 3:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 4209.614766] sd 3:0:0:0: [sdb] No Caching mode page found
[ 4209.614771] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 4209.627580]  sdb:
[ 4209.628714] sd 3:0:0:0: [sdb] Attached SCSI removable disk

I checked a little bit the code of pyocd on the line that I receive the error of “No ACK received” and I receive the error on “~/.local/lib/python3.7/site-packages/pyocd/probe/cmsis_dap_probe.py”

    def read_dp(self, addr, now=True):
        reg_id = self.REG_ADDR_TO_ID_MAP[self.DP, addr] # it gives REG.DP_0x0
        try:
            result = self._link.read_reg(reg_id, now=now) # here is the error

It seems as if there is no communication with the board.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to program a blank nrf52840 - Nordic Q&A
- I'm applying 5v to the VDDH, I get 1.8v out at the VDD. - The P0.18 pin is pulled high but I...
Read more >
FAQs | Introducing the Adafruit nRF52840 Feather
Timed out waiting for acknowledgement from device. Failed to upgrade target. Error is: No data received on serial port. Not able to proceed....
Read more >
PyOCD deploy failed, deploying using mass storage device ...
However I receive again the same error. ... --target nrf52840 --erase=chip /home/symeon/Mbed ... TransferError: No ACK received.
Read more >
otCoapResponseHandler: Who frees the otMessage?
The only thing I can think of is my response handler not ... there is a failure to send (e.g. due to no...
Read more >
Flashing NRF using pyOCD - MicroPython Forum (Archive)
I also tried changing the target to nrf52840 and nrf52 and using a .hex ... and never get any errors, but not a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found