MCAN
====

Introduction
------------

The MCAN (Controller Area Network) module implements the CAN protocol with support 
for CAN 2.0 A, B and FD and enables seamless communication over a CAN bus. Each 
MCAN module supports flexible bit rates greater than 1 Mbps and is compliant to 
ISO 11898-1:2015. They connect to the physical layer of the CAN network through 
external (for the device) transceivers.
The MCAN controller is responsible for message reception, transmission and 
management of the communication protocol. It supports both classic CAN and CAN FD 
(CAN with Flexible Data-Rate) specifications allowing a higher throughput and 
increased payload per data frame. The classic CAN and CAN FD devices can coexist 
on the same network without any conflict. It also provides advanced Error detection 
mechanisms to ensure reliable communication.


Features Supported
------------------

 - Conforms with CAN Protocol 2.0 A, B and ISO 11898-1:2015
 - Full CAN FD support (up to 64 data bytes)
 - Up to 32 dedicated Transmit Buffers
 - Configurable Transmit FIFO, up to 32 elements
 - Configurable Transmit Queue, up to 32 elements
 - Configurable Transmit Event FIFO, up to 32 elements
 - Up to 64 dedicated Receive Buffers
 - Two configurable Receive FIFOs, up to 64 elements each
 - Up to 128 filter elements
 - Internal Loopback mode for self-test
 - Maskable interrupts, two interrupt lines
 - Timestamp Counter



Test Setup
----------

Internal Loopback  
^^^^^^^^^^^^^^^^^
     
No Setup required                                        


External Loopback
^^^^^^^^^^^^^^^^^
 
.. ifconfig:: CONFIG_family in ('jacinto')

    1. The GESI daughtercard is to be connected to J51 and J46 Expansion connectors on the board.   
    2. Connect MCAN instances using jumper wires.
    3. For MCU1_0, MCU_MCAN0 and MCU_MCAN1 transceivers should be connected. These are J30 and J31 on the CPB.

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_External_MCU.png
      :scale: 50

    4. For MCU2_1, MAIN_MCAN4 and MAIN_MCAN5 should be connected. These are J12 and J14 on the GESI board.

    .. figure:: ../../images/mcan/J721E_J7200_External_MAIN.png
      :scale: 50

.. ifconfig:: CONFIG_family in ('j7200')

    1. The GESI daughtercard is to be connected to J51 and J46 Expansion connectors on the board.   
    2. Connect MCAN instances using jumper wires.
    3. For MCU1_0, MCU_MCAN0 and MCU_MCAN1 transceivers should be connected. These are J30 and J31 on the CPB.

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_External_MCU.png
      :scale: 50

    4. For MCU2_1, MAIN_MCAN4 and MAIN_MCAN5 should be connected. These are J12 and J14 on the GESI board.

    .. figure:: ../../images/mcan/J721E_J7200_External_MAIN.png
        :scale: 50

.. ifconfig:: CONFIG_family in ('j721s2')

    1. The GESI daughtercard is to be connected to J51 and J46 Expansion connectors on the board.   
    2. Connect MCAN instances using jumper wires.
    3. For MCU1_0, MCU_MCAN0 and MCU_MCAN1 transceivers should be connected. These are J30 and J31 on the CPB.

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_External_MCU.png
        :scale: 50

    4. For MCU2_1, MAIN_MCAN4(J6-MC9) and MAIN_MCAN16(J10) should be connected. J10 is on SOM, J6 is on GESI card.

    For MAIN_MCAN4

    .. figure:: ../../images/mcan/J721S2_external_MAIN4.png
        :scale: 20

    For MAIN_MCAN16

    .. figure:: ../../images/mcan/J721S2_external_MAIN16.png
        :scale: 20

.. ifconfig:: CONFIG_family in ('j784s4')

    1. Connect MCAN instances using jumper wires.
    2. For MCU1_0, MCU_MCAN0 and MCU_MCAN1 transceivers should be connected. These are J42 and J43 on the CPB.

    .. figure:: ../../images/mcan/J784S4_external_MCU1.png
        :scale: 150

    .. figure:: ../../images/mcan/J784S4_external_MCU.png
        :scale: 150

    3. For MCU2_1, MAIN_MCAN4 and MAIN_MCAN16 should be connected. These are J45 and J46 on the CPB.

    .. figure:: ../../images/mcan/J784S4_external_MAIN1.png
        :scale: 150

    .. figure:: ../../images/mcan/J784S4_external_MAIN.png  
        :scale: 150

Transmitter   
^^^^^^^^^^^

.. ifconfig:: CONFIG_family in ('jacinto')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above. 

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_Transmitter_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J721E_J7200_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


.. ifconfig:: CONFIG_family in ('j7200')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above.

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_Transmitter_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J721E_J7200_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


.. ifconfig:: CONFIG_family in ('j721s2')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above. 

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_Transmitter_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J721S2_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


.. ifconfig:: CONFIG_family in ('j784s4')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above. 

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J784S4_transmit_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J784S4_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


Receiver   
^^^^^^^^

.. ifconfig:: CONFIG_family in ('jacinto')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above. 

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_Receiver_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J721E_J7200_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


.. ifconfig:: CONFIG_family in ('j7200')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above.

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_Receiver_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J721E_J7200_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


.. ifconfig:: CONFIG_family in ('j721s2')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above. 

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J721E_J7200_J721S2_Transmitter_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J721S2_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


.. ifconfig:: CONFIG_family in ('j784s4')

    1. Download PCAN-VIEW https://www.peak-system.com/PCAN-View.242.0.html?&L=1
    2. Connect PCAN module to the MCAN instance specified in the Test Cases table above. 

    PCAN Connections

    .. figure:: ../../images/mcan/PCAN_pins.png
        :scale: 30

    For MCU1_0

    .. figure:: ../../images/mcan/J784S4_receive_MCU.png
        :scale: 50

    FOR MCU2_1

    .. figure:: ../../images/mcan/J784S4_transmit_receive_MAIN.png
        :scale: 50

    3. Connect PCAN Module in PCAN-View.


Applications
------------

Examples
^^^^^^^^

+-----------------------+------------------------------------+-----------------------+
| Name                  | | Description                      | | Supported SOCs      |
+=======================+====================================+=======================+
| MCAN Unit Test        | | Example comprises of various     | | J721E               |
| application           |   testcases to test functionality  |   J721S2              |
|                       |   of the module using both Classic |   J7200               |
|                       |   CAN and CAN FD. It supports      |                       |
|                       |   internal loopback, receiver,     |                       |
|                       |   transmitter and B2B modes.       |                       |
+-----------------------+------------------------------------+-----------------------+
| MCAN EVM Loopback     | | Example operates as either       | | J721E               |
| application           |   transmitter, receiver CAN        |   J7200               |
|                       |   nodes. Also, supports digital    |   J721S2              |
|                       |   loop back mode.                  |   J784S4              |
|                       |   With 2 boards, can be used to    |                       |
|                       |   emulate 2 node CAN network with  |                       |
|                       |   one as transmitter and the       |                       |
|                       |   other as receiver.               |                       |
|                       |   It also provides an External     |                       |
|                       |   Loopback test, where one MCAN    |                       |
|                       |   instance is configured as        |                       |
|                       |   transmitter and the other as     |                       |
|                       |   receiver on the same board.      |                       |
|                       |   In all modes, MCAN operates in   |                       |
|                       |   CAN-FD with arbitration bitrate  |                       |
|                       |   and data-phase bitrate set to    |                       |
|                       |   1 Mbps and 5 Mbps respectively.  |                       |
+-----------------------+------------------------------------+-----------------------+


Test Cases
^^^^^^^^^^

.. ifconfig:: CONFIG_family in ('jacinto')

    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | Application     | | Test Cases        | | Description          | | SOCs            | | Instances used    |
    +=================+=====================+========================+===================+=====================+
    | MCAN EVM        | | Transmitter Test  | | Sends 15 messages    | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    | Loopback        |                     |   with varying payloads|   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    | Application     |                     |   between 1 byte to 64 |                   |                     |
    |                 |                     |   butes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Receiver Test     | | Receives 15 messages | | J721E, J7200,   | | MCU1_0: MCU_MCAN1 |
    |                 |                     |   with payload varying |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   from 1 byte to 64    |                   |                     |
    |                 |                     |   bytes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    |                 |                     |   15 messages with     |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   payload varying from |                   |                     |
    |                 |                     |   1 byte to 64 bytes.  |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | External Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0,|
    |                 |                     |   15 messages with     |   J721S2, J784S4  |           MCU_MCAN1 |
    |                 |                     |   payload varying from |                   |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   1 byte to 64 bytes   |                   |           MAIN_MCAN5|
    |                 |                     |   externally from one  |                   |                     |
    |                 |                     |   MCAN instance to     |                   |                     |
    |                 |                     |   another.             |                   |                     |
    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | MCAN Unit Test  | | CAN FD Mode with  | | Sends and receives   | | J721E           | | MCU1_0:           |
    | Application     |   Bit Rate Switching|   message, checks if   |                   |   Default Module:   |
    |                 |   ON                |   they match, checks if|                   |   MCU_MCAN0         |
    |                 |                     |   Tx Event message     |                   |   Default Rx Module:|
    |                 |                     |   marker matches with  |                   |   MCU_MCAN1         |
    |                 |                     |   sent message,captures|                   |                     |
    |                 |                     |   Timestamp.           |                   |   MCU2_1:           |
    |                 +---------------------+------------------------+-------------------+   Default Module:   |
    |                 | | Classic CAN Mode  | | Sends and receives   | | J721E, J721S2   |   MAIN_MCAN0        |
    |                 |                     |   Classic CAN message  |                   |   Default Rx Module:|
    |                 |                     |   and checks if they   |                   |   MAIN_MCAN1        |
    |                 |                     |   match.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | CAN FD Mode with  | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |   Bit Rate Switching|   message, checks if   |                   |                     |
    |                 |   OFF               |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | External Timestamp| | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   message, checks if   |                   |                     |
    |                 |                     |   they match, checks if|                   |                     |
    |                 |                     |   Tx Event message     |                   |                     |
    |                 |                     |   marker matches with  |                   |                     |
    |                 |                     |   sent message,captures|                   |                     |
    |                 |                     |   Timestamp.           |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | High Priority     | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |   Messages          |   high priority message|                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   messages in internal |                   |                     |
    |                 |                     |   loopback mode, checks|                   |                     |
    |                 |                     |   if they match.       |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Tx Mixed Config.  | | Uses both buffer and | | J721E, J721S2   |                     |
    |                 |   With Buffer & FIFO|   FIFO to send and     |                   |                     |
    |                 |                     |   receive messages,    |                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Tx Mixed Config.  | | Uses both buffer and | | J721E, J721S2   |                     |
    |                 |   With Buffer &     |   queue to send and    |                   |                     |
    |                 |   Queue             |   receive messages,    |                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Throughput        | | Sends and Receives   | | J721E           |                     |
    |                 |                     |   messages, checks if  |                   |                     |
    |                 |                     |   they match, measured |                   |                     |
    |                 |                     |   frames per seconds   |                   |                     |
    |                 |                     |   should be 85% of the |                   |                     |
    |                 |                     |   theoretical.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Test          | | In case of single bit| | J721E, J721S2   |                     |
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Self(SEC) Test| | In case of single bit| | J721E, J721S2   |                     |
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Self(DED) Test| | In case of single bit| | J721E, J721S2   |                     |  
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | DMA Events        | | Sends and Receives   | | J721E, J721S2,  |                     |
    |                 |                     |   messages, checks if  |   J7200           |                     |
    |                 |                     |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Programmable Bit  | | Sends and Receives   | | J721E, J721S2   |                     |
    |                 |   Rate              |   messages, checks if  |                   |                     |
    |                 |                     |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Node State        | | MCAN shall transition| | J721E           |                     |
    |                 |   Transitions       |   its states properly. |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | External Timestamp| | Core shall receive   | | J721E, J721S2   |                     |
    |                 |   Overflow Interrupt|   external time stamp  |                   |                     |
    |                 |                     |   interrupt.           |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Clock Stop Request| | MCAN shall ACK back  | | J721E, J721S2   |                     |
    |                 |                     |   clock stop request   |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Time Stamp Counter| | Time Stamp Counter   | | J721E, J721S2   |                     |
    |                 |   Reset             |   shall get reset after|                   |                     |
    |                 |                     |   calling TS Reset API.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Bus Monitoring    | | Message over CAN     | | J721E           |                     |
    |                 |   Mode              |   network is received  |                   |                     |
    |                 |                     |   by MCAN but          |                   |                     |
    |                 |                     |   transmitter node gets|                   |                     |
    |                 |                     |   ACK error.           |                   |                     |
    +-----------------+---------------------+------------------------+-------------------+---------------------+


.. ifconfig:: CONFIG_family in ('j7200')

    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | Application     | | Test Cases        | | Description          | | SOCs            | | Instances used    |
    +=================+=====================+========================+===================+=====================+
    | MCAN EVM        | | Transmitter Test  | | Sends 15 messages    | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    | Loopback        |                     |   with varying payloads|   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    | Application     |                     |   between 1 byte to 64 |                   |                     |
    |                 |                     |   butes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Receiver Test     | | Receives 15 messages | | J721E, J7200,   | | MCU1_0: MCU_MCAN1 |
    |                 |                     |   with payload varying |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   from 1 byte to 64    |                   |                     |
    |                 |                     |   bytes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    |                 |                     |   15 messages with     |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   payload varying from |                   |                     |
    |                 |                     |   1 byte to 64 bytes.  |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | External Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0,|
    |                 |                     |   15 messages with     |   J721S2, J784S4  |           MCU_MCAN1 |
    |                 |                     |   payload varying from |                   |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   1 byte to 64 bytes   |                   |           MAIN_MCAN5|
    |                 |                     |   externally from one  |                   |                     |
    |                 |                     |   MCAN instance to     |                   |                     |
    |                 |                     |   another.             |                   |                     |
    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | MCAN Unit Test  | | CAN FD Mode with  | | Sends and receives   | | J721E           | | MCU1_0:           |
    | Application     |   Bit Rate Switching|   message, checks if   |                   |   Default Module:   |
    |                 |   ON                |   they match, checks if|                   |   MCU_MCAN0         |
    |                 |                     |   Tx Event message     |                   |   Default Rx Module:|
    |                 |                     |   marker matches with  |                   |   MCU_MCAN1         |
    |                 |                     |   sent message,captures|                   |                     |
    |                 |                     |   Timestamp.           |                   |   MCU2_1:           |
    |                 +---------------------+------------------------+-------------------+   Default Module:   |
    |                 | | Classic CAN Mode  | | Sends and receives   | | J721E, J721S2   |   MAIN_MCAN0        |
    |                 |                     |   Classic CAN message  |                   |   Default Rx Module:|
    |                 |                     |   and checks if they   |                   |   MAIN_MCAN1        |
    |                 |                     |   match.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | CAN FD Mode with  | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |   Bit Rate Switching|   message, checks if   |                   |                     |
    |                 |   OFF               |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | External Timestamp| | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   message, checks if   |                   |                     |
    |                 |                     |   they match, checks if|                   |                     |
    |                 |                     |   Tx Event message     |                   |                     |
    |                 |                     |   marker matches with  |                   |                     |
    |                 |                     |   sent message,captures|                   |                     |
    |                 |                     |   Timestamp.           |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | High Priority     | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |   Messages          |   high priority message|                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   messages in internal |                   |                     |
    |                 |                     |   loopback mode, checks|                   |                     |
    |                 |                     |   if they match.       |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Tx Mixed Config.  | | Uses both buffer and | | J721E, J721S2   |                     |
    |                 |   With Buffer & FIFO|   FIFO to send and     |                   |                     |
    |                 |                     |   receive messages,    |                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Tx Mixed Config.  | | Uses both buffer and | | J721E, J721S2   |                     |
    |                 |   With Buffer &     |   queue to send and    |                   |                     |
    |                 |   Queue             |   receive messages,    |                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Throughput        | | Sends and Receives   | | J721E           |                     |
    |                 |                     |   messages, checks if  |                   |                     |
    |                 |                     |   they match, measured |                   |                     |
    |                 |                     |   frames per seconds   |                   |                     |
    |                 |                     |   should be 85% of the |                   |                     |
    |                 |                     |   theoretical.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Test          | | In case of single bit| | J721E, J721S2   |                     |
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Self(SEC) Test| | In case of single bit| | J721E, J721S2   |                     |
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Self(DED) Test| | In case of single bit| | J721E, J721S2   |                     |  
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | DMA Events        | | Sends and Receives   | | J721E, J721S2,  |                     |
    |                 |                     |   messages, checks if  |   J7200           |                     |
    |                 |                     |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Programmable Bit  | | Sends and Receives   | | J721E, J721S2   |                     |
    |                 |   Rate              |   messages, checks if  |                   |                     |
    |                 |                     |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Node State        | | MCAN shall transition| | J721E           |                     |
    |                 |   Transitions       |   its states properly. |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | External Timestamp| | Core shall receive   | | J721E, J721S2   |                     |
    |                 |   Overflow Interrupt|   external time stamp  |                   |                     |
    |                 |                     |   interrupt.           |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Clock Stop Request| | MCAN shall ACK back  | | J721E, J721S2   |                     |
    |                 |                     |   clock stop request   |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Time Stamp Counter| | Time Stamp Counter   | | J721E, J721S2   |                     |
    |                 |   Reset             |   shall get reset after|                   |                     |
    |                 |                     |   calling TS Reset API.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Bus Monitoring    | | Message over CAN     | | J721E           |                     |
    |                 |   Mode              |   network is received  |                   |                     |
    |                 |                     |   by MCAN but          |                   |                     |
    |                 |                     |   transmitter node gets|                   |                     |
    |                 |                     |   ACK error.           |                   |                     |
    +-----------------+---------------------+------------------------+-------------------+---------------------+


.. ifconfig:: CONFIG_family in ('j721s2')

    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | Application     | | Test Cases        | | Description          | | SOCs            | | Instances used    |
    +=================+=====================+========================+===================+=====================+
    | MCAN EVM        | | Transmitter Test  | | Sends 15 messages    | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    | Loopback        |                     |   with varying payloads|   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    | Application     |                     |   between 1 byte to 64 |                   |                     |
    |                 |                     |   butes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Receiver Test     | | Receives 15 messages | | J721E, J7200,   | | MCU1_0: MCU_MCAN1 |
    |                 |                     |   with payload varying |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   from 1 byte to 64    |                   |                     |
    |                 |                     |   bytes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    |                 |                     |   15 messages with     |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   payload varying from |                   |                     |
    |                 |                     |   1 byte to 64 bytes.  |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | External Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0,|
    |                 |                     |   15 messages with     |   J721S2, J784S4  |           MCU_MCAN1 |
    |                 |                     |   payload varying from |                   |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   1 byte to 64 bytes   |                   |          MAIN_MCAN16|
    |                 |                     |   externally from one  |                   |                     |
    |                 |                     |   MCAN instance to     |                   |                     |
    |                 |                     |   another.             |                   |                     |   
    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | MCAN Unit Test  | | CAN FD Mode with  | | Sends and receives   | | J721E           | | MCU1_0:           |
    | Application     |   Bit Rate Switching|   message, checks if   |                   |   Default Module:   |
    |                 |   ON                |   they match, checks if|                   |   MCU_MCAN0         |
    |                 |                     |   Tx Event message     |                   |                     |
    |                 |                     |   marker matches with  |                   |   MCU2_1:           |
    |                 |                     |   sent message,captures|                   |   Default Module:   |
    |                 |                     |   Timestamp.           |                   |   MAIN_MCAN4        |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Classic CAN Mode  | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   Classic CAN message  |                   |                     |
    |                 |                     |   and checks if they   |                   |                     |
    |                 |                     |   match.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | CAN FD Mode with  | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |   Bit Rate Switching|   message, checks if   |                   |                     |
    |                 |   OFF               |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | External Timestamp| | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   message, checks if   |                   |                     |
    |                 |                     |   they match, checks if|                   |                     |
    |                 |                     |   Tx Event message     |                   |                     |
    |                 |                     |   marker matches with  |                   |                     |
    |                 |                     |   sent message,captures|                   |                     |
    |                 |                     |   Timestamp.           |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | High Priority     | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |   Messages          |   high priority message|                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J721S2   |                     |
    |                 |                     |   messages in internal |                   |                     |
    |                 |                     |   loopback mode, checks|                   |                     |
    |                 |                     |   if they match.       |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Tx Mixed Config.  | | Uses both buffer and | | J721E, J721S2   |                     |
    |                 |   With Buffer & FIFO|   FIFO to send and     |                   |                     |
    |                 |                     |   receive messages,    |                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Tx Mixed Config.  | | Uses both buffer and | | J721E, J721S2   |                     |
    |                 |   With Buffer &     |   queue to send and    |                   |                     |
    |                 |   Queue             |   receive messages,    |                   |                     |
    |                 |                     |   checks if they match.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Throughput        | | Sends and Receives   | | J721E           |                     |
    |                 |                     |   messages, checks if  |                   |                     |
    |                 |                     |   they match, measured |                   |                     |
    |                 |                     |   frames per seconds   |                   |                     |
    |                 |                     |   should be 85% of the |                   |                     |
    |                 |                     |   theoretical.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Test          | | In case of single bit| | J721E, J721S2   |                     |
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Self(SEC) Test| | In case of single bit| | J721E, J721S2   |                     |
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | ECC Self(DED) Test| | In case of single bit| | J721E, J721S2   |                     |  
    |                 |                     |   error, corrected data|                   |                     |
    |                 |                     |   is transmitted.      |                   |                     |
    |                 |                     |   In case of double bit|                   |                     |
    |                 |                     |   error, message is not|                   |                     |
    |                 |                     |   transmitted.         |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | DMA Events        | | Sends and Receives   | | J721E, J721S2,  |                     |
    |                 |                     |   messages, checks if  |   J7200           |                     |
    |                 |                     |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Programmable Bit  | | Sends and Receives   | | J721E, J721S2   |                     |
    |                 |   Rate              |   messages, checks if  |                   |                     |
    |                 |                     |   they match.          |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Node State        | | MCAN shall transition| | J721E           |                     |
    |                 |   Transitions       |   its states properly. |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | External Timestamp| | Core shall receive   | | J721E, J721S2   |                     |
    |                 |   Overflow Interrupt|   external time stamp  |                   |                     |
    |                 |                     |   interrupt.           |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Clock Stop Request| | MCAN shall ACK back  | | J721E, J721S2   |                     |
    |                 |                     |   clock stop request   |                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Time Stamp Counter| | Time Stamp Counter   | | J721E, J721S2   |                     |
    |                 |   Reset             |   shall get reset after|                   |                     |
    |                 |                     |   calling TS Reset API.|                   |                     |
    |                 +---------------------+------------------------+-------------------+                     |
    |                 | | Bus Monitoring    | | Message over CAN     | | J721E           |                     |
    |                 |   Mode              |   network is received  |                   |                     |
    |                 |                     |   by MCAN but          |                   |                     |
    |                 |                     |   transmitter node gets|                   |                     |
    |                 |                     |   ACK error.           |                   |                     |
    +-----------------+---------------------+------------------------+-------------------+---------------------+


.. ifconfig:: CONFIG_family in ('j784s4')

    +-----------------+---------------------+------------------------+-------------------+---------------------+
    | Application     | | Test Cases        | | Description          | | SOCs            | | Instances used    |
    +=================+=====================+========================+===================+=====================+
    | MCAN EVM        | | Transmitter Test  | | Sends 15 messages    | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    | Loopback        |                     |   with varying payloads|   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    | Application     |                     |   between 1 byte to 64 |                   |                     |
    |                 |                     |   butes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Receiver Test     | | Receives 15 messages | | J721E, J7200,   | | MCU1_0: MCU_MCAN1 |
    |                 |                     |   with payload varying |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   from 1 byte to 64    |                   |                     |
    |                 |                     |   bytes.               |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | Internal Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0 |
    |                 |                     |   15 messages with     |   J721S2, J784S4  |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   payload varying from |                   |                     |
    |                 |                     |   1 byte to 64 bytes.  |                   |                     |
    |                 +---------------------+------------------------+-------------------+---------------------+
    |                 | | External Loopback | | Sends and receives   | | J721E, J7200,   | | MCU1_0: MCU_MCAN0,|
    |                 |                     |   15 messages with     |   J721S2, J784S4  |           MCU_MCAN1 |
    |                 |                     |   payload varying from |                   |   MCU2_1: MAIN_MCAN4|
    |                 |                     |   1 byte to 64 bytes   |                   |          MAIN_MCAN16|
    |                 |                     |   externally from one  |                   |                     |
    |                 |                     |   MCAN instance to     |                   |                     |
    |                 |                     |   another.             |                   |                     |
    +-----------------+---------------------+------------------------+-------------------+---------------------+



