Hardware requirements

  • USB Type-C cable

  • two MCIMX93-EVK board

  • JLink Plus

  • 12V~20V power supply

  • Personal Computer

Board settings

Switch S1101 to “ON” for two boards. The example requires connecting between CAN pins of two boards. The connection should be set as follows:

Between two boards:

  • J1101-2(CANH) node A, J1101-2(CANH) node B

  • J1101-3(CANL) node A, J1101-3(CANL) node B

  • J1005-7(GND) node A, J1005-7(GND) node B

Note

Please run the application in Low Power boot mode (without Linux BSP). The IP module resource of the application is also used by Linux BSP. Or, run with Single Boot mode by changing Linux BSP to avoid resource conflict.

Prepare the Demo

  1. Connect 12V~20V power supply and JLink Plus to the board, switch SW301 to power on the board

  2. Connect a USB Type-C cable between the host PC and the J1401 USB port on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Either re-power up your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the example runs successfully, following information can be seen on the terminal:

This message displays on the node A terminal:

********* FLEXCAN Interrupt EXAMPLE *********

    Message format: Standard (11 bit id)

    Message buffer 9 used for Rx.

    Message buffer 8 used for Tx.

    Interrupt Mode: Enabled

    Operation Mode: TX and RX --> Normal

*********************************************

Please select local node as A or B:

Note: Node B should start first.

Node:a

Press any key to trigger one-shot transmission

Rx MB ID: 0x123, Rx MB data: 0x0, Time stamp: 8877

Press any key to trigger the next transmission!

Rx MB ID: 0x123, Rx MB data: 0x1, Time stamp: 32459

Press any key to trigger the next transmission!

This message displays on the node B terminal:

********* FLEXCAN Interrupt EXAMPLE *********

Message format: Standard (11 bit id)

Message buffer 9 used for Rx.

Message buffer 8 used for Tx.

Interrupt Mode: Enabled

Operation Mode: TX and RX --> Normal

Please select local node as A or B:

Note: Node B should start first.

Node:b

Start to Wait data from Node A

Rx MB ID: 0x321, Rx MB data: 0x0, Time stamp: 5759

Wait Node A to trigger the next transmission!

Rx MB ID: 0x321, Rx MB data: 0x1, Time stamp: 57276

Wait Node A to trigger the next transmission!