Hello everyone,
I’m facing an annoying issue regarding power consumption of my board featuring a BG95-M3 module and a stm32u575 microcontroller (from ST). The purpose of such configuration is to send some data over to a server by exploiting a cellular protocol.
I’m clarifying the situation:
I used to handle my system with simple AT commands for sending FTP data. So I consulted the datasheet provided by Quectel and everything seemed to be okay.
Since my application requires to be as low power as possible, the microcontroller stays awake just to acquire and send data. After that it goes to standby mode.
In a similar fashion I force the modem BG95 to do the same as written down below.
uint16_t BG96_SwitchOff(void)
{
uint16_t ret;
int conta=0;
while((HAL_GPIO_ReadPin(BG96_STAT_GPIO_Port, BG96_STAT_Pin)==1)&&(conta<5))
{
myUartPrintf("Switch off\r\n");
ret=AT_SendCommand(LTE_QPOWD,WAIT_PWRDN, LTE_MAX_RESPONSE_TIME_QPOWD,1);
conta++;
HAL_Delay(500);
REFRESH_IWDG; // refresh watchdog
}
if (HAL_GPIO_ReadPin(BG96_STAT_GPIO_Port, BG96_STAT_Pin)==1)
{
HAL_GPIO_WritePin(LTE_RESET_GPIO_Port, LTE_RESET_Pin, GPIO_PIN_RESET);
// GPIOB -> ODR |= GPIO_ODR_OD2;
HAL_Delay(800);
myUartPutStr("Spegnimento via reset pin\r\n");
REFRESH_IWDG; // refresh watchdog
HAL_GPIO_WritePin(LTE_RESET_GPIO_Port, LTE_RESET_Pin, GPIO_PIN_SET);
}
return 0;
}
where LTE_QPOWD:
#define LTE_QPOWD “AT+QPOWD=0\r”
Basically I either used the AT+POWD command or the reset procedure.
This led to a power consumption in standby case equal to 50/70 uA.
In a second firmware version of this system I switched to MQTT protocol and I exploited a development board example provided directly by st on their website (link here: X-CUBE-AZURE - Microsoft Azure software expansion for STM32Cube - STMicroelectronics)
Here the AT commands are handled by the system itself at low level without the need for the coder to do nothing basically.
However, when it comes to enter standby mode, the modem seems to be powered down (i check the status bit which returns a value of 0 indeed) but the power consumption is around 0.7 mA.
The already implemented funcion to power down the modem is the following one:
/**
- @brief Clean switch off of modem
- @param -
- @retval -
/
CS_Status_t CST_modem_power_off(void)
{
CS_Status_t cs_status;
dc_cellular_info_t cellular_info;
#if (USE_LOW_POWER == 1)
dc_cellular_power_status_t dc_power_status;
#endif / (USE_LOW_POWER == 1) */
PRINT_CELLULAR_SERVICE(“CST_modem_power_off\n\r”)
cs_status = CELLULAR_OK;
(void)dc_com_read(&dc_com_db, DC_CELLULAR_INFO, (void )&cellular_info, sizeof(dc_cellular_info_t));
if ((cellular_info.modem_state == CA_MODEM_NETWORK_REGISTERED) ||
(cellular_info.modem_state == CA_MODEM_STATE_DATAREADY))
{
/ if data connection is established, we need to detach properly from network */
#if (USE_LOW_POWER == 1)
(void)dc_com_read(&dc_com_db, DC_CELLULAR_POWER_STATUS, (void *)&dc_power_status,
sizeof(dc_cellular_power_status_t));
if ((dc_power_status.power_state == DC_POWER_LOWPOWER_ONGOING) ||
(dc_power_status.power_state == DC_POWER_IN_LOWPOWER))
{
/* if low power is used, and modem in low power mode, wakeup the modem */
PRINT_CELLULAR_SERVICE("CST: Wakeup modem\n\r")
PRINT_CELLULAR_SERVICE("CST: osCS_PowerWakeup()\n\r")
cs_status = osCS_PowerWakeup(HOST_WAKEUP);
}
if (cs_status == CELLULAR_OK)
#endif /* (USE_LOW_POWER == 1) /
{
PRINT_CELLULAR_SERVICE(“CST: Detach from network\n\r”)
PRINT_CELLULAR_SERVICE(“CST: osCS_detach_PS_domain()\n\r”)
cs_status = osCS_detach_PS_domain();
}
}
#if (USE_LOW_POWER == 1)
CSP_StopTimeout();
#endif / (USE_LOW_POWER == 1) */
if (cs_status == CELLULAR_OK)
{
PRINT_CELLULAR_SERVICE("CST: Power off modem\n\r")
PRINT_CELLULAR_SERVICE("CST: osCDS_power_off()\n\r")
//BG95_SwitchOff();
cs_status = osCDS_power_off();
}
return (cs_status);
}
There are no other differences neither in hardware nor firmware configuration, so I’m afraid that the modem is not correctly driven low.
I’m assuming this because it also happended (some times) that the power consumption, by following the exact same procedure I have described, is about 50/70 uA as I expect.
Does anyone have an idea about this?
Let me know please, thank you in advance!
Elia