Hi! I'm working in a university robotics lab right now, and we've set up a Raspberry Pi 4 running headless Ubuntu 22.04 LTS connected by USB to a Teensy 4.1 as the control hardware on an underwater robot we're developing. We've been sshing into the RP4 and using Platform.io and the teensy_loader_cli to do remote development and uploads at times when we can't access the hardware (e.g. sealed up for testing in a lake or pool), and it's worked great.
Lately, however, the teensy_loader_cli has started failing (for the most part, we've had a few successes) .hex file uploads midway through for one particular program (our main one). It compiles fine, and changing the code doesn't appear to help -- it's all just a hex file anyway, right? We've done some digging into the code and messed around with different teensy_write() wait times based on some forums we've read and tested with some smaller .hex files -- they upload fine, it just seems like we're running into problems with this particular program. We identified the error as "-32" (broken pipe) coming from the usb_control_msg() call in teensy_write(), but debugging that is a bit farther into Linux than any of us have gone before.
There a couple things we think might be the problem, but we were hoping to see if we could get some more experienced guidance before diving in:
(1) We have added a substantial amount of code to our project, but the verbose option on the loader says we're at 1.8% capacity -- could that number be wrong and our program is too big?
(2) We're overclocking the teensy right now (using the platformio.ini file) to 800000000 Hz, but it's been working fine like that for the past couple of weeks. Could we have messed up the clock somehow?
(3) We're powering the teensy from the pin on our Raspberry Pi 4, which is also running a wireless access point, which takes some significant amps -- maybe we don't have a good enough power supply to last through a larger upload? We did test uploading the file with the GUI uploader on a desktop linux computer, and it didn't work there as well.
(4) Something else we're missing?
Thanks for your help in reading this post and pointing us in the right direction! I'll attach the .hex file.
Lately, however, the teensy_loader_cli has started failing (for the most part, we've had a few successes) .hex file uploads midway through for one particular program (our main one). It compiles fine, and changing the code doesn't appear to help -- it's all just a hex file anyway, right? We've done some digging into the code and messed around with different teensy_write() wait times based on some forums we've read and tested with some smaller .hex files -- they upload fine, it just seems like we're running into problems with this particular program. We identified the error as "-32" (broken pipe) coming from the usb_control_msg() call in teensy_write(), but debugging that is a bit farther into Linux than any of us have gone before.
There a couple things we think might be the problem, but we were hoping to see if we could get some more experienced guidance before diving in:
(1) We have added a substantial amount of code to our project, but the verbose option on the loader says we're at 1.8% capacity -- could that number be wrong and our program is too big?
(2) We're overclocking the teensy right now (using the platformio.ini file) to 800000000 Hz, but it's been working fine like that for the past couple of weeks. Could we have messed up the clock somehow?
(3) We're powering the teensy from the pin on our Raspberry Pi 4, which is also running a wireless access point, which takes some significant amps -- maybe we don't have a good enough power supply to last through a larger upload? We did test uploading the file with the GUI uploader on a desktop linux computer, and it didn't work there as well.
(4) Something else we're missing?
Thanks for your help in reading this post and pointing us in the right direction! I'll attach the .hex file.