Skip to content

Board will not enter Deep Sleep after communications with Cell Module #11413

@JRubis

Description

@JRubis

Description

Hi,

My board is an STM32l4-discovery with Quectel BG96 connect via the ST-MOD+ connector.
I am using mbed-OS and the commit is : 279f4cd from 7/10/2019. I can't use an official release because the additions that support cellular through the ST-MOD+ connection will not be available until v5.14.

If I run the following code, my board behaves well and results in an average MCU current draw of around 15uA.

int main() {

   mbed_file_handle(STDIN_FILENO)->enable_input(false);

   while (1) {
       led = !led;
       ThisThread::sleep_for(60000);

       mbed_stats_cpu_t stats;
       mbed_stats_cpu_get(&stats);
       printf("Uptime: %llu ", stats.uptime / 1000);
       printf("Sleep time: %llu ", stats.sleep_time / 1000);
       printf("Deep Sleep: %llu\n", stats.deep_sleep_time / 1000);
}
...
}

If however I access the BG96 to read its cellular information and then enter this "sleep loop" the current consumption is around 7mA. Obviously something is blocking deep sleep and I am not sure what it is. Is it the UART that is used for communication between the MCU and BG96? Is it the AT Service? Something else...

I have tested in both AT and PPP modes.

I attempted to enable "MBED_SLEEP_TRACING_ENABLED" to see what is blocking sleep but that results in the application not getting to main(). I think its possibly running very slowly as opposed to crashing. I have bumped the "rtos.idle-thread-stack-size" to 1024 and that doesn't help.

If I place a break point in the function sleep_manager_lock_deep_sleep_internal() I can see repeated calls from static void LPTIM1_IRQHandler(void).

Ultimately what I am attempting to achieve is to wake up at a periodic interval connect to a server via cell, send some data, disconnect and then reenter deep sleep. What network or device API's calls are required to shutdown the network / device to achieve this?

Issue request type

[x] Question
[ ] Enhancement
[ ] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions