Hardware requirements
Micro USB cable
two IMX95VERDIN-EVK board
JLink Plus
12V~20V power supply
Personal Computer
Board settings
Switch S4 to position1 The example requires connecting between CAN pins of two boards. The connection should be set as follows:
Switch S4 to position 1 Between two boards:
J26-4(CANH) node A, J26-4(CANH) node B
J26-3(CANL) node A, J26-3(CANL) node B
J26-2(GND) node A, J26-2(GND) node B
Prepare the Demo
Connect 12V~20V power supply and JLink Plus to the board, switch S6 to power on the board
Connect a micro USB cable between the host PC and the J4 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either re-power up your board or launch the debugger in your IDE to begin running the demo.
Running the demo
After connecting the two boards, these instructions display on each terminal window. One board must be chosen as node A and the other board as node B. (Note: Node B should start first) Data is sent continuously between the node A and the node B.
This message displays on the node A terminal:
********* FLEXCAN PingPong Buffer Example *********
Message format: Standard (11 bit id)
Node B Message buffer 1 to 4 used as Rx queue 1.
Node B Message buffer 5 to 8 used as Rx queue 2.
Node A Message buffer 8 used as Tx.
*********************************************
Please select local node as A or B:
Note: Node B should start first.
Node:A
Please input the number of CAN/CANFD messages to be send and end with enter.
100
Transmission done.
Please input the number of CAN/CANFD messages to be send and end with enter.
This message displays on the node B terminal:
This message displays on the node B terminal:
********* FLEXCAN PingPong Buffer Example ********* Message format: Standard (11 bit id) Node B Message buffer 1 to 4 used as Rx queue 1. Node B Message buffer 5 to 8 used as Rx queue 2. Node A Message buffer 8 used as Tx.
Please select local node as A or B: Note: Node B should start first. Node:B Start to Wait data from Node A
Read Rx MB from Queue 1. Rx MB ID: 0x321, Rx MB data: 0x0, Time stamp: 20971 Rx MB ID: 0x321, Rx MB data: 0x1, Time stamp: 56187 Rx MB ID: 0x321, Rx MB data: 0x2, Time stamp: 56867 Rx MB ID: 0x321, Rx MB data: 0x3, Time stamp: 57547 Read Rx MB from Queue 2. Rx MB ID: 0x321, Rx MB data: 0x4, Time stamp: 56187 Rx MB ID: 0x321, Rx MB data: 0x5, Time stamp: 56867 Rx MB ID: 0x321, Rx MB data: 0x6, Time stamp: 57547 Rx MB ID: 0x321, Rx MB data: 0x7, Time stamp: 57547 Wait Node A to trigger the next 8 messages!
Read Rx MB from Queue 1. Rx MB ID: 0x321, Rx MB data: 0x8, Time stamp: 61657 Rx MB ID: 0x321, Rx MB data: 0x9, Time stamp: 31304 Rx MB ID: 0x321, Rx MB data: 0xa, Time stamp: 31983 Rx MB ID: 0x321, Rx MB data: 0xb, Time stamp: 32662 Read Rx MB from Queue 2. Rx MB ID: 0x321, Rx MB data: 0xc, Time stamp: 31304 Rx MB ID: 0x321, Rx MB data: 0xd, Time stamp: 31983 Rx MB ID: 0x321, Rx MB data: 0xe, Time stamp: 32662 Rx MB ID: 0x321, Rx MB data: 0xf, Time stamp: 32662 Wait Node A to trigger the next 8 messages!
…..