cancel
Showing results for 
Search instead for 
Did you mean: 

Low-Level Driver

prsh
Associate II

Hello

I have been working on some project which require external interrupt (EXTI). It is a custom PCB with stm32L476vgtx MCU. I am able to verify interrupt via HAL library but unable to do so with the LL driver library. I have used the repository example to do so but no luck. I have never worked with LL drivers before, so anyone could please guide me what could possibly go wrong. I have only changed the pin configuration mentioned in the example, nothing else.

Thanks in advance!

10 REPLIES 10
TDK
Guru

Probably you aren't using the correct EXTI callback. The interrupt handler name is different for different pins. Show your code, what did you change specifically?

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

Read out and check content of EXTI registers.

Some generic "interrupt does not work" debugging hints here.

JW

@TDK, EXTI callback? Does Cube/LL use the same unified-driver-then-callback mechanism as Cube/HAL?

prsh
Associate II

EXTI15_10_IRQHandler as callback function.

#define USER_BUTTON_IRQHANDLER EXTI15_10_IRQHandler

void USER_BUTTON_IRQHANDLER(void)
{
/* Manage Flags */
if(LL_EXTI_IsActiveFlag_0_31(USER_BUTTON_EXTI_LINE) != RESET)
{
LL_EXTI_ClearFlag_0_31(USER_BUTTON_EXTI_LINE);

/* Manage code in main.c.*/
UserButton_Callback();
}
}

prsh
Associate II

The same hardware is working fine with HAL library. Been using the same port/pin which is working with HAL.

 

LL doesn't have a unified callback like HAL, it just puts code in the IRQ handler itself (as below).

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

And what is USER_BUTTON_EXTI_LINE? Is it a pin between 10 and 15? If not, callback will be different.

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

PE11 as EXTI.

Is PE11 selected as EXTI11 input in respective SYSCFG_EXTICRx?

JW

Yes it is.