Disable flash content download from Arduino Uno

Hi everyone,
I'd like to know if in avrdude could it be possible to disable download of flash memory content (-U flash:r:"c:/diag flash.bin":r) but always permit the upload of sketches (-U flash:w:diag.hex:i), maybe programming some kind of fuse.

Thanks a lot for the attention.

Take a look at the Lock Fuse section of the datasheet:
28.1 Program And Data Memory Lock Bits
The ATmega 48A/48PA provides two Lock bits and the ATmega88A/88PA/168A/168PA/328/328Pprovides six
Lock bits. These can be left unprogrammed (“1”) or can be programmed (“0”) to obtain the additional features
listed in Table 28-2. The Lock bits can only be erased to “1” with the Chip Erase command.
Mode 1, lock bits 1 1: No memory lock features enabled.
Mode 2, lock bits 1 0: Further programming of the Flash and EEPROM is disabled in Parallel and Serial Programming mode. The Fuse bits are locked in both Serial and Parallel Programming mode.(1)
Mode 3, lock bits 0 0: Further programming and verification of the Flash and EEPROM is disabled in Parallel and Serial Programming mode. The Boot Lock bits and Fuse bits are locked in both Serial and Parallel Programming mode.(1)
Notes:

  1. Program the Fuse bits and Boot Lock bits before programming the LB1 and LB2.
  2. “1” means unprogrammed, “0” means programmed

So, I'd read that as not being able to do what you suggested, as "no upload with verification" and "no upload and no verification" seem to be the lock choices.

Thanks so much for the fast answer CrossRoads!!
Pity that is impossible to do.

Thanks again!

actually its no problem to allow flashing programs via bootloader and yet prevent reading them. those fuse options refer to disabling isp and do not block self-program which is what bootloaders use.

And for ISP programming, you can just do no program no verify, since the chip erase cycle clears the lock bits.

for that matter simply writing 00 to the lock fuse regardless of the download method used will prevent reading. the only drawback is any bootloader will not work anymore. of course you can just reflash that again if needed. user code 100% protected.

Sigh...

I knew we were missing something...

See:

27.5 Boot Loader Lock Bits

Those allow you to control what the bootloader can read and write.

Those are separate from the lockbits which determine what ISP can read and write (and with ISP, you block that entirely by just setting the lockbits to 0, so they have to wipe the chip to do anything to it).

As an aside, consider whether anyone would be likely to bother even trying to extract your code - I think a lot of people have an inflated idea of the value of their own code. Of course, there are cases where you really do have good reason to keep people out of your device, sure - but I have seen a lot of people talking about protecting a program that other people wouldn't reuse even if it were open source.

DrAzzy:
Of course, there are cases where you really do have good reason to keep people out of your device, sure - but I have seen a lot of people talking about protecting a program that other people wouldn't reuse even if it were open source.

Gotta give you credit for that one! Pretty near 100%.