2021-10-19 10:32 PM
Hi all,
I work with STM32F413 and CMSIS os.
I have a problem when I put the CPU in sleep mode by HAL_PWR_EnterSTOPMode.
In the os_idle_demon I need to disable one external interrupt, do some job and enable again the interrupt and so on.
My problem is that the interrupt is always disabled.
Please your help,
Shush
Here is peace of my code:
void os_idle_demon (void)
{
for (;;)
{
while(x)
{
HAL_SuspendTick() ;
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);
SystemClock_Config();
HAL_NVIC_EnableIRQ(irqType) ;
DoSomeJob();
HAL_NVIC_DisableIRQ(irqType) ;
HAL_ResumeTick() ;
}
}
}
2021-10-20 06:56 AM
> I need to disable one external interrupt, do some job and enable again the interrupt and so on.
> HAL_NVIC_EnableIRQ(irqType) ;
> DoSomeJob();
> HAL_NVIC_DisableIRQ(irqType) ;
Your text says one thing but your code does the opposite.
How are you verifying that it's always disabled? What IRQ is it?
2021-10-20 07:41 AM
Hi @TDK ,
You are right. The example is wrong. The explanation is correct: " I need to disable one external interrupt, do some job and enable again the interrupt and so on".
I'm verify the status, by the status on NVIC->ISER and NVIC->ICER ant there all is OK.
This is External IRQ "EXTI9_5_IRQn".
Shush
2021-10-23 10:54 PM
Hi,
I want to clarify something:
In DoSomeJob() I communicate with the One-Wire bus. All is perfect, but when I finish it and enable the IRQ and the CPU goes to the stop mode , I see in scope that the OneWire bus is in high level(OK) but when one wire device(keypad) try to make a pulse in the bus - it couldn't. If I don't call the DoSomeJob() all is ok. I think I need to do something in the bus when DoSomeJob() is finished. But What????
Shush