IP protection in AVR

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

Hi guys,

I'm making an expensive device powered by an atmega32. I'd like to give potential customers the option of trying it before paying for it in full. After, say, 10 reboots in demo mode it will hang unless the user enters a code.

To do this, the unlock code and countdown timer stored in flash must be protected. And the counter must be altered for each demo mode reboot. Is that possible with the fuses of the AVR? Which memory would be best to use for this purpose?

Obviously, the application both before and after an unlock must be protected, too.

I'm using a bootloader today so that it's possible to put protection features both there and in the actual application.

Thanks,
Borge

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

Set the lockbits so external flash reading is not possible then use SPM to count down a counter in flash at the end of the app flash at each bootloader start then have it refuse to enter the app when the count is zero.

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

Thanks! So what you say is that I should let the bootloader do the counting?

That is neat. That way code entering is done in BL space, not in app space. As an added feature I'd want the bootloader to also request a key in order to write in new app code.

I'd like the app to be field upgradeable but not the BL. Not even with access to the ISP header.

Børge

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

Is there a convenient way to assign a flash page or address to PROGMEM? I'd like to reserve the area for the down counter both in my application an in the bootloader, so that the BL doesn't overwrite actual application code.

My application needs eeprom R/W and PROGMEM R. The bootloader (except for the down counter) needs neither.

The application's use of IO pins means JTAG is disabled. I take it I must also disable SPI in order to protect the down counter.

Thanks,
Børge

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

As PROGMEM is located between .vectors and .text you don't want to use that. Instead do something like:

__attribute__((section(".mycount"))) uint8_t count = 10;

and

-Wl,-section-start=.mycount=0x7800