New to Teensy

Status
Not open for further replies.

Mike85

Member
Hi, I have recently got a Teensy 3.2 and am having lots of fun with it. I'm just a little confused as to what the bootloader chip does. I've used PICs and their external programmer, is it like that only on the Teensy all the time?

Mike
 
That is pretty much it, with minor thing that the main CPU is the thing that actually downloads the code and writes to flash not the bootloader IC, it just stores the code.

When you press the program button or trigger a load from software the bootloader IC takes over the main IC and loads code to RAM (and sets sane config bit values) to support download of user code via USB. Means that unlike classic Arduino things like deep sleep or changing clock bits does not brick things.
 
Thanks for the reply. So once my Teeny is installed in its final home doing what I want it to do the bootloader chip plays no more part in the proceedings, it just sits there retired. I wish I could.
Mike
 
So once my Teeny is installed in its final home doing what I want it to do the bootloader chip plays no more part in the proceedings, it just sits there retired. I wish I could.

Less like retirement, more like furloughed but forever on call, ready to return to work / active duty on a moment's notice when needed again.
 
Less like retirement, more like furloughed but forever on call, ready to return to work / active duty on a moment's notice when needed again.

So, you've written your carefully crafted code into your Teensy and installed your electronic work of art, how do you protect your precious Teensy and its code from being tampered with? Is there some way of locking it or do you have to do something drastic like remove the bootloader chip?
 
After studying the 1000+ pages reference manual for the K20 processor, you'll discover that there are flags which can be set to protect the firmware.
 
After studying the 1000+ pages reference manual for the K20 processor, you'll discover that there are flags which can be set to protect the firmware.

1377 pages of datasheet is a lot of bedtime reading and I clearly haven't read that chapter yet. My experience with PICs is that you can set bits to stop the code being read back and that these are usually set using an external programmer. What I'm wondering is how you stop someone with a lapton and the relevant, easily downloadable software from plugging into the Teensy and having a little play around possibly overwriting your code and well and truly messing things up.

I haven't got any such projects yet, I'm just such a pessimist that I lie awake at night thinking the worst. But hey, what could be worse than Trump, Putin and Brexit?
 
Read a short but inspiring summary here: #9

Thanks for the link, it made interesting reading and led to even more interesting reading. It didn't answer my question though but it did answer a few others that I'd not thought to ask yet.

Maybe the reason there isn't an answer to my question is that the answer is so obvious and maybe the reason it's so obvious is something that did come up in the thread you directed me to and that is that the Teensy is a "Hobby" device so my question is irrelevant.
 
Or, perhaps I didn't get the question... In my eyes, the primary concern of a commercial product is to protect the firmware against being read out for copyright reasons. I've pointed you towards possible solutions. But there is apparently no protection against the idiocy of users who would reinitialize the Teensy by trying to flash a different HEX-file and thus losing your firmware. But if the child breaks his toy, it's not your problem, it's his...
 
I do get your point. Sometimes when you make a "one-off" for someone they can get curious. If I were making a production run of thousands it would be a very different matter. Maybe the only solutions for my concern are epoxy glue in the USB port or remove the Bootloader chip and I don't know if the Teensy would still work if I did the latter. It's all hypothetical and I appreciate your engaging and indulging me.
 
The Teensy can operates without the bootloader though would be a rather brutal process to remove, and there are lock bits in the CPU in various combinations since regardless of how it is used in the Teensy the core is intended for a wide range of commercial devices where being locked down tight is the desired end state. Actually accessing them on Teensy is deliberately multi step to make it harder to brick.

edit: not finding the post which included actual lock code but see the tail end of threads for the config locations in question:
https://forum.pjrc.com/threads/28215-Teensy-as-a-secure-storage-for-private-keys
https://forum.pjrc.com/threads/34427-Does-Teensy-lock-the-flash-memory
 
Last edited:
Status
Not open for further replies.
Back
Top