Testing CAN3 in PX4
CAN3 Port Bring-up and Testing in PX4-Autopilot
Last updated
CAN3 Port Bring-up and Testing in PX4-Autopilot
Last updated
At this point time (11/11/2024) CAN3 is not enabled to use DronCAN or UAVCAN by default in PX4. The port itself is enabled and can be exercised using CANSEND and CANDUMP commands This tutorial describes how to enable the CAN3 Port on the NXP-VMU-RT117x in PX4-Autopilot, and demonstrates the transmission of CAN Frames between two VMU-RT117x using the can-utils module.
S.No. | Name | Quantity |
---|---|---|
Note: We require 6 USB-A (Female) ports on the host machine for this setup. You may utilize a USB-HUB (USB-A Male to USB-A Female) to get multiple ports on your host machine.
The high level overview here is that we want to be able to both program and gain console access to the MR-VMU-RT1176 so we can issue commands. Note that there are other valid ways to get a console, such as through an attached Telemetry radio. Programming may also use MCU-LINK-MR.
Select the following options:
Device Drivers → CAN Driver Support
License Setup → Use components that have GPL/LGPL licenses
Application Configuration → CAN Utilities → SocketCAN cansend tool
Application Configuration → CAN Utilities → SocketCAN candump tool
In file "~/PX4-Autopilot/platforms/nuttx/init/imxrt/rc.board_arch_defaults", add the line "param set-default -s UAVCAN_ENABLE 1" after line number 6.
For simplicity, connect only one setup at a time with your host machine, i.e. only 1 VMU-RT117x + Pixhawk Debug Adaptor + J-Link EDU MINI.
Alternatively, you may connect both the setups simultaneously and select the appropriate J-Link when running JLinkExe command.
Note: The following steps need to be run once for each of the two VMU-RT117x.
Open a new shell and perform the following steps for flashing PX4-Autopilot on VMU-RT117x.
Get the serial shell of the two VMU-RT117x on your host machine.
Note: Baudrate for the serial console is 57600.
Execute "
candump can2
" on one shell and "cansend can2 123#1234567890
" on the other.
1
2
2
2
3
2
4
USB-C (Male) to USB-A (Male) Cable [Connects VMU-RT117x and Pixhawk Adaptor with the host]
4
5
Micro-USB (Male) to USB-A (Male) Cable [Connects J-Link EDU Mini Debugger with the host]
2
6
4-Pin JST-GH to 4-Pin JST-GH (Twisted CAN Cable) [Connects the CAN3 Ports of VMU-RT117x]
1
7
JST SH 10-Pin Cable [Connects VMU-RT117x and Pixhawk Debug Adaptor]
2
8
10-Pin 2x5 Socket-Socket IDC (SWD) Ribbon Cable [Connects J-Link and Pixhawk Adaptor]
2