ARMmbed/mbed-tools

Auto-select image extension to flash based on `OUTPUT_EXT`

LDong-Arm opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

(Related to #279)

By default, the f/--flash option of mbed-tools compile assumes the image extension to be bin unless --hex-file is specified. But some targets (e.g NRF52_DK) only support the hex format, and only a hex image is built (#216) as per the OUTPUT_HEX configuration in Mbed OS.

It makes sense for mbed-tools's flash option to automatically select the hex image in this case too. As mbed-tools already parses targets.json, this should be doable.

Describe the solution you'd like

mbed-tools compile -t GCC_ARM -m NRF52_DK -f

flashes the hex image instead of showing the error "Build program file (firmware) not found".

Describe alternatives you've considered
The existing --hex-file option works, but it is not convenient especially for automated tests.

Additional context
Add any other context or screenshots about the feature request here.

This was fixed by #290