Teensy 3.0/3.1 Lock Bits and Reprogramming

Status
Not open for further replies.

Sc00bz

New member
Are there lock bits on the Teensy 3.0/3.1 like with the Teensy++ 2.0?

Is there a way to require pressing the reset button in order to reprogram?

I noticed that there is no 72 MHz for Teensy 3.1 (see image). I'm running Teensyduino 1.18 with Arduino 1.0.5-r2 on Windows 7. Am I missing something?

teensy31.png
 
The standard clock rate for the Teensy 3.1 is 72 MHz, but is not listed as an option. 96 MHz is overclocked. Bad things happen when you overclock a chip I want to avoid those problems.
 
Are there lock bits on the Teensy 3.0/3.1

No. This is planned for a future release, but for now it's not supported.

Is there a way to require pressing the reset button in order to reprogram?

You can edit the core library. Just remove the call to _teensyduino_reboot().

I noticed that there is no 72 MHz for Teensy 3.1

This too is planned, but not for some time. There's a lot of code which depends on a 48 or 24 MHz I/O clock.
 
Bad things happen when you overclock a chip I want to avoid those problems.

All the Freescale Kinetis K20 chips are made with the same 90 nm silicon process using exactly the same ARM CPU core and different mixes of same peripherals and memory. The higher end chips have slightly different bus structure. The 72 MHz part is the lowest spec part with that tightly coupled RAM structure. They all have the same flash memory, but faster parts have bigger caches and wider paths from the flash to the cache.

Yeah, technically it's overclocking. But in this particular case, it really is the same silicon as the parts officially specified at 100 and even 120 MHz. The 48 MHz part on Teensy 3.0 is too, but on 3.0 the simpler bus structure and narrow/slower path to the flash caused a lot of wait states when running some code at 96 MHz. Teensy 3.1 really runs very well at 96 MHz.

I personally do almost all my testing of Teensy 3.1 and every library running at 96 MHz. It really does work.

Eventually I'm going to add 72 MHz support in Teensyduino, but it's a lower priority than more features in the audio library, CAN bus, porting other libraries, and better documentation.

If you *really* want to try 72 MHz, you could edit the code in mk20dx128.c to configure the PLL to generate 72 MHz, and boards.txt to add 72 MHz to the menu.
 
Last edited:
No. This is planned for a future release, but for now it's not supported.


Hello Paul,

too bad I have to read that lock bits are not supported for Teensy 3.1. Does it mean that they are just not supported by default, or that it is completely not possible to write protect the code I'm putting onto the teensy?

I use the teensy 3.1 as platform for our new measuring devices and I would like to make it as difficult as possible for outsiders to read the code containing all the special tricks that makes our device unique.

I would be glad if you could help me with that issue.

Thanks,

Clemi
 
Today the lock bit is not supported at all. The Teensy Loader won't let you set it.

Lock bit support was originally planned for 1.20, but got delayed when the audio library too much more work than originally anticipated.

I've put lock bit support on the feature list for 1.21.

When this does become supported, one consequence will be complete chip erasure when you press the pushbutton. Today, pressing the button causes the chip to go into bootloader mode, but the chip is erased only at the moment you begin actually loading code. If you go into bootloader mode but don't upload code, and then reboot by the button in Teensy Loader or by power cycling, your old code is still there. Once the lock bits are set, going into bootloader mode will requires complete chip erasure. In other words, if somebody accidentally presses the button but doesn't run Teensy Loader to upload code, the board will be completely erased and not run your code anymore. With the lock bit set, special care will be need to guard against accidental pressing of the button!
 
Last edited:
Thank you for the fast reply.

That means it's a software thing, not hardware related? And it will probably be solved in approx. 4 month?

I could live with that.

If it's only disallowed to push the button on the teensy I'm okay with it. (Sounds like a booby trap at the entrance door). Our customers will not be allowed to open the devices, without spoiling warranty.
 
Today the lock bit is not supported at all. The Teensy Loader won't let you set it.

Lock bit support was originally planned for 1.20, but got delayed when the audio library too much more work than originally anticipated.

I've put lock bit support on the feature list for 1.21.

When this does become supported, one consequence will be complete chip erasure when you press the pushbutton. Today, pressing the button causes the chip to go into bootloader mode, but the chip is erased only at the moment you begin actually loading code. If you go into bootloader mode but don't upload code, and then reboot by the button in Teensy Loader or by power cycling, your old code is still there. Once the lock bits are set, going into bootloader mode will requires complete chip erasure. In other words, if somebody accidentally presses the button but doesn't run Teensy Loader to upload code, the board will be completely erased and not run your code anymore. With the lock bit set, special care will be need to guard against accidental pressing of the button!

Has there been any progress in the addition of lock bit control? I am extremely interested in this and don't mind the consequence. Thanks!
 
I wanted to bump this as I too am looking for lock bit control for my Teensy 3.1 and 3.2 projects.

Any word on this?
 
Status
Not open for further replies.
Back
Top