pal Callback is not called with ch version 20.3.1 Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
fresird
Posts: 5
Joined: Thu Oct 13, 2016 9:13 am
Been thanked: 2 times

pal Callback is not called with ch version 20.3.1

Post by fresird »

Hi! I have a project use Chibios19.1.3. I upgrade to the lastest Chibios_20.3.1. After that, the pal callback is not working.
I use "palEnableLineEvent" and "palSetLineCallback" the set the line and the callback function. the hardware is stm32f765zg, I set the chip define to "STM32F767xx" to "board.h" and I have checked the config file with "RT-STM32F767ZI-NUCLEO144", also I have used a scope to check the line signal. After switching to Chibios_20.3.x, the callback function is never called. any idea how to debug or fix this problem?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: pal Callback is not called with ch version 20.3.1

Post by Giovanni »

Hi,

Moving in "bug reports", which EXTI is not working exactly?

Giovanni
fresird
Posts: 5
Joined: Thu Oct 13, 2016 9:13 am
Been thanked: 2 times

Re: pal Callback is not called with ch version 20.3.1

Post by fresird »

the Line is PAL_LINE(GPIOD, 2U)
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: pal Callback is not called with ch version 20.3.1

Post by Giovanni »

Hi,

Could you check if the ISR is reached by placing a breakpoint? it is in stm32_exti2.inc, it is better if you compile with -O0 or the breakpoint could be skipped.

Giovanni
fresird
Posts: 5
Joined: Thu Oct 13, 2016 9:13 am
Been thanked: 2 times

Re: pal Callback is not called with ch version 20.3.1

Post by fresird »

Hi!

the ISR is reached !
pr = 4
exti_serve_irq(pr, 0);

stm32_isr.c line 43:
#define exti_serve_irq(pr, channel) { \
\
if ((pr) & (1U << (channel))) { \
_pal_isr_code(channel); \
} \
}

so _pal_isr_code(channel) function is not called?
Attachments
Capture2.PNG
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: pal Callback is not called with ch version 20.3.1

Post by Giovanni »

This is good, could you step into exti_serve_irq() and see which condition prevents the callback call? it is not far from there.

Edit: Nevermid, found the problem:

At line 84:

exti_serve_irq(pr, 0);

should be:

exti_serve_irq(pr, 2);

Giovanni
fresird
Posts: 5
Joined: Thu Oct 13, 2016 9:13 am
Been thanked: 2 times

Re: pal Callback is not called with ch version 20.3.1

Post by fresird »

Hi! I edited the last post. It is exti_serve_irq(pr, 0); prevents the callback,
becaure pr = 4, and ((pr) & (1U << (0))) == 0.
I tempeory change exti_serve_irq(pr, 0); to exti_serve_irq(pr, 2); So that I can use the new Chibios_20.3.1
thanks for the help.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: pal Callback is not called with ch version 20.3.1

Post by Giovanni »

We posted at same time, anyway, it is a bug, it will be fixed in next release. EXTI4 contained the same error.

Your fix is correct.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: pal Callback is not called with ch version 20.3.1

Post by Giovanni »

Fixed as bug #1095.

Giovanni
Post Reply