G400 spontaneously resets itself

G400D on a custom board, SDK 4.3.4, BuiltIn ethernet.

I’ve noticed that my board occasionally resets itself. Just like that, once or twice per day. No errors, no faulty behaviour, just - klak - and it restarts.

So I did some digging (again). I now log last reset cause every time G400 boots up. And now I know, that it is caused by Watchdog (register RSTC_SR.RSTTYP = 2). The funny thing is that I do not use Watchdog!!! So why does it fire?..

Also, a few notes to take into account:

  1. When I run the program from Visual Studio and debugger attaches, reset cause also reports as Watchdog.
  2. Even though I keep my Watchdog off, I still call GHI.Processor.Watchdog.ResetCounter() method. I assumed it won’t hurt, but maybe I was wrong with such assumption?
  3. I still think it is somehow related with BuiltIn ethernet.

What happens when you add the reset counter? If it stops reseting then it is defiantly watchdog!

IIRC, we can’t disable watchdog on this processor so we internally reset the counter! If so, this is obviously not working!

@ Simon from Vilnius - The C# reset method starts with if(!Watchdog.enabled) return; so calling it is a NOP essentially if you never enabled it. I would remove the networking stuff and let that run to see if it resets. Perhaps the built in Ethernet is locking up so we fail to reset the counter internally.

Remember my previous post in this topic? https://www.ghielectronics.com/community/forum/topic?id=15983&page=14#msg161394 (post #135). With 4.3.4, that problem partially disappered. Debugger attaches every time, so I removed my manual reset code, but sometimes it takes longer. A normal sequence is like this:

  1. Visual Studio says “assemblies succesfully deployed”.
  2. I hear the Ding-Dong sound (USB device disappers);
  3. I hear Dong-Ding sound (USB device reappears);
  4. Debugger attaches.
  5. Last reset cause == “User”
  6. All good.

Now, with G400 and BuiltIn ethernet, it’s very often (but not always) like this:

  1. Visual Studio says “assemblies succesfully deployed”.
  2. I hear the Ding-Dong sound (USB device disappers);
  3. A long pause.
  4. I hear Dong-Ding sound (USB device reappears);
  5. I hear the Ding-Dong sound (USB device disappers);
  6. I hear Dong-Ding sound (USB device reappears);
  7. Debugger attaches.
  8. Last reset cause == “Watchdog”
    9 .All good.

A quick test shows pause at #3 takes roughly 16 seconds, which corresponds to the default watchdog timeout. So it looks like there’s a problem with correct reset when deploying. Probably, board locks up on reset, 16 seconds later watchdog kicks in and resets again, and then Visual Studio can attach.

Will try (not sure if it is possible to remove this core part from my program).

Another question I am now thinking of… Does G400 simply resets itself from time to time, o does it actually lock up before watchdog notices it?..

I’m afraid with such random behaviour, it might be impossible to find out :frowning:


Spontaneosly reset in my G400D, too.

Custom board, ETH built in (but not activated), wifi, i2c (external a/d, digit potmeters), mp3, sd, 2x serial, 7" TFT, etc. latest firmware, glide.

It occurs with heavy load after 1-2 minutes of run:
-plays mp3 from sd
-asks sensor panel on serial/9600 and writing datas to sd in every 2 sec

When sd write is disabled or 2 sec period is increased, the reset occures later. Sometimes after 20 minutes, sometimes after 10 minutes. It will be a commercial product, so it’s very nerve-racking.

Same was on FEZ Raptor with 4.2 in the past.

What will I do?

A little update.

G400D+Custom PCB+BuiltIn ethernet = random resets.
G400D+Custom PCB+ENC28 ethernet = no problems.

Both modules run exactly the same FW that can detect which PCB it is plugged into, and then select the appropriate ethernet.

Dear GHI guys, any comments? You know, it so happens that we want to ship a prototype to a potencial customer as soon as possible, so a stable BuiltIn ethernet would be somewhat very… Desirable :wink:

@ Simon from Vilnius - you are a programmer and you understand that this mystery issue is not a quick fix but we are surely doing our best. This is a priority on our list.

Yeah I do, I just needed an assurance that you’re on it :slight_smile: Give me some updates if you find a workaround or something. Meanwhile, I will try to survive on older PCB’s…

@ Simon from Vilnius - Do you know roughly what sort of network traffic you’re seeing on the board when it resets?

It usually 1-2 TCP sockets open, and ~8kBps outgoing traffic each. I will try with zero traffic (that is, no open sockets).

Got Watchdog reset with Enc28 ethernet, too :frowning: A lonely single reset, but a reset. Maybe a cosmic ray hit it, because I saw those boards running for a week and more…

I do not have any reasons to doubt our Altium guru’s skills, but maybe that’s some routing artifact? Do you have a reference design for BuiltIn ethernet?

Or maybe it’s related to ethernet at all. What else could I check?

BTW, o promised to test with zero traffic, but that’s already done — every reset closes sockets, and it resets with them closed, too.

Maybe an EMC issue not related to the software or board itself, Power supply (filtering), external connections filtering.

@ Simon from Vilnius - I do not think we have a reference design for built in Ethernet. Though we haven’t reproduced this, there is something we are looking into that might cause this so we will let you know what we find.

Hmmm, that’s a bit unfortumate…

Anyway, additional info: when I explicitly disable Watchdog through a register, the board hangs instead of restarting. I need a few more occurencies, but it seems it’s not watchdog that is faulty here. It may be something at your side, it may also be something at my side…

Will continue cutting off application subsystems tommorow.

@ Simon from Vilnius - Watchdog cannot be disabled on the G400, so that is probably the cause of the hang.

No? then what does bit WDT_MR.WDDIS do? It show watchdog is disabled…

May be John meant “Watchdog must not be disabled on G400”?

@ Simon from Vilnius - Since the watchdog is running on power up on the G400, you can write that register to disable it. I mistakenly thought we wrote to that register on startup, which would prevent you from disabling it since it is write-once. We do not write to it until you call our Watchdog.Enable.

If it shows disabled when you read it, it must have been written before since it starts enabled. Since something is disabling it, once you try to write it again, the board hangs.

@ John - Maybe I wasn’t clear enough. [em]I [/em]am disabling watchdog, and board [em]doesn’t[/em] hang that moment. It hangs some time later. It simply hangs istead of restarting, but not immediately.