This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM69:Port Ethercat master to AM69 and connect the slave.

Part Number: AM69
Other Parts Discussed in Thread: TDA4VM,

Tool/software:

When I ported Ethercat to the board using this link, the board was launched successfully:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1409114/faq-tda4vm-how-do-i-build-the-native-igh-ethercat-stack-for-ti-microprocessors/5394968?tisearch=e2e-sitesearch&keymatch=AM%252520ethercat#5394968

But when I input "./ethercatctl status" command, the board state standing for master0 dead. 

When I tried to execute the command "./ethercatctl restart", it showed that Ethercat could not be restarted.I don't know what went wrong.

  • Hi,

    I could see am65-cpsw-nuss driver is loaded in your case, If you refer to FAQ,  of below talks about Build Kernel without am65-cpsw-nuss driver. "2.5. Build the Kernel without the am65-cpsw-nuss Driver"

    Please confirm, have you followed steps mentioned in FAQ.

    Best Regards,
    Sudheer

  • But in FAQ 2.7 I was told to rebuild the driver with am65-cpsw-nuss. "2.7. Build the Kernel with the am65-cpsw-nuss Driver as a Module"

  • Hi,

    When running rmmod, you need to remove modules in order of dependencies. It looks like the ec_ti_am65_cpsw_nuss module is not being removed before it tries to remove the ec_master module.

    Best,
    Jared

  • Ok, I'll have a try, thank you.

  • The board seems unable to remove ec_ti_am65_cpsw_nuss.

  • Why does the board terminal always pop up this message after opening ethercat, warning CPUs/tasks stall?

  • Hi,

    I'm not sure why it kernel panics when removing the ec_ti_am65_cpsw_nuss driver or why the CPUs/tasks stall.

    The CPU/tasks do not stall with the TDA4VM, so I will have to see what the difference is that is causing this.

    Best,
    Jared

  • When removing the ec_ti_am65_cpsw_nuss driver, its configuration looks like this:

    # CONFIG_TI_K3_AM65_CPSW_NUSS is not set
    # CONFIG_TI_K3_AM65_CPSW_SWITCHDEV is not set
    # CONFIG_TI_AM65_CPSW_TAS is not set
    CONFIG_PHYLINK=m
    # CONFIG_PHY_TI_GMII_SEL is not set

    When building the Kernel with the am65-cpsw-nuss driver in 2.7, its configuration looks like this:

    CONFIG_TI_K3_AM65_CPSW_NUSS=m
    CONFIG_PHYLINK=m
    CONFIG_PHY_TI_GMII_SEL=m

    The ethercat branch I downloaded is master. Is it CPUs/tasks stall caused by kernel differences?I don't know if it supports kernel 6.6.

  • Hi,

    The ethercat branch I downloaded is master.

    You shouldn't be using the master branch. You should be using the ti-am65-cpsw-nuss_6.1_6.6 branch.

    Is it CPUs/tasks stall caused by kernel differences?

    The CPU/tasks stall is likely caused by something different in the AM69 compared to the TDA4VM.

    I don't know if it supports kernel 6.6.

    There were recent edits made to the driver to support 6.6; I haven't tested the changes however.

    Best,
    Jared

  • But you should see that this link no longer has the ti-am65-cpsw-nuss_6.1_6.6 branch.

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    root@am69-sk:/# ./ectest
    [ 233.359952] EtherCAT: Requesting master 0...
    [ 240.598094] rcu: INFO: rcu_preempt self-detected stall on CPU
    [ 240.603831] rcu: 5-....: (1 GPs behind) idle=dc4c/1/0x4000000000000000 softirq=2692/2692 fqs=1805
    [ 240.612771] rcu: (t=5254 jiffies g=2481 q=671 ncpus=8)
    [ 240.617984] CPU: 5 PID: 154 Comm: systemd-journal Tainted: G O 6.6.32-gbccca0fbfbc0-dirty #2
    [ 240.627789] Hardware name: Texas Instruments AM69 SK (DT)
    [ 240.633169] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [ 240.640113] pc : k3_ringacc_ring_pop_mem+0x34/0xb0
    [ 240.644901] lr : k3_ringacc_ring_pop+0x34/0x94
    [ 240.649332] sp : ffff8000813f3d80
    [ 240.652632] x29: ffff8000813f3d80 x28: 0000000000000007 x27: ffff8000813f3e57
    [ 240.659753] x26: 0000000000000040 x25: ffff000801c10080 x24: 0000000000000000
    [ 240.666871] x23: 0000000000000000 x22: ffff000801c10120 x21: 0000000000000000
    [ 240.673989] x20: ffff000802572d80 x19: ffff000f10410010 x18: ffffffffffffffff
    [ 240.681107] x17: ffff800e8af12000 x16: ffff8000813f0000 x15: ffff0008054d4050
    [ 240.688226] x14: 2e54494e49203a65 x13: 6369766564206e69 x12: ffff000802692b1c
    [ 240.695344] x11: ffff800082651000 x10: ffff800080ceebf0 x9 : 1fffe001001e29c1
    [ 240.702461] x8 : 0000000000000040 x7 : 0000000000000000 x6 : fffffffffffffffe
    [ 240.709580] x5 : 0000000000000000 x4 : fffffbffeff25990 x3 : 0000000000000000
    [ 240.716699] x2 : 0000000000000008 x1 : 0000000000000010 x0 : ffff8000813f3de0
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I find this error occurs every time I connect to slaves.

  • Hi,

    Let me test the newly written driver, and I will get back to you on how it's working.

    Best,
    Jared

  • What is the result of the test?

  • Hi,

    Still working on it. I will keep you updated.

    Best,
    Jared

  • I still have some questions. Why, after compiling the kernel according to the FAQ, can't I find any network driver's IP address?

    This is the startup log.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [ 9.733209] hub 1-1:1.0: 4 ports detected
    [ 9.739903] hub 2-1:1.0: USB hub found
    Expecting device /dev/mmcblk1p1...
    [ 9.794505] hub 2-1:1.0: 4 ports detected
    [ 9.805491] hub 1-1:1.0: USB hub found
    [ 9.809283] hub 1-1:1.0: 4 ports detected
    [FAILED] Failed to start Network Name Resolution.
    See 'systemctl status systemd-resolved.service' for details.
    [FAILED] Failed to start Network Time Synchronization.
    See 'systemctl status systemd-timesyncd.service' for details.
    Starting Virtual Console Setup...
    [ OK ] Found device /dev/mmcblk0p1.
    [ OK ] Found device /dev/mmcblk1p1.
    [ 9.952115] hub 2-1:1.0: USB hub found
    Starting File System Check on /dev/mmcblk0p1 9.958042] hub 2-1:1.0: 4 ports detected
    0m...
    Starting File System Check on /dev/mmcblk1p1...
    [FAILED] Failed to start Network Name Resolution.
    See 'systemctl status systemd-resolved.service' for details.
    [FAILED] Failed to start Network Time Synchronization.
    See 'systemctl status systemd-timesyncd.service' for details.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    If the am65-cpsw-nuss driver is disabled, then the network driver won't load and you won't have an IP address.

    It would appear under eth0 if it loaded.

    Best,
    Jared

  • Hi,

    Thanks for the answer!

    Is this a new log and should I do anything?

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    root@am69-sk:/# opt/etherlab/sbin/ethercatctl start
    [ 99.147822] ec_master: loading out-of-tree module taints kernel.
    [ 99.155699] EtherCAT: Master driver 1.6.1 1.6-alpha-176-gdb48d9b0
    [ 99.162001] EtherCAT: 1 master waiting for devices.
    [ 99.251229] davinci_mdio 46000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
    [ 99.265751] davinci_mdio 46000f00.mdio: phy[0]: device 46000f00.mdio:00, driver TI DP83867
    [ 99.274045] am65-cpsw-nuss 46000000.ethernet: initializing am65 cpsw nuss version 0x6BA02102, cpsw version 0x6BA82102 Ports: 2 quirks:00000000
    [ 99.286907] am65-cpsw-nuss 46000000.ethernet: initialized cpsw ale version 1.4
    [ 99.294119] am65-cpsw-nuss 46000000.ethernet: ALE Table size 64
    [ 99.300530] am65-cpsw-nuss 46000000.ethernet: CPTS ver 0x4e8a010b, freq:500000000, add_val:1 pps:0
    [ 99.322862] am65-cpsw-nuss 46000000.ethernet: set new flow-id-base 48
    [ 99.329898] EtherCAT: Accepting 08:04:B4:2E:A2:E9 as main device for master 0.
    [ 99.351445] am65-cpsw-nuss 46000000.ethernet ecm0 (uninitialized): PHY [46000f00.mdio:00] driver [TI DP83867] (irq=POLL)
    [ 99.362312] am65-cpsw-nuss 46000000.ethernet ecm0 (uninitialized): configuring for phy/rgmii-rxid link mode
    [ 99.372261] EtherCAT 0: Starting EtherCAT-IDLE thread.
    root@am69-sk:/# [ 100.393233] audit: type=1334 audit(1709055498.140:76): prog-id=45 op=LOAD
    [ 100.400065] audit: type=1334 audit(1709055498.148:77): prog-id=46 op=LOAD
    [ 100.406892] audit: type=1334 audit(1709055498.152:78): prog-id=47 op=LOAD
    [ 100.413715] audit: type=1334 audit(1709055498.160:79): prog-id=48 op=LOAD
    [ 100.420538] audit: type=1334 audit(1709055498.168:80): prog-id=49 op=LOAD
    [ 100.427538] audit: type=1334 audit(1709055498.176:81): prog-id=45 op=UNLOAD
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    U-Boot SPL 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
    SYSFW ABI: 4.0 (firmware rev 0x000a '10.0.8--v10.00.08 (Fiery Fox)')
    Trying to boot from MMC2
    Authentication passed
    Authentication passed
    U-Boot 2024.04-ti-gfda88f8bcea3 (Jul 26 2024 - 11:00:12 +0000)
    SoC: J784S4 SR1.0 HS-FS
    Model: Texas Instruments AM69 SK
    DRAM: 2 GiB (effective 32 GiB)
    idle-statesCore: 122 devices, 32 uclasses, devicetree: separate
    Flash: 0 Bytes
    MMC: mmc@4f80000: 0, mmc@4fb0000: 1
    Loading Environment from nowhere... OK
    In: serial@2880000
    Out: serial@2880000
    Err: serial@2880000
    am65_cpsw_nuss ethernet@46000000: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 0x6BA82102 ale_ver: 0x00293904 Ports:1
    Net: eth0: ethernet@46000000port@1
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    I have not seen that error before.

    Best,
    Jared

  • Hi,

    Ok, but I hope you can help me see why the CPU usage of the kernel is 100% after connecting to the slave?

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    root@am69-sk:/opt/etherlab/bin# top
    top - 08:16:47 up 15 min, 0 user, load average: 0.49, 0.14, 0.07
    Tasks: 163 total, 2 running, 161 sleeping, 0 stopped, 0 zombie
    %Cpu(s): 0.0 us, 12.5 sy, 0.0 ni, 87.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0
    MiB Mem : 31844.8 total, 31331.8 free, 531.0 used, 361.7 buff/cache
    MiB Swap: 0.0 total, 0.0 free, 0.0 used. 31313.8 avail Mem
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+
    1111 root 20 0 0 0 0 R 100.0 0.0 0:40.40
    1157 root 20 0 7392 4480 2432 R 0.3 0.0 0:00.08
    1 root 20 0 18940 10480 7664 S 0.0 0.0 0:02.72
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.00
    3 root 20 0 0 0 0 S 0.0 0.0 0:00.00
    4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
    5 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
    6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
    7 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
    8 root 20 0 0 0 0 I 0.0 0.0 0:00.00
    11 root 20 0 0 0 0 I 0.0 0.0 0:00.01
    12 root 0 -20 0 0 0 I 0.0 0.0 0:00.00
    13 root 20 0 0 0 0 I 0.0 0.0 0:00.00
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Ethercat's inability to stop is still unresolved.

    Fullscreen
    1
    2
    root@am69-sk:/opt/etherlab/sbin# ./ethercatctl stop
    rmmod: ERROR: Module ec_master is in use by: ec_ti_am65_cpsw_nuss
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    Ok, but I hope you can help me see why the CPU usage of the kernel is 100% after connecting to the slave?

    Can you run htop?

    Ethercat's inability to stop is still unresolved.

    etheractctl stop tries to remove the ec_master without removing the ec_ti_am65_cpsw_nuss first. As a result it isn't removed.

    Best,
    Jared

  • Hi,

    So, you mean the EtherCAT can't stop using the command line?

    Below is the output when I run htop.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    root@am69-sk:/# htop
    0[ 0.0%] 4[ 0.0%]
    1[ 0.0%] 5[**************** 50.0%]
    2[* 0.7%] 6[*************************100.0%]
    3[ 0.0%] 7[ 0.0%]
    Mem[|#@$ 224M/31.1G] Tasks: 22, 20 thr, 164 kthr; 0 runni
    Swp[ 0K/0K] Load average: 5.46 2.41 0.93
    Uptime: 00:03:48
    [Main] [I/O]
    PID USER PRI NI VIRT RES SHR S CPU%-MEM% TIME+ Command
    1109 root 20 0 4772 3072 2432 R 0.6 0.0 0:00.10 htop
    1 root 20 0 18912 10752 7680 D 0.0 0.0 0:02.51 /sbin/ini
    153 rpc 20 0 4648 2432 2176 S 0.0 0.0 0:00.00 /usr/sbin
    154 root 20 0 23464 6912 6144 R 0.0 0.0 0:00.39 /usr/lib/
    197 root 20 0 28232 8064 5632 S 0.0 0.0 0:00.37 /usr/lib/
    544 root 20 0 2476 1536 1408 S 0.0 0.0 0:00.00 /usr/sbin
    545 root 20 0 2892 1536 1408 S 0.0 0.0 0:00.01 /usr/sbin
    549 root 20 0 78760 2304 2048 S 0.0 0.0 0:00.10 /usr/sbin
    559 root 20 0 777M 67696 63616 S 0.0 0.2 0:00.02 /usr/bin/
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    Not currently. I will test the new driver and update the FAQ with the changes when I am finished testing.

    Best,
    Jared

  • Hi,

    Tested the new driver on the AM62 (BeaglePlay). The instructions for the FAQ have been updated.

    Best,
    Jared