LPTIM Disable Behavior and Interrupt Masking
We are currently using LPTIM1 to measure the time period. As this operation needs to be performed frequently, we are using the following APIs:
- HAL_LPTIM_TimeOut_Stop_IT(&hlptim1)
- HAL_LPTIM_TimeOut_Start_IT(&hlptim1, 0xXXXX, 0xXXXX)
During this process, the LPTIM_Disable() function temporarily disables all interrupts using PRIMASK while waiting for the LPTIM_FLAG_ARROK and LPTIM_FLAG_CMPOK flags.
This global interrupt masking is causing data loss on LPUART1, which is operating at 115200 baud. As a result, we are encountering ORE (Overrun Error) due to missed UART interrupts.
Given this behaviour, we would like your guidance on the following:
- Is it safe to modify the LPTIM_Disable() implementation by removing or commenting out the PRIMASK-based global interrupt disable?
- Alternatively, is there a recommended approach to avoid this blocking behaviour while still ensuring correct LPTIM operation?
We are concerned about maintaining real-time UART reception alongside frequent LPTIM reconfiguration.
