cancel
Showing results for 
Search instead for 
Did you mean: 

what is the status of gpio output at lprun mode stm32l4?

alianvari
Associate III

I use stm32l496. before entering the low power run mode I set the output but when micro enter lprun the output is reset.

I want to know what the status of the outputs is at low power mode?

and

can the outputs be changed or read?

thank's.

2 REPLIES 2
TDK
Guru

From the manual:

In Low-power run mode, all I/O pins keep the same state as in Run mode.

I see no reason why they could not be changed or read in LP run mode.

If you feel a post has answered your question, please click "Accept as Solution".

I pasted my code.

Is my code wrong?

thanks.

HAL_GPIO_WritePin(DO4_GPIO_Port,DO4_Pin,GPIO_PIN_SET);

HAL_Delay(2000);

HAL_GPIO_WritePin(Temp_PWR_GPIO_Port,Temp_PWR_Pin,GPIO_PIN_SET);//power off Temp PWR

HAL_SPI_MspDeInit(&hspi1);

HAL_GPIO_DeInit(TempAD_CS_GPIO_Port, TempAD_CS_Pin);

SystemClock_Decrease();   

HAL_SuspendTick();

HAL_PWREx_EnableLowPowerRunMode();

if(HAL_GPIO_ReadPin(DO4_GPIO_Port,DO4_Pin)!=GPIO_PIN_RESET && a==0)

{

output_flag=1;

a=1;

}

else if(HAL_GPIO_ReadPin(Lock_btn_GPIO_Port,Lock_btn_Pin)!=GPIO_PIN_SET && a==1)

{

a=0;

}

if(output_flag==1)

{

HAL_PWREx_DisableLowPowerRunMode();

SystemClock_Config();

HAL_Init();

HAL_ResumeTick();

MX_GPIO_Init();

huart1.gState = HAL_UART_STATE_RESET;

MX_USART1_UART_Init();

debug("DO4 ON\r\n");

HAL_GPIO_WritePin(Temp_PWR_GPIO_Port,Temp_PWR_Pin,GPIO_PIN_SET);//power off Temp PWR

HAL_SPI_MspDeInit(&hspi1);

HAL_GPIO_DeInit(TempAD_CS_GPIO_Port, TempAD_CS_Pin);

SystemClock_Decrease();   

HAL_SuspendTick();

HAL_PWREx_EnableLowPowerRunMode();

output_flag=0;

}