I have a bit of a head scratcher. I would think it’s a memory issue on my end, except that everything I do seems to point toward the TCPClient lib.
My code starts hard faulting after several loops, always at the moment that the MQTT lib checks that the TCPClient is connected. I’ve turned off compiler optimizations for the relevant functions, so it’s very clearly happening in the call to
TCPClient::connected(). And of course that’s the point where it disappears into the bowels of the OS
0.7.0 or 0.8.0-rc.11 doesn’t make a difference, it still fails at the same spot.
However, if I start moving memory around, e.g. putting local variables into the global stack, then by magic things start working again. This very strongly points toward a memory issue, but I can’t for the life of me figure it out.
Has anyone seen anything similar? I know I’ve read several reports of TCPClient instability, but it’s all too convenient to blame an outside lib. I haven’t installed local compiler tools, is there a way to download the elf as part of the Particle CLI compile command?