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.

AM263P4: MCAN - Trouble Disabling filtration and receiving messages

Part Number: AM263P4

Tool/software:

I am working with the AM263Px-cc on a proof of concept project, and I am currently trying to get the mcan peripheral receiving messages.

I have loaded the mcan_external_read_write example project from MCU+ SDK for AM263Px - 09.02.00.55. 

I have updated the syscfg to set the mcan peripheral to CAN4 to take advantage of the CAN transceiver on the control card.  The project builds successfully and I am able to enter debug mode as expected, and I am to transmit messages.

I am attempting to disable all filtration, and I have followed the documentation and set the ANFE and ANFS both to 0 during the initialization process.  When I send a provide a valid CAN message to the AM263P, I am able to reach a breakpoint in the ISR. The ISR uses the MCAN_getIntrStatus() function to retrieve the MCAN IR register. This function returns a value of 8, and according to the documentation on the registers this indicates "Rx FIFO 0 Message Lost Reset Source".

I have tried reading all messages out of both FIFO's, but I can't seem to get the MCAN IR register to return a value of 1 or 16 (indicating a new message is present in FIFO0 or FIFO1).

All I need to do is disable all MCAN filtration then use the ISR to trigger a read of incoming CAN messages, but I think that there are other settings besides the ANFE and ANFS that need to be adjust to get this to work.

  • I was able to get this partially working. The code in the mcan_external_read_write example project sets the APP_MCAN_FIFO_0_CNT to 0 which causes all messages to be discarded due to no available FIFO registers.  

    I am not encountering issue where using the MCAN_read_MsgRam() function doesn't seem to do anything to empty the FIFO.  I am able to send a single CAN message to the AM263P, read the message using the MCAN_readMsgRam() function, then check the status of the FIFO 0 using the MCAN_getRxFIFOStatus() function. As I continue to send single messages and read them from the FIFO, the fillLvl returned from the MCAN_getRxFIFOStatus() continues to increment until it reaches 64 (which is the size I have set the APP_MCAN_FIFO_0_CNT). After that, the fifoFull flag goes high and messages get rejected.  Is there a different command I need to use that will read from the RX FIFO that will clear out the RX FIFO as it reads?

    Also, I would like to note that the documentation surrounding this is poor. In the API guide, the descriptions of the the elements of the MCAN_RxFIFOStatus almost exactly match the element name and don't describe what they represent. In the Register Addendum, the description of the RXF0S register has the short description and long description as "RXF0S" which is not helpful. Additionally the Register Addendum descriptions of the register elements is not helpful to describe the data actually contained in the register.  I had hoped that the Technical Guide would provide more information about how to correctly interpret these registers and put them to use, but it doesn't. 

  • Hello Nathan,

    Thank you for your feedback regarding the status of MCAN API, TRM, and RA content. We will use this information to drive efforts for content review and refresh.

    After using the MCAN_read_MsgRam() function, you must also write an RX FIFO acknowledgement with the MCAN_writeRxFIFOAck() function.

    By providing the acknowledge index number, the FIFOx Get Index will be incremented and the previously "read" message will fall out of the queue.

    Best Regards,

    Zackary Fleenor

  • Can you please direct me to the document where you have found this information? I am unable to locate it in the Technical Manual, API guide, or register addendum.

  • Hey Nathan,

    This information is described as part of the Bosch MCAN User Guide and the CAN ISO-11898 standard.

    https://www.bosch-semiconductors.com/media/ip_modules/pdf_2/m_can/mcan_users_manual_v331.pdf

    M_CAN | Bosch semiconductors for Automotive (bosch-semiconductors.com)

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/10_00_00_35/exports/docs/api_guide_am263x/group__DRV__MCAN__MODULE.html#gaf58b4fcb5b5a402a928b4a7ee193ada3

    I think this process has just been expected by default since it is defined in the protocol itself and hence has not been clearly stated in our current documentation. I will review with the team and determine the proper place to include this information.

    Best Regards,

    Zackary Fleenor