Particle Electron - All code Halt during cloud connection

Setup:
Particle Electron SARA-U260
0.6.2
SYSTEM_THREAD(ENABLED)
SYSTEM_MODE(SEMI_AUTOMATIC)
Watch dog timer enabled (callback with System.reset())

System runs setup and loop just fine. Then after a variable amount of time (minutes to hours) the particle will drop cloud connection and attempt to reconnect but will be stuck flashing cyan. The problem is that all code is halted, loop is not running and the watch dog does not trigger (reset). So far the only way to recover is by manual reset (button).

Anybody have a fix for this?

Thanks.

I don’t know, but my guess would be that you are using a lot of String manipulation or other dynamic memory management.

Thanks. I thought the same thing so I tried freeMemory() to assess the stack allocation. The returned value indicated I have plenty of margin (>40kB). Does this function work for such purpose?

@rcalderon, freeMemory() returns the available heap space but does not speak to the fragmentation within that space. The more fragmentation, the smaller the “largest” available block becomes until finally a required block can’t be allocated.

1 Like