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.

TMDS243EVM: Enet CPSW TimeSync PTP Demo

Part Number: TMDS243EVM
Other Parts Discussed in Thread: TMDS64EVM

Our customer sees the "Enet CPSW TimeSync PTP Demo" fail with TMDS243EVM. Note that Linux on the TMDX654GPEVM was used for the master clock instead of a Linux PC.

https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_06_00_45/exports/docs/api_guide_am243x/EXAMPLES_ENET_LAYER2_MULTI_CHANNEL_PTP.html

Enet_validateIoctl: Malformed IOCTL cmd 0x01000304 prms 7011F664 inArgs 7011F658 / 8 outArg 00000000 / 0
Enet_validateIoctl: Malformed IOCTL
Assertion @ Line: 1486 in c:/ti/mcu_plus_sdk_am243x_08_06_00_43/source/networking/enet/core/src/core/enet.c: status == ENET_SOK

I have reproduced the issue. Note that TMDS64EVM was used instead of TMDS243EVM.

Attached are the message logs for each of TMDX654GPEVM as a PTP broadcaster and TMDS64EVM with the demo.

TMDX654GPEVM PSDK Linux PTP broadcaster Log.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
U-Boot SPL 2021.01-gdce3935756 (Mar 25 2023 - 15:34:42 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.5--v08.06.05 (Chill Capybar')
SPL initial stack usage: 1416 bytes
Trying to boot from MMC2
spl_load_fit_image: Skip load 'dm': image size is 0!
Starting ATF on ARM64 core...
NOTICE: BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE: BL31: Built : 14:59:33, Mar 25 2023
I/TC:
I/TC: OP-TEE version: 3.20.0 (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 Sat Mar 25 15:09:20 UTC 2023 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.5--v08.06.05 (Chill Capybar')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Fixing SA2UL firewall owner for GP device
I/TC: Enabled firewalls for SA2UL TRNG device
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

TMDS64EVM MSDK RTOS Enet CPSW TimeSync PTP Demo Log.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
==========================
L2 Multi-channel Test
==========================
Init all peripheral clocks
----------------------------------------------
Enabling clocks!
Create RX tasks
----------------------------------------------
cpsw-3g: Create RX task
Open all peripherals
----------------------------------------------
cpsw-3g: Open enet
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:1 From 4 To 2
Init all configs
----------------------------------------------
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Could you tell me how to fix the issue?

Unfortunately we do not have a Linux PC with a NIC that supports PTP.

Is a Linux PC required as a PTP broadcaster for the demo to work?

Best regards,

Daisuke

  • Hello Daisuke,

    I see the issue is only present in debug build (Can you confirm the same?), I root caused the issue, this is because of the incorrect ioctl parameters validation  (ioctl params validation only happens in debug mode).  We see that this is a bug introduced in 8.6. Unfortunately, our testing didn't cover the debug mode of this application. We will fix this bug in the upcoming release.
    For now, Please use release mode of this application. If you want to use debug mode, Please use the below work around in mcu_plus_sdk/source/networking/enet/core/src/core/enet.c to avoid the assert. (at line number: 517). Proper fix will be coming in the upcoming release.


    Fullscreen
    1
    2
    3
    4
    ENET_IOCTL_VALID_PRMS(ENET_TIMESYNC_IOCTL_SET_TIMESTAMP,
    - sizeof(EnetTimeSync_setTimestamp),
    + sizeof(uint64_t),
    0U),
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Please clean and re-build the libs after making this change

    make -s -f makefile.am243x libs-clean
    make -s -f makefile.am243x libs

    Regards

    Susheel