How to reset teensy 4.1?

Status
Not open for further replies.

edsut

Well-known member
Is there a way to reset the Teensy4.1 without removing power?
I have code that locks up the board, but there are trace logs that I push to psram
prior to that. I'd like to be able to restart the CPU without having a power-cycle
mess up the PSRAM.
As far as I can tell, the ONOFF pin doesn't do that on its own, so I'm kinda
baffled at the moment...
Any thoughts?
Ed
 
Well, after what appears to be about 140 views, but no replies; I guess there is no
easy (i.e. button-push) way to do this. I haven't come up with anything. :-(
So, I guess I stick with just depending on the watchdog, since that's what it's made for...
Meanwhile, if anyone comes up with a clean "button-push" reset (without power-cycle)
for the 4.1, please post!
Ed
 
I see 15 names that clicked the link - lots of repeat viewers ... just seeing the ping post here ...

Indeed the T_4.x does not have a functional 'Reset' pin. Not sure about the On/Off comment? Was it tried and PSRAM was lost? It does shut down the 3.3V power.

When PSRAM was tested in beta it was indeed observed to retain data across reprogramming.

If you have a spare pin you might try a 'CHANGE' interrupt on that and in that with PULLUP and then apply GND to the PIN, then in _isr() put the reset command. I have seen the Teensy go offline and stop loop() and yet have such a pin interrupt function ... in whatever case of bad code that was.

Also it might be worth trying the GDB debugger - it may be faulting and that would show that - and perhaps allow a backtrace to(ward) the source of the trouble.
 
Couldn't you simply use tyCommander? It has a reset button. If your board hangs so badly that it doesn't respond to the reset button you can always press the reboot button on the board prior to resetting it with tyCommander.

Screenshot 2020-09-14 122239.jpg
 
@defragster,
I'm sure I contributed some to the click count, just looking for a reply.
Regarding ONOFF... All I meant there was that I tried grounding that pin (thinking it would cause a reset) and it didn't. Then I read more about the pin function (yea, I should've read before grounding :-( ) and quite honestly, I'm not sure how its supposed to be used; but somehow coordinates with a PMIC (if one was designed in). Anyway, that led me to the original question.

Just to give a bit more context, I'm not running Arduino/teensyduino. I'm using snippets of that code, along with my own stuff to run a boot monitor I wrote (umonfw.com). The monitor catches all un-assigned exceptions (hopefully), so had that been the case I would have detected it. Also note that I am still on the learning curve for this SOC, so please don't hold anything stupid I say against me! :) Your suggestion to try a CHANGE interrupt is good, I may give that a try, but for now just enabling the WDT (through a command in the monitor) should give me what I need without any solder/wiring.
Tx
 
@luni
Never used tyCommander. See my response to defragster regarding my non-standard context.
Regarding the reboot button on the Teensy4.1... as far as I understand things, that drops the board to
halfKay bootloader (waiting for a firmware update), and if I don't reload the firmware at that point I
would have to power cycle just to get it to restart without intervention from halfKay.
Please correct me if I'm wrong...
Ed
 
Just thinking a bit more about my reply to luni...
An interesting feature for halfKay (IMHO) would be for it to timeout after some duration waiting for a firmware update and just reset the main SOC...
 
@luni
Regarding the reboot button on the Teensy4.1... as far as I understand things, that drops the board to
halfKay bootloader (waiting for a firmware update),
Right

and if I don't reload the firmware at that point I
would have to power cycle just to get it to restart without intervention from halfKay.
Ed

Wrong :)

while in Halfkay mode the board accepts a reset command which does not load new firmware but just resets the board. Technically, in halfKay mode the board acts as HID device. If you send it a report with some magic bytes it will reset. TyCommander will take care of this. I would say, this should also work if you don't use teensyduino. As long as you didn't unsolder the booltloader chip a button press should put the device in halfKay mode where it can be resetted. Just try it...
 
@luni,
Ok, "teensy_loader_cli -b -mmcu=imxrt1062" does exactly what I want!
Thanks much, hopefully this will give me everything I need...
 
Just to confirm, I did the following...

1. I transferred a 0x800000 byte file to PSRAM
2. I pushed the reboot button
3. From linux I ran: teensy_loader_cli -mmcu=imxrt1062 -b
4. I retrieved the 0x800000 bytes from PSRAM to another file
5. Comparison of the two validated that resetting this way does not corrupt PSRAM.

Excellent!!!
 
Perfect, sounds like a simple solution ...

I started to suggest that - but was already two hours late for signing off. In fact when I did the pin change _isr() - USB printing worked .... that time.

But only having "I have code that locks up the board" to go on it seemed that USB might be 'offline' - in which case TyCommander would have been ignored. But yes, TyCommander GUI Reset has been very useful these past 5 years.

And yes, PSRAM survives as noted above across Upload - but also across 'TyComm Reset' as that was done to see SPIFFS file system on PSRAM survived.
 
Question about a hardware solution to this, would it do any harm to the board if I were to attach a toggle to the 5v pin to reset it? Perhaps even a push-button?
 
Status
Not open for further replies.
Back
Top