nxp-mcuxpresso/mcux-sdk

[BUG] FLEXCAN driver uses wrong base address argument in FLEXCAN2 IRQ Handler

Closed this issue · 0 comments

Describe the bug

When handling FLEXCAN2 related interrupts in void CAN_FD2_DriverIRQHandler(void) defined in drivers/flexcan/fsl_flexcan.c the FLEXCAN_TransferHandleIRQ handler is called with the wrong base address pointer. This breaks interrupt handling for FLEXCAN2 and makes the "transactional API" useless.

To Reproduce

  • Environment (please complete the following information):
    • Tag/Commit hash: any since MCUX_2.10.0
    • Toolchain: arm-none-eabi-gcc 12.2.0
    • Board/SoC: MIMX8ML8
    • IRQ/ISR: CAN_FD2_IRQn/CAN_FD2_DriverIRQHandler
  • Steps to reproduce the behavior:
    1. Initialize a FLEXCAN transactional handle using FLEXCAN_TransferCreateHandle for FLEXCAN2
    2. Wait for and interrupt to occur for FLEXCAN2
    3. check the base argument to the callback function registered with FLEXCAN_TransferCreateHandle

Expected behavior

The registered callback function is called with the correct base address for FLEXCAN2, but in fact it is called with the base address for FLEXCAN1

Screenshots and console output

swappy-20221206-094724

Additional context
none