Go Down

Topic: locking code into a board? (Read 481 times) previous topic - next topic

Dilithium

Hi,

I didn't know quite how to word this, but...

As every Arduino has a way of writing to the board, I assume there's a way of taking that code back off again?
If an Arduino is the heart, and used to sell a product, what is stopping a suitably-skilled person uploading new code to the board or, even worse, downloading your code from the board and seeing what/how you have done it?

Is there a way to upload once and then freeze the board from any further up/downloading of the content?

Thanks.

Robin2

All you can download from an Arduino is the HEX code that the compiler produced. It would be very difficult (like impossible) to re-construct the source code from that. Of course the unchanged HEX code could be uploaded to another Arduino.

It is possible to set some of the Atmega fuse bytes so that the HEX code cannot be downloaded.

There is little you can do to prevent someone overwriting a program if they are determined to do so, You could make it difficult for a novice by removing the bootloader and using ICSP to program your chip.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Dilithium

Thanks Robin. I was thinking quite a way into the future. I didn't know if using an off-the-shelf Arduino was a viable way to sell a product or if it is (primarily) used as a prototype? Then if the product becomes a sell-able thing, the hardware shifts to a more permanent solution of dedicated PCB's and chips, etc?

Forgive my lack of knowledge. Never really tackled anything like this before, but I'm learning loads and it's good to have something working I can actually use at the end of it.

Thanks again.

CrossRoads

Prototype with Arduino, then create your own custom board based around the processor in use and other features you want.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Robin2

Then if the product becomes a sell-able thing, the hardware shifts to a more permanent solution of dedicated PCB's and chips, etc?
The comments I made in Reply #1 really apply to the Atmega microprocessor rather than the to Arduino board. so they will also apply if you move to a custom PCB.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Dilithium


larryd

"Is there a way to upload once and then freeze the board from any further up/downloading of the content?"

What makes you think your code cannot be duplicated by another software person?


.
No technical PMs.
The last thing you did is where you should start looking.

CrossRoads

You can use the lock bits and prevent code access or uploads. 
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Dilithium

"Is there a way to upload once and then freeze the board from any further up/downloading of the content?"

What makes you think your code cannot be duplicated by another software person?


.
I don't. It, undoubtedly can... and probably better than my attempt. However, I'd rather someone do their own version from scratch, than use mine as a starting point, then change the bits they don't like. I'm a very long way of producing anything commercial. It was just a passing, "What if?" thought.

I see all these wonderful things that people are making and think, "Is there still an Arduino in the middle of all that or is it a custom chip/PCB/motherboard/whatever the correct terminology is?"

CrossRoads

WHEN IS THE FORUM LOSING POSTS GONNA BE FIXED!  Just lost another length reply when I forgot to copy it before hitting Post.  Damn!

"I see all these wonderful things that people are making and think, "Is there still an Arduino in the middle of all that ...?"

Like this one?
Can see the resemblance to a Promino crossed with an Duemilanove at the lower left (SMD processer and support parts with FTDI header, and ICSP header and thru hole crystal) with other stuff incorporated - dual displays driven by shift registers, rotary encoder, buttons, different regulators, and fully buffered SD socket, ending with target headers for burning fuses and loading bootloader and/or sketches onto other boards. 
Nick Gammon's code idea, http://www.gammon.com.au/uploader
my hardware idea, http://www.crossroadsfencing.com/BobuinoRev17/
for something to take to the field for reprogramming devices without needing to take a laptop, and easier to implement then something flash-drive based.




Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

"what is stopping a suitably-skilled person uploading new code to the board"
Nothing. A High Voltage Programmer can be used to erase your fuses and code, then same and/or new fuses written along with a new sketch. It is not that hard even to remove & replace the chip. Several chip types often use the same footprint, with 'later' chips having more features (timers for example) or bigger memory.   Look at Arduno's own evolution from Atmega8 (8K flash) to Atmega168 (16K flash) to Atmega328P (32K flash.  If Atmel made a '648P, you could drop that in as well.
They do make a '644; its a 40-pn DIP or 44-PIN TQFP, with 12 more IO.  The 1284P, with twice the memory, a 2nd hardware serial port, and 16K SRAM, double the 8K found in the 100-pin '2560, is the basis of many of my designs, like this Duemilanove-like design (FTDI chip for USB vs an Uno's 16U2 for USB).






January 2011, one of the very first:

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Robin2

However, I'd rather someone do their own version from scratch, than use mine as a starting point, then change the bits they don't like.
The entire edifice of computing is based on people adapting and extending other people's code. Don't try to buck the trend :)

Incidentally that is also how evolution works :)

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Delta_G

This is an open source community.  Others improving on your code is a GOOD thing.  It ends up making the code better.  It's not stealing.  It's open source.  That's what this community is all about.  Using this community for help and then keeping your code all secret pretty much makes you either a profiteering scumbag OR just plain dumb if the product isn't commercial. 

What, are you scared someone will judge you by some poorly written section of code?  Don't be.  Someone might fix it and you might learn something and get better.  Or are you afraid that your code might show up in some proprietary commercial product?  Don't worry, just stick a license on it that forbids such things. 
If at first you don't succeed, up - home - sudo - enter.

AWOL

Incidentally that is also how evolution works :)
Obligatory "Other belief-systems are available.". :D
"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.

Robin2

Obligatory "Other belief-systems are available.". :D
LOL

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up