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.
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  Topic is solved

Postby fresird » Mon May 18, 2020 4:18 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: pal Callback is not called with ch version 20.3.1

Postby Giovanni » Mon May 18, 2020 4:56 am

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

Postby fresird » Mon May 18, 2020 5:30 am

the Line is PAL_LINE(GPIOD, 2U)

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: pal Callback is not called with ch version 20.3.1

Postby Giovanni » Mon May 18, 2020 6:03 am

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

Postby fresird » Mon May 18, 2020 6:49 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: pal Callback is not called with ch version 20.3.1

Postby Giovanni » Mon May 18, 2020 6:59 am

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

Postby fresird » Mon May 18, 2020 7:08 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: pal Callback is not called with ch version 20.3.1

Postby Giovanni » Mon May 18, 2020 7:10 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: pal Callback is not called with ch version 20.3.1

Postby Giovanni » Mon May 18, 2020 7:25 am

Fixed as bug #1095.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 64 guests