Skip to main content
Kavana shree
Associate III
August 20, 2018
Question

Can a hex file or a bin file be read back from the controller?

  • August 20, 2018
  • 2 replies
  • 799 views

Can a hex and bin files be generated from each other?

    This topic has been closed for replies.

    2 replies

    AvaTar
    Senior III
    August 20, 2018

    Not in a strict sense. After downloading it, it is not a HEX file anymore, just binary Flash contents.

    But yes, if no readout-protection is enabled, you can read it back, and save it to a file.

    Consult the help documentation of your toolchain.

    I think the ST-Link utility can do this as well.

    Tesla DeLorean
    Guru
    August 20, 2018

    .HEX .S19 or .BIN files can be used to describe the same data. The hex files tend to be larger, but can be sparse (not describe empty locations), and out-of-order.

    Several tools can convert between formats, ie BIN2HEX, HEX2BIN, SRECORDS, etc. The formats are not inherently complicated.

    ST-LINK and DFU tools can be used to pull the data from a device that isn't protected. STM32 CubeProgrammer GUI seems to lack the feature to save by command line version can.

    Keil debugger have SAVE command.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..