ARMmbed / mbed-cli

Arm Mbed Command Line Interface
https://os.mbed.com
Apache License 2.0
334 stars 176 forks source link

mbed compile --flash does not respect 'artifact_name' #993

Open jmanning2k opened 3 years ago

jmanning2k commented 3 years ago

When using mbed compile --flash, it uses the default binary name for flashing (the parent directory) instead of the one given by the mbed_app.json parameter artifact_name. It correctly generates a binary with the artifact_name during linking.

mbed --version: 1.10.5

mbed_app.json: { artifact_name: "bar", ... }

mbed compile --flash output:

Building project bar (UBLOX_EVK_ODIN_W2, GCC_ARM)
Scan: foo-cwd
Link: bar
Elf2Bin: bar
...
Image: ./BUILD/UBLOX_EVK_ODIN_W2/GCC_ARM/bar.bin
[mbed] ERROR: Build program file (firmware) not found "./BUILD/UBLOX_EVK_ODIN_W2/GCC_ARM/foo-cwd.bin"

Where foo-cwd is the parent directory name and the default name, and bar is the name given by artifact_name in mbed_app.json.

jmanning2k commented 3 years ago

Appending artifact-name as an explicit command line arg works.

mbed compile --flash --artifact-name bar

So this issue is that the value in mbed_app.json is not overriding artifact-name when building the fw_name for this phase.