I created boot-loader code for reprogramming application section. I use Wiznet W5500 SPI to Ethernet chip, my goal is that only i can reprogram the device using LAN / WAN. The read write command is different from atmel's standard, so i assume that no one will know.
The problem is: How do i set the lock bits to prevent reading the application by ISP?
-
\$\begingroup\$ Security by obscurity is always a bad idea. There will always be someone to find out, if there is enough motivation. However, you might block the casual user. \$\endgroup\$the busybee– the busybee2020年12月17日 07:00:31 +00:00Commented Dec 17, 2020 at 7:00
1 Answer 1
Every AVR microcontroller has Lock-bits to protect the memory. From the datasheet: Atmega328P lock bits And if you're using 'ProgIsp' programmer, simply click the button like the following image: ProgIsp Then, set two lock bits to 0 and press the write button: Fuse bits By doing this, you can not read the flash and EEPROM but you will be able to re-flash the chip. However, every time you re-flash the chip, lock bits will be set to 1 again and you need to lock it after flashing.
-
\$\begingroup\$ if i set the lock bits (LB1 & LB2 to zero), will i be able to rewrite the application section again in the future using my bootloader which i have stored in the chip? \$\endgroup\$kejuqeju– kejuqeju2020年12月13日 08:31:44 +00:00Commented Dec 13, 2020 at 8:31
-
1\$\begingroup\$ Only with full chip erase. So not with bootloader. \$\endgroup\$Saadat– Saadat2020年12月13日 09:05:15 +00:00Commented Dec 13, 2020 at 9:05