Skip to content

NXP PTP Driver: invalid assertion #89449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
duerrfk opened this issue May 4, 2025 · 0 comments · May be fixed by #89450
Open

NXP PTP Driver: invalid assertion #89449

duerrfk opened this issue May 4, 2025 · 0 comments · May be fixed by #89450
Assignees
Labels
area: PTP IEEE 1588 PTP Protocol bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug

Comments

@duerrfk
Copy link

duerrfk commented May 4, 2025

Describe the bug

The following assertion in the NXP PTP driver, function nxp_enet_ptp_clock_callback(), file zephyr/drivers/ptp_clock/ptp_clock_nxp_enet.c, is wrong:

__ASSERT(cb_data == NULL, "ptp data is NULL");

The intention is to ensure that cb_data is not NULL, therefore, the check should be for cb_data != NULL:

__ASSERT(cb_data != NULL, "ptp data is NULL");

Actually, I saw this bug when I wanted to send a pull request for a more severe bug (enet_handle of PTP driver data should be a pointer to the enet_handle of the MAC driver, not a new instance of the data structure), but I am happy to see that this bug has been fixed already concurrently, and gPTP seems to work again on NXP i.MX RT106x).

To Reproduce

Platform: Teensy 4.1 (same issue applies at least to all NXP i.MX RT106x platforms).

Compile with gPTP and assertions:

CONFIG_NET_GPTP=y
CONFIG_ASSERT=y

Run gPTP sample (samples/net/gptp) and wait for assertion to fire.

Expected behavior

Assertion should not fire (cb_data is actually != NULL as it should be).

Impact

minor (unless assertions are used).

Logs and console output

Console output shows that assertion has fired and halts.

Environment (please complete the following information):

  • OS: Linux (Debian);
  • Target platform: Teensy 4.1 / NXP i.MX RT106x
  • Toolchain: SDK 0.17.0
  • Head May 4, 2025 (021d90b)

Additional context
n/a

@duerrfk duerrfk added the bug The issue is a bug, or the PR is fixing a bug label May 4, 2025
@duerrfk duerrfk linked a pull request May 4, 2025 that will close this issue
@henrikbrixandersen henrikbrixandersen added the area: PTP IEEE 1588 PTP Protocol label May 4, 2025
@dkalowsk dkalowsk added the priority: low Low impact/importance bug label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: PTP IEEE 1588 PTP Protocol bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants