Arm Mbed OS support forum

PyOCD deploy failed, deploying using mass storage device on Agora Board

Hi,
I’m using Mbed Studio: 1.2.1 on debian 10 and I have configured clangd with the one suppored in debian i.e. clangd-11 which seems that it seems that ti’s working in mbedstudio correctly.

I have also installed mbed-cli 1.10.4 with the following configuration:

[mbed] Global config:
ARM_PATH=/home/symeon/MyApps/ARMCompiler6.14.1/
TARGET=EP_AGORA
TOOLCHAIN=GCC_ARM
GCC_ARM_PATH=/home/symeon/MyApps/gcc-arm-none-eabi-9-2019-q4-major/bin

[mbed] Local config (/home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky):
TARGET=EP_AGORA
TARGET_CODE=2600
TARGET_SERIAL=2600360253274e450012800df7c3002fd811000097969900

I’m using the Agora board Agora Board which through “mbed detect” gives:

[mbed] Detected EP_AGORA, port /dev/ttyACM0, mounted /media/symeon/DAPLINK, interface version 0254:
[mbed] Supported toolchains for EP_AGORA
| Target   | mbed OS 2 | mbed OS 5 |    ARM    | uARM |  GCC_ARM  |    IAR    |
|----------|-----------|-----------|-----------|------|-----------|-----------|
| EP_AGORA |     -     | Supported | Supported |  -   | Supported | Supported |
Supported targets: 1
Supported toolchains: 3

I’ve tried to build the example from agora mbed-os-example-blinky through mbed-cli with the command mbed compile -m EP_AGORA -t GCC_ARM and it builds successfully.

I have tried to do the same thing with Mbed Studio with the default compiler, debug profile and Run, but I received the error:

PyOCD deploy failed, deploying using mass storage device…
Request deploy failed with message: Failed to flash the device using mass storage, please check the logs for more information

I have tried to change the compiler to GCC_ARM as it works with mbed-cli by using external-tools.json in .config folder:

{
“bundled”: {
“gcc”: “/home/symeon/MyApps/gcc-arm-none-eabi-9-2019-q4-major/bin”
},
“defaultToolchain”: “GCC_ARM”
}

However I receive again the same error. I checked the logs and I have the following:

[2020-10-02T20:51:20.857] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: RUN_SESSION, update: true []
[2020-10-02T20:51:20.858] [INFO] root/mbs-core - Determining program buttons status: {“BUILD”:{“type”:“BUILD”,“typeString”:“BUILD”,“isDisabled”:true,“tooltip”:“Run in progress”},“DEBUG”:{“type”:“DEBUG”,“typeString”:“DEBUG”,“isDisabled”:true,“tooltip”:“Run in progress”},“RUN”:{“type”:“RUN”,“typeString”:“RUN”,“isDisabled”:true,“tooltip”:“Run in progress”}} []
[2020-10-02T20:51:20.889] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: BUILD_SESSION, update: true []
[2020-10-02T20:51:20.889] [INFO] root/mbs-core - Determining program buttons status: {“BUILD”:{“type”:“BUILD”,“typeString”:“BUILD”,“isDisabled”:true,“tooltip”:“Build in progress”},“DEBUG”:{“type”:“DEBUG”,“typeString”:“DEBUG”,“isDisabled”:true,“tooltip”:“Build in progress”},“RUN”:{“type”:“RUN”,“typeString”:“RUN”,“isDisabled”:true,“tooltip”:“Build in progress”}} []
[2020-10-02T20:51:20.890] [INFO] root/mbs-build - Started Building mbed-os-example-blinky at file:///home/symeon/Mbed%20Programs/EmbeddedPlannet/mbed-os-example-blinky, targeting EP_AGORA []
[2020-10-02T20:51:20.892] [INFO] root/mbs-build - Building program at file:///home/symeon/Mbed%20Programs/EmbeddedPlannet/mbed-os-example-blinky with program name of mbed-os-example-blinky []
[2020-10-02T20:51:20.901] [INFO] root/mbs-build - BUILD OPTIONS: /home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/python -u,/home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky/mbed-os/tools/make.py,–profile,/home/symeon/.config/Mbed Studio/programs/mbed-os-example-blinky_1402099737/profile.json,–tool,GCC_ARM,–mcu,EP_AGORA,–source,.,–build,BUILD/EP_AGORA/GCC_ARM []
[2020-10-02T20:51:20.902] [DEBUG] root/process - Starting raw process: /home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/python, with args: -u /home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky/mbed-os/tools/make.py --profile /home/symeon/.config/Mbed Studio/programs/mbed-os-example-blinky_1402099737/profile.json --tool GCC_ARM --mcu EP_AGORA --source . --build BUILD/EP_AGORA/GCC_ARM, with options: {“cwd”:"/home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky",“env”:{“PATH”:"/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/python:/home/symeon/MyApps/gcc-arm-none-eabi-9-2019-q4-major/bin"}} []
[2020-10-02T20:51:22.861] [WARN] MbedStudio - Widget was activated, but did not accept focus after 2000ms: outputView []
[2020-10-02T20:51:27.680] [DEBUG] root/process - Process 13940 has exited with code 0. [ ‘/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/python’,
[ ‘-u’,
‘/home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky/mbed-os/tools/make.py’,
‘–profile’,
‘/home/symeon/.config/Mbed Studio/programs/mbed-os-example-blinky_1402099737/profile.json’,
‘–tool’,
‘GCC_ARM’,
‘–mcu’,
‘EP_AGORA’,
‘–source’,
‘.’,
‘–build’,
‘BUILD/EP_AGORA/GCC_ARM’ ] ]
[2020-10-02T20:51:27.680] [DEBUG] root/process - Unregistering process. [ID: 85] []
[2020-10-02T20:51:27.680] [DEBUG] root/process - The process was successfully unregistered. [ID: 85] []
[2020-10-02T20:51:27.690] [INFO] root/mbs-build - Build of mbed-os-example-blinky completed: Program compiled []
[2020-10-02T20:51:27.691] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: BUILD_SESSION, update: false []
[2020-10-02T20:51:27.692] [INFO] root/mbs-core - Determining program buttons status: {“BUILD”:{“type”:“BUILD”,“typeString”:“BUILD”,“isDisabled”:true,“tooltip”:“Run in progress”},“DEBUG”:{“type”:“DEBUG”,“typeString”:“DEBUG”,“isDisabled”:true,“tooltip”:“Run in progress”},“RUN”:{“type”:“RUN”,“typeString”:“RUN”,“isDisabled”:true,“tooltip”:“Run in progress”}} []
[2020-10-02T20:51:27.694] [INFO] root/mbs-deploy - CURRENT_TARGET_KEY: EP_AGORA []
[2020-10-02T20:51:27.709] [INFO] root/mbs-deploy - flash --uid 2600360253274e450012800df7c3002fd811000097969900 --target nrf52840 --erase=chip /home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM/mbed-os-example-blinky.hex []
[2020-10-02T20:51:27.710] [DEBUG] root/process - Starting raw process: /home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/pyocd, with args: flash --uid 2600360253274e450012800df7c3002fd811000097969900 --target nrf52840 --erase=chip /home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM/mbed-os-example-blinky.hex, with options: {“cwd”:"/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin"} []
[2020-10-02T20:51:28.986] [DEBUG] root/process - Process 13960 has exited with code 1. [ ‘/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/pyocd’,
[ ‘flash’,
‘–uid’,
‘2600360253274e450012800df7c3002fd811000097969900’,
‘–target’,
‘nrf52840’,
‘–erase=chip’,
‘/home/symeon/Mbed Programs/EmbeddedPlannet/mbed-os-example-blinky/BUILD/EP_AGORA/GCC_ARM/mbed-os-example-blinky.hex’ ] ]
[2020-10-02T20:51:28.986] [DEBUG] root/process - Unregistering process. [ID: 86] []
[2020-10-02T20:51:28.986] [DEBUG] root/process - The process was successfully unregistered. [ID: 86] []
[2020-10-02T20:51:28.987] [ERROR] root/mbs-deploy - 0001058:CRITICAL:main:No ACK received
Traceback (most recent call last):
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/cmsis_dap_probe.py”, line 249, in read_dp
result = self._link.read_reg(reg_id, now=now)
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 836, in read_reg
return read_reg_cb()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 830, in read_reg_cb
res = transfer.get_result()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 143, in get_result
self.daplink.flush()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/utility/concurrency.py”, line 28, in _locking
return func(self, *args, **kwargs)
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 667, in flush
self._read_packet()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/utility/concurrency.py”, line 28, in _locking
return func(self, *args, **kwargs)
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py”, line 915, in _read_packet
decoded_data = cmd.decode_data(raw_data)
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/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/.config/Mbed Studio/mbed-studio-tools/python/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/.config/Mbed Studio/mbed-studio-tools/python/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/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/main.py”, line 362, in run
self._COMMANDSself._args.cmd
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/main.py”, line 520, in do_flash
with session:
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/core/session.py”, line 302, in enter
self.open()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/core/session.py”, line 420, in open
self._board.init()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/board/board.py”, line 85, in init
self.target.init()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/core/coresight_target.py”, line 160, in init
seq.invoke()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/utility/sequencer.py”, line 213, in invoke
resultSequence.invoke()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/utility/sequencer.py”, line 208, in invoke
resultSequence = call()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/dap.py”, line 303, in _connect
connector.connect(self._protocol)
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/dap.py”, line 167, in connect
self._idr = self.read_idr()
File “/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/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/.config/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/cmsis_dap_probe.py”, line 251, in read_dp
six.raise_from(self._convert_exception(error), error)
File “”, line 3, in raise_from
pyocd.core.exceptions.TransferError: No ACK received
[]
[2020-10-02T20:51:28.987] [ERROR] MbedStudio - Request deploy failed with error: PyOCD failed to flash the device, please check the logs for more information [ ‘Error: PyOCD failed to flash the device, please check the logs for more information\n at PyocdDeployer. (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/pyocd-deployer.js:166:31)\n at step (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/pyocd-deployer.js:59:23)\n at Object.throw (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/pyocd-deployer.js:40:53)\n at rejected (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/pyocd-deployer.js:32:65)’ ]
[2020-10-02T20:51:29.001] [DEBUG] root/process - Starting raw process: /home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls, with args: --json, with options: {“cwd”:"/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin"} []
[2020-10-02T20:51:29.002] [INFO] root/mbs-deploy - PyOCD deploy failed, deploying using mass storage device… []
[2020-10-02T20:51:29.205] [DEBUG] root/process - Process 13972 has exited with code 1. [ ‘/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls’,
[ ‘–json’ ] ]
[2020-10-02T20:51:29.206] [DEBUG] root/process - Unregistering process. [ID: 87] []
[2020-10-02T20:51:29.206] [DEBUG] root/process - The process was successfully unregistered. [ID: 87] []
[2020-10-02T20:51:29.315] [DEBUG] root/process - Starting raw process: /home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls, with args: --json, with options: {“cwd”:"/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin"} []
[2020-10-02T20:51:29.532] [DEBUG] root/process - Process 13977 has exited with code 1. [ ‘/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls’,
[ ‘–json’ ] ]
-----------similar from 87-148-----------
[2020-10-02T20:51:48.930] [DEBUG] root/process - Process 14240 has exited with code 1. [ ‘/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls’,
[ ‘–json’ ] ]
[2020-10-02T20:51:48.931] [DEBUG] root/process - Unregistering process. [ID: 148] []
[2020-10-02T20:51:48.931] [DEBUG] root/process - The process was successfully unregistered. [ID: 148] []
[2020-10-02T20:51:48.994] [ERROR] root/mbs-deploy - Error: Unable to determine how to run for this device.
at FilecopyDeployer. (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:71:31)
at step (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:48:23)
at Object.next (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:29:53)
at /tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:23:71
at new Promise ()
at __awaiter (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:19:12)
at FilecopyDeployer.deploy (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:65:16)
at ElectronDeployService. (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:91:64)
at step (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:49:23)
at Object.next (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:30:53)
at fulfilled (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:21:58) []
[2020-10-02T20:51:48.995] [ERROR] MbedStudio - Request deploy failed with error: Failed to flash the device using mass storage, please check the logs for more information [ ‘Error: Failed to flash the device using mass storage, please check the logs for more information\n at FilecopyDeployer. (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:87:27)\n at step (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:48:23)\n at Object.next (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:29:53)\n at /tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:23:71\n at new Promise ()\n at __awaiter (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:19:12)\n at FilecopyDeployer.deploy (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/deployers/filecopy-deployer.js:65:16)\n at ElectronDeployService. (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:91:64)\n at step (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:49:23)\n at Object.next (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:30:53)\n at fulfilled (/tmp/.mount_mbed-sGkZYMy/resources/app/node_modules/@mbed/mbs-deploy/lib/backend-electron/electron-deploy-service.js:21:58)’ ]
[2020-10-02T20:51:49.003] [INFO] root/mbs-deploy - Request deploy failed with message: Failed to flash the device using mass storage, please check the logs for more information []
[2020-10-02T20:51:49.004] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: RUN_SESSION, update: false []
[2020-10-02T20:51:49.004] [INFO] root/mbs-core - Determining program buttons status: {“BUILD”:{“type”:“BUILD”,“typeString”:“BUILD”,“isDisabled”:false,“tooltip”:“Build program”},“DEBUG”:{“type”:“DEBUG”,“typeString”:“DEBUG”,“isDisabled”:false,“tooltip”:“Debug program”},“RUN”:{“type”:“RUN”,“typeString”:“RUN”,“isDisabled”:false,“tooltip”:“Run program”}} []
[2020-10-02T20:51:49.038] [DEBUG] root/process - Starting raw process: /home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls, with args: --json, with options: {“cwd”:"/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin"} []
[2020-10-02T20:51:49.269] [DEBUG] root/process - Process 14244 has exited with code 1. [ ‘/home/symeon/.config/Mbed Studio/mbed-studio-tools/python/bin/mbedls’,
[ ‘–json’ ] ]
[2020-10-02T20:51:49.269] [DEBUG] root/process - Unregistering process. [ID: 149] []
[2020-10-02T20:51:49.269] [DEBUG] root/process - The process was successfully unregistered. [ID: 149] []

Any suggestions?

Hello Symeon,

Mbed Studio doesn’t support debugging on all Mbed enabled boards . To check the list visit https://os.mbed.com/platforms, roll down and turn on the “Mbed Studio: Debug” filter. If your board is not supported yet then you can try OpenOCD and QtCreator.

Best regards, Zoltan

Hi @hudakz

I did it and it is supported Agora Product Development Kit

Do you have another recommendations?

Sorry, I’m afraid I don’t have any other advice for you.