Skip to content

Conversation

@congnguyenhuu
Copy link
Contributor

@congnguyenhuu congnguyenhuu commented May 12, 2025

Added support for S32Z, ping-pong loopback data on a MBOX channel within one core.
The expected received data must match the sent data when running the sample.

The result for tests/drivers/mbox/mbox_data on s32z2xxdc2/s32z270/rtu0:

Running TESTSUITE mbox_data_tests
===================================================================
START - test_ping_pong_1
 PASS - test_ping_pong_1 in 0.001 seconds
===================================================================
START - test_ping_pong_2
 PASS - test_ping_pong_2 in 0.001 seconds
===================================================================
START - test_ping_pong_3
 PASS - test_ping_pong_3 in 0.001 seconds
===================================================================
START - test_ping_pong_4
 PASS - test_ping_pong_4 in 0.001 seconds
===================================================================
TESTSUITE mbox_data_tests succeeded

------ TESTSUITE SUMMARY START ------

SUITE PASS - 100.00% [mbox_data_tests]: pass = 4, fail = 0, skip = 0, total = 4 duration = 0.004 seconds
 - PASS - [mbox_data_tests.test_ping_pong_1] duration = 0.001 seconds
 - PASS - [mbox_data_tests.test_ping_pong_2] duration = 0.001 seconds
 - PASS - [mbox_data_tests.test_ping_pong_3] duration = 0.001 seconds
 - PASS - [mbox_data_tests.test_ping_pong_4] duration = 0.001 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION SUCCESSFUL

@github-actions github-actions bot added the area: Samples Samples label May 12, 2025
@github-actions github-actions bot requested review from kartben and nashif May 12, 2025 06:31
@congnguyenhuu congnguyenhuu force-pushed the enable-test-sample-mbox-for-s32z branch from 6cbc692 to c6a88c2 Compare May 12, 2025 06:52
@Dat-NguyenDuy Dat-NguyenDuy added area: mbox platform: NXP S32 NXP Semiconductors, S32 labels May 13, 2025
@congnguyenhuu
Copy link
Contributor Author

Hello @kartben, Could you please take a look at my PR? Thanks!

@congnguyenhuu congnguyenhuu requested a review from manuargue May 21, 2025 04:19
@manuargue manuargue requested a review from Dat-NguyenDuy May 28, 2025 04:29
@manuargue
Copy link
Member

manuargue commented May 28, 2025

The hardware MRU on SoC S32Z supports ping-pong loopback data on a MBOX channel within one core.

While it's technically possible to send a message from a CPU to itself, that's not a typical or very meaningful use case -especially in the context of a sample. Mailbox peripherals like the MRU are generally intended for inter-CPU communication. This implementation feels more like an internal test case rather than functionality that should be demonstrated in a generic Zephyr sample.

@congnguyenhuu congnguyenhuu force-pushed the enable-test-sample-mbox-for-s32z branch from c6a88c2 to 4cf05d0 Compare May 29, 2025 02:12
@congnguyenhuu
Copy link
Contributor Author

congnguyenhuu commented May 29, 2025

While it's technically possible to send a message from a CPU to itself, that's not a typical or very meaningful use case -especially in the context of a sample. Mailbox peripherals like the MRU are generally intended for inter-CPU communication. This implementation feels more like an internal test case rather than functionality that should be demonstrated in a generic Zephyr sample.

Yes, this implementation is internal and specific to the NXP S32 SoC. Therefore, I created an internal test for the NXP S32 SoC instead of doing in the generic Zephyr test.

@congnguyenhuu congnguyenhuu changed the title Enable test and sample mbox for S32Z samples: boards: nxp: s32: create sample mbox May 29, 2025
@manuargue
Copy link
Member

manuargue commented May 29, 2025

Yes, this implementation is internal and specific to the NXP S32 SoC. Therefore, I created an internal test for the NXP S32 SoC instead of doing in the generic Zephyr test.

By internal I really meant, internal, as not on this Github repo :) I fail to see the benefit of having an NXP sample for the mailbox driver where a CPU send msgs to itself. We could have maybe two Zephyr apps exchanging msgs through the mailbox, it would make more sense.

If the mbox maintainers think this is useful, please keep it in the generic sample as you originally did. I can only advise from the NXP S32 pov.

Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What @manuargue said, basically. It's really not clear why this new sample would be needed.

@congnguyenhuu congnguyenhuu force-pushed the enable-test-sample-mbox-for-s32z branch from 4cf05d0 to b9192a5 Compare June 6, 2025 10:41
@congnguyenhuu
Copy link
Contributor Author

Hello @kartben, @manuargue, I have updated the change to remove the sample I created. I retained support for tests/drivers/mbox/mbox_data and this test is modified to support loopback test.

@congnguyenhuu congnguyenhuu changed the title samples: boards: nxp: s32: create sample mbox tests: drivers: mbox: mbox_data: add support for s32z Jun 6, 2025
@kartben kartben assigned manuargue and unassigned kartben Jun 10, 2025
Include remote build header files. Can be used if primary image
needs to be aware of size or base address of secondary image

config TEST_LOOPBACK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no such thing as loopback for the mailboxes. I'd rather call this TEST_SINGLE_CPU or the like, and explain the CPU sends a msg to itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to change the name of kconfig

@congnguyenhuu congnguyenhuu force-pushed the enable-test-sample-mbox-for-s32z branch from b9192a5 to 1981e99 Compare June 19, 2025 02:09
The hardware MRU on SoC S32Z supports ping-pong data on a
MBOX channel within one core.

Added Kconfig TEST_SINGLE_CPU to enable test on single CPU  to wrap
the specific code for each testcase, As the expected received data
must match the sent data when running test single CPU. This differs
from the expected data in the current supported test transfer data
between 2 other cores, where the remote core increments the data by
one before transferring it back to the main core.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
@congnguyenhuu congnguyenhuu force-pushed the enable-test-sample-mbox-for-s32z branch from 1981e99 to e79ed41 Compare June 19, 2025 03:14
@sonarqubecloud
Copy link

@congnguyenhuu congnguyenhuu requested a review from kartben June 20, 2025 04:47
@congnguyenhuu
Copy link
Contributor Author

Hello @kartben , could you please revisit this PR? thanks.

@kartben kartben dismissed their stale review June 25, 2025 15:36

addressed

@dkalowsk dkalowsk merged commit 2339c7c into zephyrproject-rtos:main Jun 26, 2025
21 checks passed
@manuargue manuargue deleted the enable-test-sample-mbox-for-s32z branch June 26, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants