0

I have a hex file of a sketch i.e. sketchname.ino.hex. Can I find out anything from that hex file ? Can I see the output or anything ? Can I upload it on arduino ?

1
  • Not really... I mean, if it was mission-critical there might be a way, but in general the effort to do so would be more than simply rewriting the program.
    – SDsolar
    Jun 17, 2017 at 15:26

1 Answer 1

0

I have a hex file of a sketch i.e. sketchname.ino.hex. Can I find out anything from that hex file ?

That is a binary image of the compiled sketch in a hexadecimal notation. You could spend hours disassembling it if you understood the right tools to use.

Can I see the output or anything ?

You can convert it back to a crude form of assembly language maybe, but that is all. Understanding what that means takes skill and knowledge.

Can I upload it on arduino ?

Sure. It's a compiled program ready to be uploaded to an Arduino.

avrdude -D -patmega328p -PCOM3 -b115200 -C/path/to/avrdude.conf -c arduino -Uflash:w:sketchname.ino.hex:i
11
  • Thanks, I just few queries regarding uploading the code. I have Arduino Uno and Due so how do I change the command for them and will it harm the Arduino ? And how can I find what the code is doing after uploading it ? Jun 17, 2017 at 12:09
  • Arduino and Due use completely different programs, and the entire systems are completely different. You can only upload the HEX to the chip it was compiled for.
    – Majenko
    Jun 17, 2017 at 12:20
  • How will I verify for which system is it for. I have few lines of hex code only. Jun 17, 2017 at 13:44
  • You won't. You'd need to see the source and know what the compilation options were when compiling.
    – Majenko
    Jun 17, 2017 at 13:46
  • 1
    No. Now you need to learn assembly language. Welcome to the world of real embedded system programming.
    – Majenko
    Jun 17, 2017 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.