
Use the command below to build image supporting EtherCAT (example: nxp_ls1046ardb-64b_defconfig):
$ make nxp_ls1046ardb-64b_defconfig
$ make
Then, flash the image to SD card and reboot the board with this card and SD boot.
11.4.2 Command-line tool
Each master instance gets a character device as a userspace interface. The devices are named
/dev/EtherCATx
, where
x
is
the index of the master.
Device node creation The character device nodes are automatically created, if the startup script is executed. The following
example illustrates the command-line tools:
Table 44. Command line tools for EtherCAT
Command
Description
Arguments
Output
ethercat config
[OPTIONS]
Shows slave
configurations.
Options:
• --alias -a <alias >
Configuration alias (see
above)
• --position -p <pos >
Relative position (see
above).
• -- verbose -v Show
detailed configurations.
Without the -- verbose option, slave
configurations are output one -per - line. For
example, the output for1001:0 0
x0000003b /0 x02010000 3 would be
displayed as follows:
• 1001:0 -> Alias address and relative
position (both decimal).
• 0 x0000003b /0 x02010000 -> Expected
vendor ID and product code (both
hexadecimal).
• 3 -> Absolute decimal ring position of the
attached slave, or '-' if none attached.
• OP -> Application – layer state of the
attached slave, or '-', if no slave is
attached.
ethercat master
[OPTIONS]
Shows master and
Ethernet device
information.
Options:
-- master -m <indices >
Master indices. A comma -
separated
list with ranges is supported.
Example: 1 ,4 ,5 ,7 -9.
Default: - (all ).
Master0
Phase: Idle
Active: no
Slaves: 8
Ethernet devices:
Main:
00:00:08:44: ab :66 (attached)
Link: UP
Tx frames:
18846
Tx bytes:
1169192
Rx frames:
18845
Rx bytes:
1169132
Tx errors: 0
Tx frame rate
[1/s]: 125 395 241
Table continues on the next page...
NXP Semiconductors
EtherCAT
Open Industrial User Guide, Rev. 1.8, 05/2020
User's Guide
148 / 199