Asked by Vijaylaxmi on 2017-03-22

in my make file i am trying to convert the bin to chex file.

        $(CHEX): $(BINARY)
 @echo "unsigned char M4_binary[] = {" > $(CHEX)
 bin2chex cortex_m4.bin >> $(CHEX)
 @echo "};" >> $(CHEX)

GCC main.c
/opt/toolchain/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -g -T cortex_m4.ld -Map vectors.o main.o iomux-v3.o timer.o uart.o -o cortex_m4.elf
arm-none-eabi-objcopy -O binary cortex_m4.elf cortex_m4.bin
bin2chex cortex_m4.bin >> ~/imx6/SX/diag-obds_sdb/src/mx6slx/m4_bin.h
/bin/sh: 1: bin2chex: not found
make: *** [/home/vrk/imx6/SX/diag-obds_sdb/src/mx6slx/m4_bin.h] Error 127

I am unable to fix the /bin/sh: 1: bin2chex: not found error.
bin2chex command does not exist ?

Question information

English Edit question
GNU Arm Embedded Toolchain Edit question
No assignee Edit question
Last query:
Last reply:

Hi Vijaylaxmi,

There seems to be a typo in your Makefile, it says bin2chex but I believe it should be bin2hex.

Best regards.

Vijaylaxmi (viju) said : #2

Hi Thomas ,

I tried with bin2hex. But I get the same error,

/bin/sh: 1: bin2hex: not found

Hi Vijaylaxmi,

Objcopy should be able to convert a bin file to an hex file: something along the line of objcopy -I binary -O ihex filename.bin filename.hex.

Best regards.

Can you help with this problem?

Provide an answer of your own, or ask Vijaylaxmi for more information if necessary.

To post a message you must log in.