Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: T4: Software reset?

  1. #1
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,557

    T4: Software reset?

    I assume this is already solved here - but can't fnd any information.

    The usual ARM-Core reset
    SCB_AIRCR = 0x05FA0004;

    Seems to switch off the Teensy - might be because this reset switches off the power-logic, too (?)

    So, how to reset the T4?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,953
    Quote Originally Posted by Frank B View Post
    I assume this is already solved here - but can't fnd any information.

    The usual ARM-Core reset
    SCB_AIRCR = 0x05FA0004;

    Seems to switch off the Teensy - might be because this reset switches off the power-logic, too (?)

    So, how to reset the T4?
    Open issue AFAIK … Yes - T4 just goes offline to Bootloader - no restart.

    Closest solution was set the wake up timer for 2 seconds then SLEEP the T4 - it then auto wakes to setup() in 1-2 seconds.

    It was 'libraitized' on 'that' thread - hopefully if interested it shows up … back in a bit if interested and not found.

    Can't specify 0 secs as that is a NOP fail, and 1 sec is on the border as the LP RTC only sees seconds - so 1 second can look like 0 seconds.

    IIRC this was on the jonr thread for restart after fresh code write to flash looking for auto restart?

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,557
    Tim, I can't find the RTC - sleep solution.

    Isn't there a better way? Isn't it possible to prevent the power-off?

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,557
    Is it correct, that the WDOG can not reset, too? It powers off?

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,953
    This thread :: forum.pjrc.com/threads/58484-issue-to-reporogram-T4-0

    Next post has a LIB version for that delayed 'boomerang' restart. It works - just have to be sure the LP restart is satisfied/disabled - or next power off it AUTO restarts again.

    That (p#12 that thread) was the best I've come up with in watching stuff go by. That thread was restart testing for 10 second sleep and it occurred to try short time to get a restart - but as noted the 1 second granularity requires asking for 2 seconds minimum.

    It seems other means of restart get caught by the bootloader treatment PJRC needed to run 1062?


    IIRC WDOG can only be set within short window on power up - maybe even a few hundred cycles? In any case I've not seen it tried. Not sure if it does a shutdown like OverTemp or a Restart? And it may trigger the bootloader too if it does Restart.

    Somehow the TyCommander USB Reset still works - but that is asking the bootloader to perform the reset.

    Paul expected the standard 'SCB_AIRCR = 0x05FA0004' to work - not sure if he has looked at another way when that just seemed to drop to bootloader mode.

  6. #6
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,953
    post #15 on this thread: Soft-reboot-on-Teensy4-0
    Quote Originally Posted by iambrentiam View Post
    Has anyone here been able to get the watchdog timer to successfully reboot the system? I am still seeing the same behavior reported back in Oct, both a watchdog timeout or a forced system reset simply shuts down the T4 instead of causing it to reboot which obviously subverts the desired functionality... Is it a bug in the processor or perhaps something with the T4 board?
    It was working on first beta 1050 when this was linked: https://github.com/tonton81/Watchdog_t4

    Didn't come across the note by Paul about time limit on setting up WDOG

  7. #7
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,557
    @Paul,

    ist there at least any way to use the watchdog(-reset) ?

    A usable watchdog would be pretty important. Maybe even at the cost of the power on/off button.
    I assume, some fuse-bits prevent a software or wdog reset?

  8. #8
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,270
    A little off topic, but the NEX pioneer series uses a similar mcu as teensy 4, when doing a warp snapshot a hardware modification is needed, simply a pullup on the timeout line just to prevent the watchdog from resetting the radio during a snapshot. This allowed us to develop software on the headunit and modify the OS without being stuck in a boot loop. However, one problem is tieing the timeout with resistor to 3.3v indefinately, it prevented the "reboot" in the kernal to shut down, but, not restart the unit, until the pullup was removed. It's possible there is a fuse or pullup preventing the reset, as symptoms are similar

    A teensy 3.5 was used on this radio to control the timeout line, during BSP boot it would be enabled a 3.3v output to the timeout, and after kernel boot process teensy would cut the power to the timeout line. Basically a wire between gpio, 200ohm resistor, and timeout test point at radio, with the console for debug/controls attached to UART6

  9. #9
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,557
    Tonton, that's interesting
    Its 'not off-topic, and as nobody has an answer to these questions so far, I guess it's not possible.
    So, to use a watchdog, it must be external. But we have no hw-reset - so it has to trigger a pin, whch triggers a routine which sets the RTC-Alarm, then power off ... the t4 will wait for the alarm, powers on again..
    Edit: * and this will not work if the WDOG has a reason to trigger - if everything crashed...


    Not sure, but I think I've heard of less elaborate things.

  10. #10
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,270
    Yes,ironically the watchdog which is burnt in the headunit which forces a reboot during a warp snapshot due to it not toggling the watchdog, causes the snapshot to.be corrupt, thus only way to recover is to unlock the SD card (locked by the NEX, unlocked via testmode boot) then reprogram firmware on it from PC. This timeout trigger line i am talking about, even prevents the BSP from resetting via "reset", not just the "reboot" in kernel. Once the hard pullup line is removed on timeout line, the reboots function again

    MX6 is used in the pioneer decks

  11. #11
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,557
    This was solved (including watchdog issue) by this patch: https://github.com/PaulStoffregen/co...279f39e4b5bb72
    It will be in Teensyduino 1.50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •