Well the .elf
file is the already linked binary, you should be able to use it with flasher software like openocd
etc.
If you want a hex
file then you can go to your <user home folder>/.platformio/platforms/sifive/builder/main.py
and replace this line by
target_buildprog = env.Alias("buildprog", target_hex, target_hex)
after recompilng there is a firmware.elf
and firmware.hex
file.
Alternatively you can invoke the objcopy
yourself in a shell in the directory where the firmware.elf
is.
<home folder>/.platformio/packages/toolchain-riscv/bin/riscv64-unknown-elf-objcopy -O ihex firmware.elf firmware.hex
(can also be used with -O binary
)
However I agree that it would be usefull to build this by default. You can open an issue at the repository for it.