This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM263X: Few Rx CAN messages are not received

Part Number: MCU-PLUS-SDK-AM263X

Hi TI Experts,

I have total 15 Rx messages, which i am currently sending to the ECU on demand (not  cyclic) out of which i can see for 11 of them are received properly and the bit 19(DRX) of MCAN0_CFG_IR is getting set, but when i send the rest 4 messages,ISR is triggered but the DRX bit is not set instead the bit 7(RF1L) is getting set.

i am not using Rx Buffers instead of  RX FIFO, so its bit strange for me. can some one please guide me if i need to check something else.

Thanks

Bikash

  • sorry for the typo in the previous message, i am using Rx Buffers for message reception

  • Hi Bikash,

    Rx handling for dedicated Rx buffers is described in the AM263x TRM (spruj17a.pdf), Section 13.4.1.4.7.3 Dedicated Rx Buffers.

    See the Rx Handling requirements described in Section 13.4.1.4.7.3.1 Rx Buffer Handling.

    Rx Buffer Handling include the following steps:

    • Reset interrupt flag MCAN_IR[19] DRX
    • Read New Data registers
    • Read messages from Message RAM
    • Reset New Data flags of processed messages

    The AM263x MCU+SDK includes an MCAN driver and several example programs for MCAN in different use cases.

    There is an MCAN loopback example using Rx buffers here: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/08_03_01_06/exports/docs/api_guide_am263x/EXAMPLES_DRIVERS_MCAN_LOOPBACK_INTERRUPT.html

    There is also an external loopback example using Rx buffers for the AM64x here which you can consult: https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/08_03_00_18/exports/docs/api_guide_am64x/EXAMPLES_DRIVERS_MCAN_EXTERNAL_LOOPBACK_INTERRUPT.html

    Regards,
    Frank

  • Hi Frank,

    Thank you for the inputs, i am following the steps mentioned by you.

    Issue  that I am facing is sometime even the Rx messages are seen on the CAN bus, the register MCAN_IR  [3 or 7 and 8] are getting set instead of bit19.

    any idea in which condition the bit 8(High Priority message) should set ?
    Also my assumption regarding bit3 & bit7(RF0L , RF1L) should set only if i am using Rx FIFO.

    BR

    Bikash

  • Hi Bikash,

    Are you writing your own driver or using the MCAN driver in the MCU+SDK? I highly suggest you review the SDK example code I shared since it follows the TRM for Rx handling in Rx buffer mode.

    I notice this in the TRM, Section 12.4.1.4.7.1 Acceptance Filtering:

    Depending on the configuration of the filter element (see SFEC/EFEC in Section 12.4.1.4.10, Message RAM) if filter matches, one of the following actions is performed:

    • Set High Priority Message interrupt flag MCAN_IR[8] HPM
    • Set High Priority Message interrupt flag MCAN_IR[8] HPM and store received frame in FIFO 0 or FIFO 1

    Perhaps there is a mistake in your filter configuration.

    Regards,
    Frank

  • Hi Frank,

    Thank you for the inputs.

    Yes I am trying to write standardized CAN driver with help of MCU+SDK examples.

    I have referred the buffer handling from the examples present in MCU+SDK 8.03.01.05

    As you rightly pointed out there was a mistake in my acceptance filter configuration, few Rxbuffers which are not used as per my configuration i was not disabling them, seems the default values in these filter elements was leading to this unexpected behaviour.

    now I have added the highlighted part shown below for the filter initialisation, this resolved the issue.

    after this modification the MCAN_IR[19 DRX] always getting set for a successful reception.

    BR

    Bikash