|
NetBurner 3.5.8
PDF Version |
Example Path: examples/PlatformSpecific/MODRT1171/CAN/FlexcanLoopback
The i.MX RT1171's FlexCAN controllers include a loopback self-test mode that connects the transmitter directly to the receiver inside the chip. This example configures one FlexCAN message buffer as a transmitter and another as a receiver with the same CAN ID, sends a frame through the internal loopback interconnect, and prints the payload received on the other side to the serial terminal.
Because the frame never leaves the chip, this example runs on a single bare MODRT1171 – no CAN transceiver, no bus wiring, and no second node. Run it first to verify FlexCAN operation on your module, then move on to the CanSimple and CanErrorMonitor examples, which drive a real CAN bus.
The FlexCAN driver (fsl_flexcan, NXP SDK version 2.7.1) is built into the NetBurner MODRT1171 platform library; the example includes <fsl_flexcan.h> directly and bundles no driver source.
No special settings are required. Loopback mode uses no package pins.
Build and load the application, then open the serial terminal. The example sends one frame from transmit message buffer 9 to receive message buffer 10 and prints both payloads:
If the rx words match the tx words, the FlexCAN controller, its clocking, and its interrupt path are all working.