Alternative boot loader for WiFi firmware updates on Teensy 4.1?

MMESSITER

Well-known member
I want to be able to update the firmware in a Teensy 4.1 over WiFi for user convenience. I asked ChatGPT 4o how to, and it suggested I add an ESP32 to my system which could easily accept the new firmware and put it on the Teensy’s SD card and then reboot the Teensy.

Then the Teensy‘s boot loader would need to look on the sd card, while booting, for the file. If found it should load the new firmware, delete the file, and reboot. This all sounds very plausible but I don’t know how to create that needed boot loader. It’s seems such an utterly great plan I wonder if anyone has done this, or even knows how! I hope so! Many users will love easier updates!
 
You cannot change the Teensy bootloader, which is on a dedicated chip. This is by design, but you can, as others have done, write a secondary bootloader, that resides in your program and allows updating the flash on Teensy. If you use WiFi with ESP32, you need to pass hexcode from ESP32 to Teensy. In theory you could use SDIO (SDcard), but you have then to write your own SDIO drivers for both MCUs. As this OTA is not new in this forum, you will certainly find how others do it.
 
Thank you very much. The implementation of this plan seems to be both very desirable and almost impossible for people like me who lack in-depth understanding of all the hardware.
I wonder if there’s a way round this.
Teensy 4.1 is utterly fantastic, but mass market applications are handicapped by the current absence of a user WiFi update system.
Ordinary users simply don’t like to open cases and plug in wires - so it’d be hugely popular if we could solve this.
 
I shall of course. Might take me a while. I’m not great at all this but I have learned a lot developing ‘Lockdown Radio Control’ . I never imagined it’d become useable, but it’s now working wonderfully and my local model flying club is now using two of these for training new pilots - using the ‘wireless buddy box’ system. I now use this radio for all my model flying and it’s never let the side down!
 
I’ve looked at FlasherX, and I’ve paused because I couldn’t easily understand how to implement it safely, and he warns that incorrect use can render a Teensy useless. I will look and think further. I’d love to find a method I can easily implement (in PlatformIO) and properly understand. He does explain in the Readme how it operates, and that’s clear enough, but his actual code I found rather harder to follow. I like to make a point of only borrowing code from others when I understand it sufficiently to make useful edits with predictable results. I think it’s not a good idea to paste in code before fully understanding it.
 
I’ve looked at FlasherX, and I’ve paused because I couldn’t easily understand how to implement it safely, and he warns that incorrect use can render a Teensy useless. I will look and think further. I’d love to find a method I can easily implement (in PlatformIO) and properly understand. He does explain in the Readme how it operates, and that’s clear enough, but his actual code I found rather harder to follow. I like to make a point of only borrowing code from others when I understand it sufficiently to make useful edits with predictable results. I think it’s not a good idea to paste in code before fully understanding it.
That warning was put in by the original author of Flasher for the T3.2. I extended it to support all T3 and T4, thus the X,and always left in that warning. For T4, there is no way that you can brick the device, so it’s “safe” in that sense. If you focus on how to get the hex records into your T4 via wifi, you’ll be able to do firmware updates.
 
Hey that’s really great news! Thank you so much. I apologise for being a bit of scared beginner.

I only started to learn C++ (a bit) in 2020. I’m really a musician. Oboe.

The code I plan to use it for is the lockdown radio control I mentioned earlier. It’s quite a big project now. Updates are its biggest issue, surprisingly.

The RC system also uses a Nextion screen that gets updated over a serial link - to which the Teensy 4.1 of course is already connected. Do you suppose I’ll be able to update both the Teensy and the Nextion with similar methods? That’d be sensational! Uses will be blown away!
 
You definitely can update the Teensy firmware over a serial link. Whether it can be the same one you use to update the Nextion, I don't know. I suggest you try the FlasherX examples first, to get a sense of how it works. Try the examples of serial transfer and SD file, and when you can reliably send updates via those methods, you'll understand better how it might fit into your own sketch, and you can come back here for help.
 
Good idea thank you! I’ll try the example(s) on another Teensy 4.1 with a trivial bit of code.
I’m hoping that as I gain understanding I’ll see how to implement it into a real application. We have other projects on development now so this will be great for other things too! Many thanks.
 
You definitely can update the Teensy firmware over a serial link. Whether it can be the same one you use to update the Nextion, I don't know. I suggest you try the FlasherX examples first, to get a sense of how it works. Try the examples of serial transfer and SD file, and when you can reliably send updates via those methods, you'll understand better how it might fit into your own sketch, and you can come back here for help.
… can’t wait to try it! Sorry I’m a bit slow. Sometimes life gets in the way. But I will do this in a few days’ time! Meetings in London today. Boring! Waste of good coding time ! 😁
 
You definitely can update the Teensy firmware over a serial link. Whether it can be the same one you use to update the Nextion, I don't know. I suggest you try the FlasherX examples first, to get a sense of how it works. Try the examples of serial transfer and SD file, and when you can reliably send updates via those methods, you'll understand better how it might fit into your own sketch, and you can come back here for help.
I wonder if I might ask a little favour?
To help me get started, and to get something working, please would you write brief and unambiguous instructions? What to do after downloading the .zip file. As if I were 6 years old! I guess I’d better use the Teensyduino IDE (I usually use PlatformIO so it’s unfamiliar).
I’m guessing I should get your .ino file running in a Teensy 4.1…. Not sure what to do next!
 
Perhaps I exaggerate a bit! Sorry! 😂
To assess the true level of my coding ability one might glance briefly at my LockDownRadioControl repo on GitHub.
 
Back
Top