Is it possible to prevent accidental flashing over USB on Teensy 3.2?

Status
Not open for further replies.

amundsen

Well-known member
Hello,

Is there a way to ensure a flashed Teensy 3.2 cannot be flashed anymore (by accident for instance) over a USB port when using Teensyduino? For instance if I have several Teensy connected to my computer, some already flashed some not. Of course I could remove the Teensy already flashed but as soon as the device they are meant to control is build and tested I think I could forget these devices have a Teensy inside (for some MIDI devices for instance...).

Thank you for helping.
 
Possible, yes. Easy, no. Risk free... certainly not!

In fact, Teensyduino has multiple levels of protection to prevent you from forever locking your Teensy.

But it is possible, if you write code to directly access the flash controller. You need to fully erase the sector starting at 0x400. Then you can write anything you want. If you set the FSEC byte, you can turn on the security features and turn off mass erase. That will forever lock your Teensy to the same code. The bootloader will never again regain access to reprogram the chip.

Teensyduino and the bootloader default the FSEC bits in such a way that you must both erase and then program to get the mass erase disabled configuration. It can't be done with only 1 step.

FSEC is documented in the chip reference manual. So is the flash controller. No, PJRC doesn't publish any sample code to help you do this extremely risky thing. If you do write such code, I would ask, even beg of you, please don't publish such dangerous code. A few people who've tried this have indeed managed to brick their boards. I don't recommend it.
 
Hello
Teensy 3.2 can you duplicate without having the source?
Theoretically yes, with lots of knowledge, experience, and equipment. Practically no, since if you had all that, you wouldn’t ask. And you shouldn’t expect help from these forums in doing this, since no one here can see if pulling the firmware from a programmed Teensy would be a violation of whomever’s intellectual property.
 
Status
Not open for further replies.
Back
Top