Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:03 07 Oct 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PM Standard - HW Watchdog issue...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9660
Posted: 03:48am 06 Oct 2025
Copy link to clipboard 
Print this post

This one is strange.

FW 5.09.00b6.

I will try updating to FW 6.00.03

Is anyone aware of this odd behaviour?
I have some PM Standard running on WS RP2040-Zero modules.
The program runs perfectly.
It can run perfectly for MONTHS on end.
But at some point, the module seems to crash, and the HW Watchdog DOES NOT restart the module as it should.

Watchdog HW 8000 being used in the code, which is within the boundry for the HW watchdog.
When a module seems to "Crash" like this, you can't talk to it - the VCP is gone.
No amount of tinkering, changing USB leads or ports allows it to connect, and the VCP is REALLY gone, cos Windows does not even make the "USB connected" sound - either when you connect, or you disconnect.

I would have HOPED that the HW watchdog on the 2040, would have kicked the module back to life again, but it doesn't seem to do that.  I've had a handful of boards do this now, all identical boards, all using the same FW version - but with no predicatibilty to the lock-up.  It just happens at some random point, then the module is dead to the world.    

Power is good, volts good to module, but nothing responds anymore.
Press RESET on the module, or cycle the power, and away it goes again happy as Larry - until the next time, that is.

Am I wrong in my understanding, that the HW watchdog should be able to recover from this kind of thing, as it is a HW watchdog, and I am NOT relying on the software watchdog built into MMBASIC.

This is very odd, and at the moment, I don't have any real explanation for this, but it is a major problem, cos the units just stop working at random.

Anyone got any ideas?

As I say - I will upgrade to the later FW, and I am just praying to the tech-gods, that the fix is in there.  I've never really ever known a HARDWARE watchdog to fail.  I've seen software ones fall-over, but the HW one should be able to kick the module back into life, even if MMBASIC has crashed BADLY for some reason.....
Smoke makes things work. When the smoke gets out, it stops!
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5306
Posted: 07:10am 06 Oct 2025
Copy link to clipboard 
Print this post

Hi Grogster,

Can you determine if the watchdog really caused it -or- that it failed to kick in in a watchdog situation (and failed to revive the system).

Another thing I can think of is when the ARM is doing USB (which is infrequent and short..so.. "rare") while the watchdog kicks in (it is hardware, so independent of what software is doing) the USB stack is killed at an unknown state.

To be honest, I would not really be able to help you. Since I mostly run leading edge firmware, and only have few picomite systems that I turn off after use. I did not ever implement watchdog, they reboot every time I use them.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8156
Posted: 07:18am 06 Oct 2025
Copy link to clipboard 
Print this post

AFAIK the hardware watchdog fires a CPU reset whenever it's counter gets down to zero. It's using the normal chip clock and shares part of the divider chain, but otherwise it's isolated from the rest of the chip apart from when it's counter register is accessed.

How all that works into MMBasic I don't know. I can't see any obvious explanation for what you're seeing. :(

I do know the watchdog works on pretty old versions of MMBasic. I have one running on my old fish tank controller. Occasionally the lights go off, the watchdog triggers, restarts the system and the lights fade up again. I've been unable to trace the cause of the problem though. That's using a YD-RP2040 with, IIRC, 5.07.04 or something like that.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2755
Posted: 07:32am 06 Oct 2025
Copy link to clipboard 
Print this post

Is the the program also frozen or just the USB interface?

The module doesn't appear to have a heartbeat LED so perhaps add some code to change the colour of the WS2812 on each pass through the main loop to show if that is still running.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5306
Posted: 08:09am 06 Oct 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  I do know the watchdog works on pretty old versions of MMBasic. I have one running on my old fish tank controller. Occasionally the lights go off, the watchdog triggers, restarts the system and the lights fade up again. I've been unable to trace the cause of the problem though..


That is worrying !! I am not sure how big the risk is for the fish but try to run without watchdog. I think you have published an earlier version of your fish tank program. I could look at it. Is there any reason why this could happen ? Does it also happen without watchdog ? Or is the watchdog causing more problems then relief.

The only experiency I have with long running programs is with the "wet sock" humidity detector (ran 2 months), and the mains voltage analyzer (half a year). These have run (without watchdog, but also without USB) without problems.

Regards,

Volhout

P.S. When Mick experiences it in 5.07.04 and Grogster in 5.09.00b6 it may still not be brought to Peters attention. IF it is the same.
Edited 2025-10-06 18:15 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10453
Posted: 09:19am 06 Oct 2025
Copy link to clipboard 
Print this post

Your symptoms suggest the MMBasic program is still running, hence no watchdog, but the RP USB device has got locked up somehow. You can prove this one way or the other by including in your program a MMBasic heartbeat driving the onboard WS2812.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5306
Posted: 10:26am 06 Oct 2025
Copy link to clipboard 
Print this post

Mick, Grogster,

Both your projects have one thing in common. Both use a Pico Zero.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8156
Posted: 01:20pm 06 Oct 2025
Copy link to clipboard 
Print this post

Not mine. It uses a YD-RP2040 Pico clone. The *next* version of the board uses a Zero. :)  I still haven't finished messing with the software for the new one, that's why it's not running. It keeps getting put back...

There's no risk to the fish as on the old version both the filter pump and heater have relays who's coils are simply switched to 12v, not under software control.

This is the board that had a Pico W in it originally. I never did manage to sort that out.
Edited 2025-10-06 23:21 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5306
Posted: 01:36pm 06 Oct 2025
Copy link to clipboard 
Print this post

Sorry,

I assumed you where running the NEXT version already. It's been a while since you published it.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8156
Posted: 01:51pm 06 Oct 2025
Copy link to clipboard 
Print this post

Yeah, well... it sort of got pushed to one side as life impinged on hobbies. Then my thoughts moved onto other ideas.  :)

I have the next system planned out and, once again, the heater is directly powered and the pump is on simple control. Basically it's a lighting controller, but more complicated this time. As I have the display and buttons there's a fair bit more to think about - there was no way to set times or anything originally, it needed a USB lead across the carpet!
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5306
Posted: 02:10pm 06 Oct 2025
Copy link to clipboard 
Print this post

Hi Mick,

You could use a wireless USB lead. I have 2 of these ESP8266-01 talking to each other without wireless connection.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 598
Posted: 02:16pm 06 Oct 2025
Copy link to clipboard 
Print this post

I haven't played with the newer MMbasic for the RP2040 still doing water controllers.

now sure how to read/write these registers.

Watchdog Reset:
A hardware-based reset that can be triggered by the watchdog timer expiring or by directly setting a trigger bit.

Scratch Registers:
The watchdog has eight scratch registers that retain their values across resets, which can be used for advanced debugging and booting.

Reason Register:
A register that indicates the cause of the last reset, allowing the system to determine if it was a watchdog-induced reset.

Control Register:
Controls the enabling and triggering of the watchdog timer.

hope this is of use
Quazee137
Edited 2025-10-07 00:17 by Quazee137
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025