Automatic program mode with bricked flash

Dogbone06

Well-known member
Hi all!

I have a program that flashes the device, but in a scenario where the usb connection is lost mid-programming, after the device has erased the flash, if you power down the unit (which happens if usb disconnects). The program can no longer automatically put the device into program mode.
You have to click the button, which works great. But let's say we want to get rid of the button all together. Is there any way of doing that? So that even if the flash is "bricked" it'll still be able to do it, or is it physically impossible?

Why would the usb disconnect? Well, bad cable or the cat decided to mess with me.

Just brainstorming here to see if there's any way. Perhaps a custom component, a passthrough USB IC that can "click" the program button for you by putting the pin HIGH or something fancy.

Cheers!
 
Perhaps a custom component, a passthrough USB IC that can "click" the program button for you by putting the pin HIGH or something fancy.

In the "something fancy" category, you can use another Teensy running the rebootor program connected to the Program pin on the main Teensy. It works together with the hard reboot option (-r) in the command line loader program to provide a highly reliable way to always reprogram even if the main Teensy crashes in a way where USB no longer works.

Normally adding another Teensy and another USB cable isn't very practical. This feature is mainly meant to allow automating certain types of software testing, where the software you load onto the main Teensy may crash with USB disabled. But even if it's only an answer to your question in an impractical sense, perhaps it might give you some ideas?
 
In the "something fancy" category, you can use another Teensy running the rebootor program connected to the Program pin on the main Teensy. It works together with the hard reboot option (-r) in the command line loader program to provide a highly reliable way to always reprogram even if the main Teensy crashes in a way where USB no longer works.

Normally adding another Teensy and another USB cable isn't very practical. This feature is mainly meant to allow automating certain types of software testing, where the software you load onto the main Teensy may crash with USB disabled. But even if it's only an answer to your question in an impractical sense, perhaps it might give you some ideas?

Thanks for the reply, the options are limited from what I understand. If there was a simple option, you would have known about it for sure. Atleast there is a way to do it with what you mentioned. Very interesting!
 
But let's say we want to get rid of the button all together. Is there any way of doing that? So that even if the flash is "bricked" it'll still be able to do it, or is it physically impossible?

Even without button, you still have the Program Pin, you can use to start programming by touching GND.
It is fairly common for systems that are enclosed to have program pin accessible.
 
Even without button, you still have the Program Pin, you can use to start programming by touching GND.
It is fairly common for systems that are enclosed to have program pin accessible.

Yea it’s a very good failsafe. I guess the hard part is to implement it elegantly so that it’s there but sort of in plain sight without being ugly hehe.
 
Most types of electronics have access to a reset by placing a needle into a small, almost unseen, hole.
For myself I have a very small hole in the outside wall of a case above the program button.
This small hole opens up inside to a tube over the button. This tube contains a loose rod which sits above the button.
Then pressing the top of the rod using a pin presses the program button.
The same could be done for a remote (not over the reset button if that is not practicable) button which then resets the teensy.
 
Most types of electronics have access to a reset by placing a needle into a small, almost unseen, hole.
For myself I have a very small hole in the outside wall of a case above the program button.
This small hole opens up inside to a tube over the button. This tube contains a loose rod which sits above the button.
Then pressing the top of the rod using a pin presses the program button.
The same could be done for a remote (not over the reset button if that is not practicable) button which then resets the teensy.

If you have access to GND (e.g. battery) then behind the hole needs to be only a contact that is connected to program pin. A grounded needle / wire will put teensy into programming mode.

or have two nails (GND and Prog-Pin) that can be bridged externally.
 
Most types of electronics have access to a reset by placing a needle into a small, almost unseen, hole.
For myself I have a very small hole in the outside wall of a case above the program button.
This small hole opens up inside to a tube over the button. This tube contains a loose rod which sits above the button.
Then pressing the top of the rod using a pin presses the program button.
The same could be done for a remote (not over the reset button if that is not practicable) button which then resets the teensy.

If you have access to GND (e.g. battery) then behind the hole needs to be only a contact that is connected to program pin. A grounded needle / wire will put teensy into programming mode.

or have two nails (GND and Prog-Pin) that can be bridged externally.

Very good ideas indeed!
 
Back
Top