Failing Teensy 4.1 uploads from Raspberry Pi 4B


I've posted a couple times about this problem before, but I'm working in a university research lab on a system that requires remote programming of several Teensy 4.1s from a Raspberry Pi 4B (running headless Ubuntu 20.04 LTS). We currently develop our programs in PlatformIO and then use tycmd to upload to each respective Teensy. This was working great until a bit earlier this year, when we began to do a bit more heavy development on the code we were uploading.

We've found that as the .hex files we attempt to upload get bigger (irrespective of content), there comes a point at which 80-90% of our uploads fail, reporting anywhere between 90-98% completed (but only reporting about 2% of the available flash used by the program). We've tried a huge variety of different USB cables, powering the Teensys independently of USB, new Teensys, and different power supplies for the RP 4B (including the official version). However, when we use other kinds of computers (with tycmd and the same .hex file), we have no such problem. We've replicated the same error across 2 separate RP 4B's by now.

Is there any known issue with uploading from the RP 4B? Could some interval clock timing be off, or maybe the RP 4B can't sustain the necessary power for long enough to upload larger programs? We may just upgrade to a RP 5, but just wanted to check our bases. I'll include the .hex file to replicate the issue.

Thank you for your help!


  • firmware.hex.txt
    455.8 KB · Views: 7
There have been some threads about download timeouts for large files. Since your trouble is only with RPi, it makes sense to wonder if the timeout logic is somehow different there. Sorry I can't provide specific help, but there is a timeout.
I see this problem too with large HEX files when I have some script or something that waits for upload-complete. I think the problem for me is that the Teensy Loader program indicates that it’s finished before it’s actually finished.