neyimvarki
neyimvarki

Reputation: 29

How to convert C source code to intel .HEX file

I want to change the devices start logo. I placed my logo in 0x00060000-0x0007FFFF address range, it's 128kb. I am using this online tool for resizing, formatting and for generating array.

https://notisrac.github.io/FileToCArray/

https://github.com/notisrac/FileToCArray?tab=readme-ov-file

Is it possible to generate intel .hex file without local compile? Or what is the best way? I wrote a gui for logo update. Giving start address and gui writes over USB.

I've said, end user will change the logo without compiling, Please look at this video. Anybody will change the logo. He/She is a dummy, just have a picture. I am asking, how can I do that?

I am already changing logos via compiling with two different project. And changing .HEX files SEGGER J-Flash Edit->Relocate and Edit->Delete range. I don't want to this.

note: I am using CMAKE for compiling.

Thanks already, sincerely.

Upvotes: 0

Views: 118

Answers (1)

Tom V
Tom V

Reputation: 5510

The command you want is:

objcopy -I binary -O ihex --change-addresses 0x12345678 input.bin output.hex

Several comments are suggesting extra software you could install, but since you mention gcc you must already have objcopy installed. If you invoke your gcc as (for example) arm-none-eabi-gcc then you might need to use arm-none-eabi-objcopy, but any version of objcopy will produce the same output.

Upvotes: 2

Related Questions