PlatformIO Community

Export compiled hex file


#1

Hello,
I’m all new to platformio and I’d like to use it for my Arduino boards replacing the Arduino IDE.
Is it possible to export compiled binary hex files?
On Arduino I select Sketch > Export compiled Binary and I get 2 hex files, with and without bootloader.


#2

Hi,

Sure, check a hidden .pioenvs directory in the project.


#3

Thank you, I found the firmware.hex so I’m guessing that’s what I need.


#4

I just found the firmware.bin wtihout hex,How I need to setup ? Please tell me


#5

Whats your platformio.ini?


#6

[env:genericSTM32F103ZE]

platform = ststm32
framework = stm32cube
board = genericSTM32F103ZE
upload_speed = 115200
upload_port = COM4
upload_protocol =serial

It‘s my setup . I was generated success, but can’t find .hex file


#7

You’re right, by default they only build the .bin file. To change this, go into your PlatformIO folder (/home/<user>/.platform or C:\Users\<user>\.platform and open packages/ststm32/builder/main.py and change

    target_firm = env.ElfToBin(join("$BUILD_DIR", "${PROGNAME}"), target_elf)

to

    target_firm = env.ElfToHex(join("$BUILD_DIR", "${PROGNAME}"), target_elf)

and rebuild. The resulting hex file will be in .pioenvs/genericSTM32F103ZE/firmware.hex.

@ivankravets Maybe it’s good feature to be able to change what builder will be used via the platformio.ini?


#8

@Weeeendi please file a feature request here https://github.com/platformio/platform-ststm32/issues


#9

Thanks for your help,and I hope create this feature too.


#10

Thanks,But I also want to know why I choose serial upload failed.what differents have between

common ISP upload and using upload_protocol = serial in platformio.ini