1

I have a HEX file for my application on dsPIC33, now I want to send the file over to microcontroller via serially.

As the HEX file generated by the compiler are intel hex format, I tried to convert it to binary with arm-none-eabi-objcopy, which, as expected does not work.

Is there any tool to convert HEX or ELF files to raw binary for dsPIC33?

Mike
  • 4,041
  • 6
  • 20
  • 37
RishabhHardas
  • 495
  • 1
  • 5
  • 25
  • 1
    The most flexible albeit with a bit of a learning curve, collection of tools IMHO is http://srecord.sourceforge.net/ . The [GNUmake Table Toolkit](https://github.com/markpiffer/gmtt) can serve as a complement, closing the gap between configuration data regarding memory ranges, vector tables etc. and the pre- and post-processing of microcontroller binaries. – Vroomfondel Nov 22 '19 at 14:14
  • I had created a binary file with srec_cat command but it appends some additional bytes in the binary, maybe I had some incorrect options or I had done something incorrectly. I'll study the links that you mentioned. Thank you! – RishabhHardas Nov 23 '19 at 13:30

2 Answers2

1

You could use the MPLAx IPE.

When you load your .hex file and bulid an environment you will get an .bin file,

Mike
  • 4,041
  • 6
  • 20
  • 37
  • What do you mean by building an environment ? – RishabhHardas Nov 21 '19 at 07:45
  • Just have a look at the MPLABx IPE. There ist a button Ènviroment`to save the firware e.g. on a SD card. Pretty easy to use. – Mike Nov 21 '19 at 09:06
  • My version of MPLAB IPE has an option to export the hex file only. I'll check if there is a newer version available. – RishabhHardas Nov 22 '19 at 04:12
  • Every version of the IPE could manage it. Just click huge button on the left side `Environment`. The one with the globe symbol. – Mike Nov 22 '19 at 06:26
  • Yes it does! Thanks a lot @Mike! – RishabhHardas Nov 22 '19 at 07:39
  • I can do it with the GUI now and it does not need a Programmer attached. But, when I try to do it with ipecmd.jar with -B switch, it throws a message, 'Programmer not found', any way to do this without a programmer? – RishabhHardas Mar 05 '20 at 09:23
0

So I have to look through/read .hex files on occasion, much easier when they are in .bin. If you have a linux host, install hex2bin, and then just simply execute "./hex2bin <filename.hex>", then use something like GHex to read through the file.

bmaggs
  • 1