Go Down

Topic: Protecting AVR from beeing read (Read 249 times) previous topic - next topic

sakugava

I use an USBAsp with Arduino IDE. Can I modify the avrdude.conf so that the lock bits would be programmed together with the skatch. I mean in the memory lock section:

    memory "lock"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
                          "x x x x  x x x x   x x o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
                          "x x x x  x x x x   1 1 i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;


I want to lock the AVR chip to be read from external programmer. I´m using Atmega1284P.

CrossRoads

Set the lock bits in the boards.txt file and reburn the bootloader, that should set the lock bits.
Or try Nick Gammon's fuse calculator program.
http://www.gammon.com.au/forum/?id=11653
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.

sakugava

I´m not using a bootloader. I´m using USBasp. In boards.txt there´s only options to bootloader.

DrAzzy

That's fine, burn bootloader can be used to just set fuses and lock bits. you can also do it through extreme burner avr with the asp.
ATtiny core for 841+1634+828  http://goo.gl/6fRf8e
ATtiny core for x4/x5/x61/x7/x8 series http://goo.gl/O5Wtyu
ATtiny 841/1634/828/88/861/167 breakouts, mosfets, touch sensors and prototyping board in my store http://goo.gl/xyUN2v

tf68

You have to set the flash lock bits after you have uploaded your program.

platform.txt about line 88.
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" "-U lock:w:0x3c:h"

Add the highlighted text to the above line in your platform.txt file. Untested but should work.

sakugava

Thank you very much. Worked, but I had to change to "-Ulock:w:0x3c:m".
BTW, now Platform.txt is located in "C:\Program Files (x86)\Arduino\hardware\arduino\avr" (Arduino 1.6.4). In older version it was located in "...\Sketchbook\Hardware\(board)\avr". Is that right?

Go Up