-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reprogramming, then quickly WFI-ing, resets Teensy #76
Comments
Previous discussions in #64. |
I am having this issue when trying to do the instructions on the readme, i cannot get it to work at all! |
The previous example was demonstrating the issues described in mciantyre/teensy4-rs#76, which results in a poor experience for newcomers. We now demonstrate a slightly more interesting example that won't immediately exhibit a bug.
Thanks for the feedback. I updated the example in the template project so it won't be the first thing new users hit. Did any of the workarounds described in the issue help? |
Yes, when I put in the workaround and compiled it didn't update in my teensy loader, that was my bad. |
No problem! Good to know a manual workaround helped. I'm exploring a software workaround in #79. |
79: Disable low-power wait mode during startup r=mciantyre a=mciantyre Set the low-power state to run mode, rather than keeping the default wait mode. Seems to mitigate #76. Tested on the `led.rs` example. The PR also moves the vector table into DTCM. Now, interrupt handles will be found in memory, and no longer require an address lookup in off-board FLASH. Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>
There's a workaround on the main branch. Leaving this open as my reminder to document the behavior in the runtime crate. |
Describe the bug
After you reprogram the Teensy, there's a chance that the chip will reset again when you wait for interrupt (
WFI
). You'll notice that the Teensy's red, programming LED is on, and your program doesn't run.To Reproduce
In the
pit.rs
example, remove the spin-loop:teensy4-rs/examples/pit.rs
Lines 66 to 69 in b9f297e
Then, build and load the example:
Or, use this minimal example:
Expected behavior
When
main()
is called, you can immediatelyWFI
without issues. You can re-program the Teensy with the same example, and it works as expected.Additional context
Work arounds:
Add a wait, as shown in the
pit.rs
example. A few hundreds of milliseconds seems to be OK. Or, add a busy-loop, as shown in the RTIC examples:teensy4-rs/examples/rtic_uart_log.rs
Lines 143 to 152 in b9f297e
Power-cycle the Teensy after reprogramming it. There's no issue when booting from a cold start.
You might not notice this when using the Teensy core libraries, since there's a 300ms delay before calling
main()
. We could introduce a similar workaround in the runtime crate.The text was updated successfully, but these errors were encountered: