Initiating a reset within an OpenAT application

I’ve been trying to implement a software driver reset in my SL6087-based design. I have traditionally:

adl_atCmdCreate("AT+CFUN=1,0", ADL_AT_PORT_TYPE(ADL_PORT_UART1, false),
        NULL, NULL);

Which instructs OpenAT to perform the reset. This used to work, but for some reason no longer results in the system rebooting. Is there another way to signal a reset?

And incidentally, I can still issue the above command directly to the AT console and the unit performs a reset, so I know it is still posibble, it just isn’t working from within my application code.

What return code do you get from adl_atCmdCreate() ?

If you provide a response handler, and subscribe all responses, what response do you get?

adl_errHalt() can also be used to perform a reset - although you should detach first, to be tidy.

Is it possible just to

while (true);

within the application and have it reset by the watchdog?

Possible - but not recommended!

I’d use adl_errHalt() instead.

Well, why not recommended? What could go wrong?

You are relying on the Watchdog, which is a “disaster recovery” mechanism - not intended to be deliberately used by the application.

It’s like stopping your car by deliberately crashing into a wall.

adl_errHalt() is specifically provided for this exact purpose - so use it!

It also allows you to create a Backtrace entry…

From what I read adl_errHalt() MIGHT be stopped by something registering as error handler. I cannot assure that third-party libraries don’t do that.

Besides, can using watchdog all the time cause the device to break? Some of my devices have been doing that whole night(server internet outage), and now they don’t reconnect… Can’t track the issue to some other error than client-side.

https://forum.sierrawireless.com/t/watchdog-reset-on-purpose/5399/1