Step-by-Step Guide to Running the GenAVB/TSN Stack FreeRTOS Evaluation Use Case on i.MX RT1180
1. Abstract
The GenAVB/TSN Stack FreeRTOS Evaluation User's Guide (version:8.0 Release) covers multiple hardware platforms, software configurations, and evaluation use cases. While comprehensive, the document can be challenging for first-time users to follow due to the large amount of information and the variety of supported scenarios.
This article focuses on a specific use case from the User's Guide and provides a detailed, step-by-step walkthrough with screenshots, configuration examples, expected results, and troubleshooting tips. The goal is to help users better understand the setup process and successfully evaluate the GenAVB/TSN stack on NXP platforms.
This article walks through Section 4.4, TSN Network Only with TSN Bridge and Standalone Endpoint i.MX RT1180, from the GenAVB/TSN Stack FreeRTOS Evaluation User's Guide. It explains the required hardware setup, firmware build and flashing procedure, board configuration, TSN configuration, execution steps, expected results, and basic troubleshooting tips.
2. Setup
2.1 Hardware Preparation
Two i.MX RT1180 boards
A PC with a serial terminal emulator. MobaXterm Portable is recommended.
At least two USB cables and three Ethernet cables
2.2 Firmware Preparation
2.2.1 Setup IDE and SDK
Refer to the NXP GenAVB/TSN MCUXpresso User's Guide to install the required software environment for the selected platform and project. A successful project build confirms that the build environment has been installed and configured correctly.
VS Code and MCUXpresso for Visual Studio Code are recommended.
2.2.2 Build Image
Note: The specific operating procedures should still be based on GenAVB/TSN MCUXpresso User's Guide . The explanation below is intended only as a supplement to the original document.
For GenAVB_TSN-rtos-apps version 8.0, the CM7 Kconfig file needs to be fixed manually before building the image.
Kconfig file path:
Add two lines like the following:
Set the Build Configurations of the CM33 project to release_no_enetc0, and then build the project.
Set the Build Configurations of the CM7 project to release_enetc0, and then build the project.
Note: If you are using MCUXpresso for VS Code, you may not be able to import both the CM33 and CM7 projects of the TSN application into the same workspace at the same time, like the following:
If this occurs, remove the existing project from the workspace before importing the project for the other core. This issue is expected to be fixed in a future release.
After both the CM33 and CM7 projects are built successfully, the generated .bin files and .elf files can be found in the corresponding output directories:
2.2.3 Flash Image
Make sure the board's boot configuration switch is set to Serial Downloader mode. For SDP mode, SW5[1..4] should be set to 0001.
Set jumper J1 to position 7–8 so that the evaluation board can be powered through the Debug USB port.
Connect one USB cable between the PC and the USB_OTG1 port , which is used for firmware downloading.
Connect another USB cable between the PC and the Debug USB port, which is used for power supply and serial communication.
Then reset the board.
Refer to Chapter 10, "Multi core (Cortex-M33 + Cortex-M7) images flashing" in the GenAVB/TSN MCUXpresso User's Guide. Flash the following generated binaries to the target device:
genavb_tsn_rtos_apps\...\release_no_enetc0\evkmimxrt1180_tsn_app_cm33_cm33.bin
genavb_tsn_rtos_apps\...\release_enetc0\evkmimxrt1180_tsn_app_cm7_cm7.bin
2.3 Check the Status of the Boards
After the flashing operation is completed on both boards, restore the boot configuration switch on each board to Quad SPI mode. For QSPI mode, SW5[1..4] should be set to 0100. Then reset both boards.
Remove the jumper on JP7 so that the debug port on each board can enumerate two serial ports. The CM33 and CM7 serial terminal interfaces are provided through the two serial ports enumerated by the debug port.
After the boards restart, the red LED D7 should blink, indicating that the TSN application is running.
Then, check the hardware connection:
2.4 TSN Configuration and Evaluation
i.MX RT1180 Controller
i.MX RT1180 IO Device 1
Step 1.
Configure the Controller Standalone TSN Endpoint
and
IO Device Standalone TSN Endpoint
respectively.
CM33 shell: Press INSERT key
mkdir -p /m7/tsn_app write /m7/boot 1 write /m7/tsn_app/role 0 write /m7/tsn_app/mode 2 write /m7/tsn_app/port_id 1 write /m7/tsn_app/num_io_devices 1 write /m7/tsn_app/period_ns 250000
CM33 shell: Press INSERT key
mkdir -p /m7/tsn_app write /m7/boot 1 write /m7/tsn_app/role 1 write /m7/tsn_app/mode 2 write /m7/tsn_app/port_id 1 write /m7/tsn_app/period_ns 250000
Step 2. Reset the boards
Reset
Reset
Step 3. Set hardware address
CM33 shell:
mkdir -p port0
mkdir -p port1
mkdir -p port2
mkdir -p port3
mkdir -p port4
mkdir -p port5
write port0/hw_addr 54:27:8D:00:00:00
write port1/hw_addr 54:27:8D:00:00:01
write port2/hw_addr 54:27:8D:00:00:02
write port3/hw_addr 54:27:8D:00:00:03
write port4/hw_addr 54:27:8D:00:00:04
write port5/hw_addr 54:27:8D:00:00:05
CM33 shell:
mkdir -p port0
mkdir -p port1
mkdir -p port2
mkdir -p port3
mkdir -p port4
mkdir -p port5
write port0/hw_addr 54:27:8D:00:01:00
write port1/hw_addr 54:27:8D:00:01:01
write port2/hw_addr 54:27:8D:00:01:02
write port3/hw_addr 54:27:8D:00:01:03
write port4/hw_addr 54:27:8D:00:01:04
write port5/hw_addr 54:27:8D:00:01:05
Step 4. Set gPTP
/ (Devices without this command configured remain GM devices.)
CM33 shell:
mkdir -p fgptp
write fgptp/priority1 248
Step 5. VLAN and FDB entry settings
BRIDGE>> vlan_update 2 3 -c 1 -p
BRIDGE>> vlan_update 2 4 -c 1 -p
BRIDGE>> fdb_update 91:e0:f0:00:fe:70 2 4 -c 1 -p
BRIDGE>> fdb_update 91:e0:f0:00:fe:71 2 3 -c 1 -p
/
Step 6. Scheduled Traffic settings
CM33 shell:
BRIDGE>> cd /
BRIDGE>> qbv_set 4 -b 35000 -c 250000 -C 0 -l 08,80000 -l f7,170000 -p
BRIDGE>> qbv_set 3 -b 160000 -c 250000 -C 0 -l 08,80000 -l f7,170000 -p
CM7 shell:
CONTROLLER>> qbv_set 1 -b 35000 -c 250000 -C 0 -l 02,80000 -l fd,170000
CM7 shell:
IO_DEVICE_0>> qbv_set 1 -b 160000 -c 250000 -C 0 -l 02,80000 -l fd,170000
Step 7. Reset the boards and evaluate Scheduled Traffic
/
Step 8. Configure Time-Specific Departure (TSD)
CM33 shell:
Press INSERT key
write /m7/tsn_app/tx_time_enabled 1
write /m7/tsn_app/tx_time_offset_ns 38000
CM33 shell:
Press INSERT key
write /m7/tsn_app/tx_time_enabled 1
write /m7/tsn_app/tx_time_offset_ns 38000
Step 9. Reset the boards and evaluate Time-Specific Departure (TSD)
/
Note: All use cases require the hardware address and gPTP configurations. The original User's Guide does not fully describe this part, so these steps are explicitly included in this article for clarity.
3. Conclusion
This guide summarizes the complete workflow for evaluating the GenAVB/TSN Stack FreeRTOS use case on the i.MX RT1180 platform. It covers the required hardware preparation, firmware build process, image flashing procedure, board boot configuration, serial port verification, and TSN configuration steps.
By following the configuration sequence in this document, users can set up the Controller and IO Device roles, configure gPTP, VLAN, FDB entries, Scheduled Traffic, and Time-Specific Departure, and then verify the expected TSN behavior between the two i.MX RT1180 boards.
View full article