2
\$\begingroup\$

Struggling with this issue for days now and can't find a solution. Maybe someone saw something like this before and can give me a hint.

I have FreeRTOS running on an STM32L4 with different tasks. One of these tasks should handle CAN communication.

In the CAN interrupt enable register (CAN_IER) I set the enable for ERRIE, BOFIE, EPVIE, FMPIE0 and TMEIE. The application ends up in an infinite loop error with the following trace

Call Trace

I figured out that if I remove the enable for the TMEIE (Transmit mailbox empty interrupt enable) the application starts to run normally but also crashes as soon as one of the other interrupts trips (e.g. if a message is received).

Is this something obvious, maybe an issue with my interrupt handling? Or can someone guide me in the right direction?

\$\endgroup\$
11
  • \$\begingroup\$ Without all the source we're very unlikely to be able to help. \$\endgroup\$
    – pjc50
    Commented Oct 6, 2020 at 13:44
  • 4
    \$\begingroup\$ Looks to me as though you aren't handling the CAN interrupts. Have you written or included any code for functions like CAN1_TX_IRQHandler(), CAN1_RX0_IRQHandler(), etc? \$\endgroup\$
    – brhans
    Commented Oct 6, 2020 at 13:46
  • \$\begingroup\$ I can't provide all the source as on one hand it's huge and on the other hand I'm not the owner of all of it. I was therefore hoping that this behavior is typical for a certain mistake (e.g. wrong interrupt initialization). \$\endgroup\$
    – po.pe
    Commented Oct 6, 2020 at 13:47
  • \$\begingroup\$ @brhans There's a proprietary CANopen stack running that should handle that, at least that's my expectation. Altough searching the project for CAN1_TX_IRQHandler() didn't give any result... \$\endgroup\$
    – po.pe
    Commented Oct 6, 2020 at 13:49
  • 2
    \$\begingroup\$ It was indeed the missing IRQHandler, sometimes you just miss the forrest for the trees. Anyway thousand thanks for the hint! @vicatcu None of their sources is open for download, including the documentation \$\endgroup\$
    – po.pe
    Commented Oct 6, 2020 at 14:46

1 Answer 1

0
\$\begingroup\$

It trurned out that the implementation of the IRQHandler was missing...

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.