Skip to content

NXP S32 introduce support PSI5 #79824

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
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

congnguyenhuu
Copy link
Contributor

@congnguyenhuu congnguyenhuu commented Oct 15, 2024

Introduce support Peripheral Sensor Interface (PSI5) driver on S32Z. This driver allows to communication (send, receive) with PSI5 device.
The test result: PSI5-TESTING-RESULT.pptx

RFC: #83982

@congnguyenhuu congnguyenhuu changed the title Nxp S32 introduce support psi5 NXP S32 introduce support PSI5 Oct 15, 2024
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from 0ee0652 to b50ef76 Compare October 15, 2024 06:00
@zephyrbot
Copy link
Collaborator

zephyrbot commented Oct 15, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@6b11d19 zephyrproject-rtos/hal_nxp#451 zephyrproject-rtos/hal_nxp#451/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_nxp DNM This PR should not be merged (Do Not Merge) labels Oct 15, 2024
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 2 times, most recently from acc9b3e to 5a072e9 Compare October 24, 2024 07:20
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 3 times, most recently from 101fad8 to dfebc33 Compare November 1, 2024 02:41
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from dfebc33 to 69e051a Compare November 22, 2024 10:27
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 3 times, most recently from 402551c to 9a0367b Compare December 5, 2024 07:52
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 3 times, most recently from 4ce3d57 to eca2db8 Compare December 12, 2024 07:58
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 4 times, most recently from 147bb43 to 05f2644 Compare January 10, 2025 09:43
@congnguyenhuu congnguyenhuu marked this pull request as ready for review January 15, 2025 03:15
@manuargue manuargue added the RFC Request For Comments: want input from the community label Jan 15, 2025
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from 05f2644 to 942502a Compare January 15, 2025 07:56
Copy link
Collaborator

@JarmouniA JarmouniA left a comment

Choose a reason for hiding this comment

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

A test is needed as well, samples are not a replacement for tests.

#
# SPDX-License-Identifier: Apache-2.0

description: Properties for Peripheral Sensor Interface (PSI5)
Copy link
Collaborator

Choose a reason for hiding this comment

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

DeviceTree binding for

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@congnguyenhuu They are redundant and do not need to be prefixed. Putting them in dts/bindings already indicates that they are a binding. E.g. other bindings description.

Renesas RA ADC node

Static Battery Characteristics

Description of pre-defined file systems.

ADI MAX32 compatible Counter RTC

PL330 DMA Controller

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is a vendor-agnostic API, I don't see why this sample is placed in the NXP folder.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because this is the smallest sample it provides that can run, I guess its prototype is developed based on nxp soc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Except the device node name (added a comment about it below), I don't see anything vendor-specific in the sample's code, that would justify placing it in the vendor's folder.

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 moved this sample to a generic driver sample.
And also created a test API driver .


#include <zephyr/drivers/psi5/psi5.h>

#define PSI5_NODE DT_INST(0, nxp_s32_psi5)
Copy link
Collaborator

Choose a reason for hiding this comment

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

A vendor-agnostic alias, that will be defined in board overlay, should be used here, instead of the IP DT node name.

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

@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from 942502a to 8c5a2c3 Compare January 16, 2025 07:00
@nashif nashif assigned manuargue and unassigned nashif and MaureenHelm Jan 17, 2025
@fabiobaltieri fabiobaltieri added DNM (manifest) This PR should not be merged (controlled by action-manifest) and removed DNM This PR should not be merged (Do Not Merge) labels Feb 4, 2025
@Dat-NguyenDuy Dat-NguyenDuy added the Architecture Review Discussion in the Architecture WG required label Feb 6, 2025
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from 8c5a2c3 to e84c299 Compare February 6, 2025 06:09
@zephyrbot zephyrbot requested a review from mbolivar February 6, 2025 06:10
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from e84c299 to 2da4f02 Compare February 6, 2025 09:02
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 2 times, most recently from ce89bc9 to 5f95551 Compare February 27, 2025 08:11
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch 2 times, most recently from d263e57 to b7feffc Compare March 10, 2025 09:28
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from b7feffc to ac6a683 Compare April 23, 2025 09:56
@congnguyenhuu
Copy link
Contributor Author

congnguyenhuu commented Apr 23, 2025

Based on the suggestions from the Architecture WG meeting on March 4th, I have updated to the v1 changes. These updates include:

  1. Changed add_rx_callback(dev, channel, serial_cb, data_cb, user_data) to
    register_callback(dev, channel, struct psi5_rx_callback_configs callback_configs)

With the newly defined structure for RX callback configurations in psi5.h

struct psi5_rx_callback_config {
	psi5_rx_frame_callback_t callback;
	struct psi5_frame *frame;
	uint32_t max_num_frame;
	void *user_data;
};
 
struct psi5_rx_callback_configs {
	struct psi5_rx_callback_config *serial_frame;
	struct psi5_rx_callback_config *data_frame;
};
  1. RX buffers are allocated by the user to improve throughput:
  • Use the API register_callback to register the RX callback and allocate a user-defined RX buffer for each callback.
  • Count the number of RX buffer frames and trigger the RX callback when the count reaches the maximum buffer frame limit.
  • Reset the count when a RX error occurs or when the count reaches the maximum buffer frame limit.
  1. Tests and samples have been updated to demonstrate usage with the new changes

This driver allows to communication (send, receive) with PSI5 device

Signed-off-by: Cong Nguyen Huu <[email protected]>
enable support psi5

Signed-off-by: Cong Nguyen Huu <[email protected]>
Create test, sample for psi5 driver

Signed-off-by: Cong Nguyen Huu <[email protected]>
@congnguyenhuu congnguyenhuu force-pushed the nxp-s32-introduce-support-psi5 branch from ac6a683 to c1a25f4 Compare April 25, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Review Discussion in the Architecture WG required area: Devicetree area: Process area: Samples Samples DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-hal_nxp platform: NXP S32 NXP Semiconductors, S32 RFC Request For Comments: want input from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants