Arm Mbed OS support forum

CellularModem and deepsleep, once again

Hello Pros,
i try since a few days now to solve a problem, that can´t be so hard to solve i think:
I´ve got a little custom dev-board (DISCO-L475-IOT connected to an UBLOX-201) that shall read some sensor-values, send it to a cloud and sleep for a set ammount of time.
The device will be battery-powered, so the sleep should be a deepsleep of course. Without the modem-code the deepsleep works well with a wake-up-timer set.
But when i create a CellularContext like in the cellular-example the deepsleep is blocked by the serial-base opend by the cellularcontext.
i´ve found a discuss on github where the threadstarter ended in changing the mbed-files, but i don´t think this is a option due to update-problems, or am i wrong?
Saddly, i´m a relatively noob on cpp. Till now i used small 8-Bit PICs with plain c code.
So maybe i just missunderstood something?
Make is short:
How to free the NetworkInterface or the cellularcontext including the serialbase to unlock deepsleep again?
Thank you!

You need to call
SerialBase::enable_input(false); SerialBase::enable_output(false)
before attempting to enter deepsleep and then
SerialBase::enable_input(true); SerialBase::enable_output(true)
after waking up. These methods enable and disable the interrupt request lines for Serial.