Trinket m0 Intellectual Property Protection

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
Serifin
 
Posts: 2
Joined: Sun Jan 28, 2024 1:32 pm

Trinket m0 Intellectual Property Protection

Post by Serifin »

Hello,
I have been working on a project that requires intellectual property protection to be in place. I checked the data sheet for the samd21 chip and it happens to have an Intellectual Property Protection system that can be accessed. This is done by setting the NVMCTRL security bit. This sets a security bit in the CTRLA register. This is done by writing to the CMDEX and CMD registers.

I have a few questions that I have been having trouble finding the answer to, and I’m hoping I can get some guidance or answers here.

1.)Is there a simple way to set the security bit through the arduino ide, or within the arduino code itself, or to accomplish something similar?

2.a.)Is the trinket m0 capable of doing this? (I found in the adafruit-trinket-m0-circuitpython-arduino.pdf that it doesn't have NVM since“... we use the internal flash for disk …”)

2.b.) If the answer to 2.a. is no, could I make a new UF2 Bootloader to get around this or am I misunderstanding the role the Bootloader plays in the operation of this board?

User avatar
danhalbert
 
Posts: 4561
Joined: Tue Aug 08, 2017 12:37 pm

Re: Trinket m0 Intellectual Property Protection

Post by danhalbert »

1.)Is there a simple way to set the security bit through the arduino ide, or within the arduino code itself, or to accomplish something similar?
There is discussion in these search results, but there is not a way to do it in the Arduino IDE directly that I see.
https://www.google.com/search?q=arduino ... curity+bit
2.a.)Is the trinket m0 capable of doing this? (I found in the adafruit-trinket-m0-circuitpython-arduino.pdf that it doesn't have NVM since“... we use the internal flash for disk …”)
That `nvm` is the CircuitPython module named `nvm`, not NVM in general. So that quote is not relevant in this case. The Trinket M0 uses a SAMD21, and is not inherently prevented from setting the security bit.
2.b.) If the answer to 2.a. is no, could I make a new UF2 Bootloader to get around this or am I misunderstanding the role the Bootloader plays in the operation of this board?
The bootloader wouldn't do this unless you set it up to set the security bit after loading a program. Once the security bit is set, the only way to clear it is to do a complete chip erase.

User avatar
Serifin
 
Posts: 2
Joined: Sun Jan 28, 2024 1:32 pm

Re: Trinket m0 Intellectual Property Protection

Post by Serifin »

Thank you for the reply, I will hopefully be able to try the method detailed in the discussion you linked some time in the next 2 days.

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”