MCU Communication Components Usage
The MCU implements communication mechanisms over:
• CAN
• Flexray
• PDUR Gateway
This section explains the testing mechanism for these features.
CAN
A software component is implemented in the Vector firmware that sends periodic CAN, CANFD, and extended CAN messages over all the CAN channels at a periodicity of 1 sec. This can be tested with the following steps:
1. Flash the Vector firmware on the MCU.
2. Connect CANOE hardware to the desired CAN channel on the board.
3. Run the StartApplication.cfg CANOE project packaged in the PDK.
4. From the MCU shell, run the cycliccanon All command. This enables CAN, CANFD, and CANEx periodic transmission from MCU. This can be turned off after the test using cycliccanoff All.
5. You should see periodic messages (1 second period) on all CAN channels for CAN, CANFD, and extended CAN.
6. IDs and data on the channels:
Channel | CAN Id | CAN Data | CAN FD Id | CAN FD Data | Extended CAN Id | Extended CAN Data |
1 | 101 | 0x119 | 108 | 0x1119 | 801x | 0x11119 |
2 | 201 | 0x229 | 208 | 0x2229 | 902x | 0x22229 |
3 | 301 | 0x339 | 308 | 0x3339 | 1002x | 0x33339 |
4 | 401 | 0x449 | 408 | 0x4449 | 1102x | 0x44449 |
5 | 501 | 0x559 | 508 | 0x5559 | 1202x | 0x55559 |
6 | 601 | 0x669 | 608 | 0x6669 | 1302x | 0x66669 |
Note: | Data in CANOE may show reversed as it only shows bytes and not the complete integer value. This is expected with the CANOE project attached. |
Changing the Baud Rate of the CAN Channels
• Baud rate can be changed dynamically and set to any of the supported baud rates using the cansetbr shell command. The physical CAN channels a-e are mapped one-to-one with the channel IDs 1-6 shown in the table above.
• The new baud rate configuration is stored in NVM during system power-down using the aurixreset command. CAN channels are initialized with the NVM values from the next power-on.
• The stored configuration in NVM can be viewed using the shell command readNvRam.
• The configID is mapped to the CAN baud rate and CANFD baud rate as:
• config ID 2 => 500 , 2000
• config ID 1 => 250 , 2000
• config ID 0 => 125 , 2000
Flexray
A software component is implemented in the Vector firmware that sends periodic Flexray messages on channel 1 at a periodicity of 1 sec. This can be tested as follows:
1. Flash the Vector firmware on the MCU.
2. Connect CANOE hardware to the Flexray channel on the board.
3. Run the Flexray.cfg CANOE project packaged in the SDK. Load Flexray.xml when asked.
4. Periodic (1 second period) Flexray messages should be seen on channel 1. Data should be 0x12345678 in hex.
Note: | CANOE may show the corresponding decimal value. |
CAN PDUR Gateway
The EasyCAN feature is deprecated from 5.1.12.4 onwards. NVIDIA now supports the standard PDUR gateway feature supported by the Vector Autosar stack. Vector BSW provides a mechanism to gateway CAN to Ethernet, and vice versa, with a low performance overhead. This currently is enabled on the Vector firmware where a set of static CAN IDs are configured for the gateway feature. The following is the PDU related information, and testing information for the PDUR gateway.
1. PDU Message Format
PDU Header Id (4 bytes) | Data Length (4 bytes) | Data (8 Bytes) |
2. PDU Header ID
CAN Channel | PDU Header Id Tx/Rx from MCU/Tegra | PDU HeaderId Rx/Tx at MCU/Tegra |
1 | 01 (Correlates to CAN Id 0x106) | 17 (Correlates to CAN Id 0x105) |
2 | 02 (Correlates to CAN Id 0x206) | 18 (Correlates to CAN Id 0x205) |
3 | 03 (Correlates to CAN Id 0x306) | 19 (Correlates to CAN Id 0x305) |
4 | 04 (Correlates to CAN Id 0x406) | 20 (Correlates to CAN Id 0x405) |
5 | 05 (Correlates to CAN Id 0x506) | 21 (Correlates to CAN Id 0x505) |
6 | 06 (Correlates to CAN Id 0x606) | 22 (Correlates to CAN Id 0x605) |
3. UDP Protocol Info
• MCU:
• Local Port : 50000
• Remote Port: 60395
• Local IP : 10.42.0.146
• Remote IP: 10.42.0.28
• Tegra-A:
• Local Port: 60395
• Remote Port : 50000
• Local IP: 10.42.0.28
• Remote IP : 10.42.0.146
4. Gateway Testing
• Flash the Vector firmware on the MCU.
• Connect CANOE hardware to the desired CAN channel on the board.
• Run aurix_tegra_a_vector_gateway_tester.py (packaged in the SDK) on Xavier-A
• Open the StartApplication.cfg CANOE project packaged in the SDK.
• Choose the CAN IG block in the active channel. Set the correct CAN channel ID and play it. Now run the CANOE project. Data is sent from CANOE to the MCU through CAN and gateway-ed over Ethernet to Xavier-A. Xavier-A reverses the data and sends it back to the MCU over Ethernet, which is gateway-ed over CAN to CANOE. For example, on channel 1, on ID 106 you should see Tx data and on ID 105 you should see the reversed Rx data. Multiple CAN frames, however, can also be accommodated into a single Ethernet packet based on how many CAN frames are transmitted simultaneously.
5. Known Limitations
• This only works with standard CAN. There is no support for CANFD and extended CAN.
• Only works for Xavier-A.