can't unlock mega168 for bootloader write

Hi all,

 ./avrdude -B 5 -v -F -p atmega168 -P /dev/ttyACM0 -c stk500v2 -C avrdude.conf -U lock:w:0x3f:m

results in

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x3f != 0x0f
avrdude: verification error; content mismatch

Any ideas?

Thanks!

You need to use the chip erase command (avrdude command line option -e) to clear the lock bits - that is change the lock byte to 0xff.

thank you!