Attiny lock bits to prevent firmware from being read

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I am using the ATTINY2313, and I read in the datasheet that I can program the lock bits to prevent my firmware from being read, thus protecting my firmware.

 

Basically, I want to program the LB2 and LB1 bits so that " Further reading and programming of Flash and EEPROM is disabled in parallel and serial programming mode. Fuse bits are locked in both serial and parallel programming mode."

 

My questions:

 

1) Does the above also mean that my firmware won't be able to access the statically declared data via PROGMEM during runtime?

 

2) And, if my firmware reads/writes the EEPROM internally, this will disabled as well, again, during runtime?

 

3) I should be still able to use the /RESET pin to reset the ATTINY?

 

Thank you!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, your program will still run, in all of its glory. Yes, reset will still function. 

 

But once you have programmed those bits, no more debugging. When you try to read memory contents via serial or parallel programmer, you get bogus values back. You also cannot change the fuse bits. Thats it.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can set those bits but I can pay $500 and get them unlocked so don't trust your entire IPR to $500's worth of silliness.
.
Besides in just 2K of code I'd suggest you almost certainly cant be doing anything THAT clever that I can't simply make a "workalike" simply by observibg the inter-relation of your inputs and outputs simply by viewing the chip as a "black box" using an analyser!

Last Edited: Sun. Oct 21, 2018 - 06:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
You can set those bits but I can pay $500 and get them unlocked so don't trust your entire IPR to $500's worth of silliness. . Besides in just 2K of code I'd suggest you almost certainly cant be doing anything THAT clever that I can't simply make a "workalike" simply by observibg the inter-relation of your inputs and outputs simply by viewing the chip as a "black box" using an analyser!

 

You should send your answer to Microchip!  It does what it does, and I take whatever it can do.  No fuzz there!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

unebonnevie wrote:
You should send your answer to Microchip! It does what it does, and I take whatever it can do. No fuzz there!

You are missing the point of what Cliff is saying.  If someone WANTS your code, it wont cost much to get it.  And with 2k of code space is there really anything special going on that cannot be figured out?  Especially on a 2313.  Hmmmm, theres serial communications(USART), a few pushbuttons? Maybe an LCD of some sort?  An output relay or two?  Can be easily figured out with some simple observation.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
You are missing the point of what Cliff is saying.
+1

 

What I'm saying is don't rely too much on lockbits as they aern't really any form of protection. Sure it keeps out the nosey-parkers but if your AVR design is really the next great IPod or Alexa or something and it's commercially attractive for some unscrupulous manufacturer to make a "workalike" all they have to do is pay one of these Far Eastern "chipz crackz" sites $500 and they will deliver back the HEX code from your "locked" chip. So it's not really locked at all.

 

If you really do think you have designed the iPod or Echo Dot then you need to think of more secure ways to protect your design as $500 is "beer money" to the kind of people who might want to now make millions of these things for their own profit.

 

If it is simply "nosey parkers" then you are looking to keep out then go right ahead :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The bottom line is, use the lock bits to protect your code from prying eyes, but if someone wants it bad enough they can get it.

Your code will run just fine with lock bits set or not.

Have fun with your project and hope you sell a ton of them.

 

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274