This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

convert object file to hex?

Hi all

I am working on STM32F030R8 chip,using Keil MDK. For every unit, it carries it own characteristics, and hence for every calibrated unit, I need to re-flash a part of the flash to put the characteristic in.

For example, the characteristics is an array of bytes, so I create a characteristic.c file to put the data at specific location: (0x0800F000)

const unsigned char array[] __attribute__(at(0x0800F000)) = {1, 2, 3, 4, 5, 6} ;

The compiler will generates object file: characteristic.o

Now the question is, how can I get this object file converted to a hex file, that I can just page flash into the target? I think there should have simple command from the MDK suite.

Thanks

Calvin

Parents
  • I suspect you don't know the full implications of what your asking.

    Converting an object file to a hex file is not normally a requirement. Object files normally contain (at least some) relocatable items that are resolved during the link.

    If it really is complex, then another alternative might be to link your module into a dummy executable, create a hex file from that fully linked executable and then extract the portion that interests you.

Reply
  • I suspect you don't know the full implications of what your asking.

    Converting an object file to a hex file is not normally a requirement. Object files normally contain (at least some) relocatable items that are resolved during the link.

    If it really is complex, then another alternative might be to link your module into a dummy executable, create a hex file from that fully linked executable and then extract the portion that interests you.

Children