Go Down

Topic: Uploading binary code to Arduino (Read 5747 times) previous topic - next topic

shirad


Hello,

I would like to know if it is possible (and how?) to upload our code to Arduino in binary format instead of the source code?

This is to prevent illegal use and re-distribution of our proprietary libraries.

I know the whole purpose of Arduino is open source, but some parts of our code come from other implementations and we still would like to protect those parts.

I look forward to hearing from you.

Thanks.

berthfield

#1
Jan 17, 2015, 06:35 pm Last Edit: Jan 17, 2015, 06:42 pm by berthfield
Uploading raw binary files (hex) to Arduinos can be done through the command prompt. The actual commands depend on the Arduino board you are using.

What board and OS are you using?

From your post I gather that you want to distribute the hex files and have the end users upload it to their boards. Is that correct?

AWOL

Quote
I would like to know if it is possible (and how?) to upload our code to Arduino in binary format instead of the source code?
You never upload source to an Arduino, always compiled code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

shirad

Uploading raw binary files (hex) to Arduinos can be done through the command prompt. The actual commands depend on the Arduino board you are using.

What board and OS are you using?

From your post I gather that you want to distribute the hex files and have the end users upload it to their boards. Is that correct?

Hello,
Thanks for your reply. I have Arduino Uno. And yes, you are right regarding the hex files. End users are customers, partners, internal deployment team ... etc.

What is the command name, so I'd check its help and try it out?

Thanks.

shirad

You never upload source to an Arduino, always compiled code.
I know, I meant uploading the binary so we don't have to give the code to someone else to compile it and upload it to Arduino!

berthfield

Okay the command to use to upload the compiles hex file would be:

Code: [Select]
avrdude -c stk500v1 -P [com port] -p atmega328p -U flash:w:[Filename.hex]:i

Where [com port] and [Filename.hex] would be replaced with your com port and the name of your .hex file respectively. You can also get an explanation of the various switched that can be used with Avrdude by entering the command without switches on any computer with the IDE installed.

There is also a utility called xloader that should automate the process for you but I have not tried that so use at your own risk.

shirad

Okay the command to use to upload the compiles hex file would be:

Code: [Select]
avrdude -c stk500v1 -P [com port] -p atmega328p -U flash:w:[Filename.hex]:i

Where [com port] and [Filename.hex] would be replaced with your com port and the name of your .hex file respectively. You can also get an explanation of the various switched that can be used with Avrdude by entering the command without switches on any computer with the IDE installed.

There is also a utility called xloader that should automate the process for you but I have not tried that so use at your own risk.
Thanks!

marcwolf

I can see another advantage of this.

You have a web page for registered users. On this page there is a form showing the various safe parameters that can be changed.

The user enters the parameters and they are checked.. and if valid the server created a HEX file for that user. This can be downloaded to the user's browser and a preinstalled 'updater' will load the HEX on to the Arduino.

All very clean :)

Deepak_Kumar_K

Okay the command to use to upload the compiles hex file would be:

Code: [Select]
avrdude -c stk500v1 -P [com port] -p atmega328p -U flash:w:[Filename.hex]:i

Where [com port] and [Filename.hex] would be replaced with your com port and the name of your .hex file respectively. You can also get an explanation of the various switched that can be used with Avrdude by entering the command without switches on any computer with the IDE installed.

There is also a utility called xloader that should automate the process for you but I have not tried that so use at your own risk.
Hi,
I had a similar challenge and than ks for your help, but i got error  "AVR Part "ESP8266" not found " and gave me a list of boards supported. I couldn't find any ESP8266 boards.

Budvar10

The avrdude works just for AVR parts and the ESP8266 isn't AVR.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Go Up