Skip to main content
Associate II
Solved

Stm32CubeProgrammer file differences

 

Hello everyone,
I have a .hex and a .bin file that set an output to high/low on an STM32H745.

When I upload the .hex file, my project works correctly, but when I upload the .bin file, it doesn't work.

I'm sharing both files.
I can't figure out what I'm doing wrong. Can you help me?

    This topic has been closed for replies.
    TDK
    TDKBest answer

    The files have the same content. Are you perhaps uploading the BIN to a different address? Starting address in the HEX is 0x08100000 which is nonstandard. How are you booting into it?

    TDK_0-1741783695405.png

     

    Download and compare the contents of the flash after uploading each file. You're doing something differently.

    "If you feel a post has answered your question, please click ""Accept as Solution""."

    4 replies

    Andrew Neil
    Super User

    How were the two files generated?

    A .hex file can be sparse - ie, not contain data for every location - so check that your code doesn't rely on anything in those "unprogrammed" locations.

    You should still be able to debug the running code to see what's happening....

    You could try reading-back the complete flash in both cases, then comparing ...

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    TDK
    TDKBest answer

    The files have the same content. Are you perhaps uploading the BIN to a different address? Starting address in the HEX is 0x08100000 which is nonstandard. How are you booting into it?

    TDK_0-1741783695405.png

     

    Download and compare the contents of the flash after uploading each file. You're doing something differently.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Matt_Author
    Associate II

    Matt__0-1741783964284.png

    @Andrew Neil In STM32H745 mcu the codes of the M4 core start from 0x08100000 as standard. above I use these options to generate the bin file and hex file.

    @TDK I will now upload the file contents and test the comparison.

    Matt_Author
    Associate II

    @Andrew Neil , @TDK  
    Thank you very much for your help.
    I had a problem with my application that converts from bin to hex, so it was not working when I installed it.
    I also paid attention to the addressing event you mentioned. Since it is a bin file, the address information needs to be entered, for this, the “Start address” information must be entered from the “Erasing & Programming” section on the program.

    Matt__0-1741790575112.png