ARMmbed/mbed-tools

Flash option does not work on NRF52840_DK

noonfom opened this issue · 5 comments

Describe the bug
The flash option does not work on NRF52840_DK as mbedtools looks for
a bin and the output extension is hex (mbed-os/targets/targets.json#L5924).

To Reproduce
Steps to reproduce the behavior:

  1. Build an Mbed OS application and append the flash option:

    mbedtools compile -t <toolchain> -m NRF52840_DK --flash
  2. The resulting error is shown:

    ERROR: Build program file (firmware) not found <app>/cmake_build/NRF52840_DK/develop/<toolchain>/<app>.bin
  3. The workaround is to create the bin from the elf using objcopy and rerun the command. Of course, you can also manually copy the hex to DAPLINK.

Expected behavior
On NRF52840_DK, look for a hex not a bin.

Desktop (please complete the following information):

  • OS: Ubuntu Linux
  • Version: 20.04

Mbed (please complete the following information):

  • Device: NRF52840_DK
  • Mbed OS Version: 6.10.0
  • Mbed CLI 2 Version: 7.10

Additional context
None

Thanks for the report.

Does it work if you append the --hex-file flag? The full command would be: mbedtools compile -t <toolchain> -m NRF52840_DK --flash --hex-file

Let us know if it still fails with the --hex-file flag added and we can look into it. Thanks!

Thanks Rob. It works with --hex-file .

Auto-selection of image format should be implementable, I've created #281 as a reminder.

@noonfom We fixed this in #290. If you upgrade mbed-tools to the latest, image format detection becomes automatic and --hex-file doesn't exist anymore.

Thanks @LDong-Arm. That's a very useful feature.