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.

    git clone -b master https://gitlab.com/npitre/ethercat.git
  • 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.

  • 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
    [  240.723818] Call trace:
    [  240.726253]  k3_ringacc_ring_pop_mem+0x34/0xb0
    [  240.730684]  k3_ringacc_ring_pop+0x34/0x94
    [  240.734768]  k3_udma_glue_pop_tx_chn+0x1c/0x68
    [  240.739196]  am65_cpsw_nuss_tx_compl_packets_2g.constprop.0+0x7c/0x268 [ec_ti_am65_cpsw_nuss]
    [  240.747716]  am65_cpsw_nuss_tx_poll+0xc0/0xe8 [ec_ti_am65_cpsw_nuss]
    [  240.754058]  __napi_poll+0x38/0x178
    [  240.757534]  net_rx_action+0x128/0x270
    [  240.761269]  __do_softirq+0x100/0x26c
    [  240.764918]  ____do_softirq+0x10/0x1c
    [  240.768567]  call_on_irq_stack+0x24/0x4c
    [  240.772476]  do_softirq_own_stack+0x1c/0x2c
    [  240.776645]  irq_exit_rcu+0xc0/0xdc
    [  240.780121]  el1_interrupt+0x38/0x68
    [  240.783686]  el1h_64_irq_handler+0x18/0x24
    [  240.787768]  el1h_64_irq+0x64/0x68
    [  240.791156]  mutex_unlock+0x24/0x5c
    [  240.794633]  vfs_read+0xc4/0x2b4
    [  240.797850]  ksys_read+0x74/0x10c
    [  240.801152]  __arm64_sys_read+0x1c/0x28
    [  240.804974]  invoke_syscall+0x48/0x114
    [  240.808711]  el0_svc_common.constprop.0+0xc0/0xe0
    [  240.813400]  do_el0_svc+0x1c/0x28
    [  240.816702]  el0_svc+0x2c/0x84
    [  240.819745]  el0t_64_sync_handler+0x120/0x12c
    [  240.824087]  el0t_64_sync+0x190/0x194

    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.

    [    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.
    [  OK  ] Finished Virtual Console Setup.
    [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.

  • 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