Skip to content

Imx93 sar adc #92882

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 6 commits into
base: main
Choose a base branch
from

Conversation

ZhaoQiang-b45475
Copy link
Contributor

Support adc on imx93 board

Copy link

github-actions bot commented Jul 9, 2025

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

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@7a52cbb (master) zephyrproject-rtos/hal_nxp#573 zephyrproject-rtos/hal_nxp#573/files

DNM label due to: 1 project with PR revision

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

@github-actions github-actions bot added manifest manifest-hal_nxp DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Jul 9, 2025
ADC_Type *base;
void (*irq_config_func)(const struct device *dev);
const struct device *clock_dev;
clock_control_subsys_t clock_subsys;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need clock_dev and clock_subsys in the current driver?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we really need clock_dev and clock_subsys in the current driver?

We didn't use clock_dev and clock_subsys now, but it is better to keep it.

ADC_ClearConvIntStatus(base, kADC_NormalConvChainEndIntFlag);
}

if (((ADC_GetConvIntStatus(base) & kADC_NormalConvEndIntFlag))) {
Copy link

Choose a reason for hiding this comment

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

This code can be removed? as we only enabled ECH interrupt?

Copy link
Contributor Author

@ZhaoQiang-b45475 ZhaoQiang-b45475 Jul 10, 2025

Choose a reason for hiding this comment

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

This two bits will be set by IP, it's better to clear them all. However, it's not a big problem.

interrupts = <219 0>;
status = "disabled";
#io-channel-cells = <1>;
clocks = <&ccm IMX_CCM_LPUART2_CLK 0x0 0>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why use lpuart clock?

&sar_adc1 {
status = "okay";
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

Update imx93_evk_mimx9352_m33.yaml to add adc in supported features?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

help
Amount of hardware command channels to use, reduce to save RAM.
The user can reduce this value if their application uses fewer than
15 ADC channels. This value corresponds to how many of the CMD
Copy link
Collaborator

Choose a reason for hiding this comment

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

15 should be 8?

# Copyright (c) 2025, NXP
#
# SPDX-License-Identifier: Apache-2.0
#
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to update testcase.yaml to use this conf file or move it to boards subdirectory and rename it to be platform name .conf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Add driver for the SAR ADC

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Added SAR_ADC clock support for clock_control_mcux_ccm_rev2

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Add ADC node on imx93 core m33

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
@ZhaoQiang-b45475 ZhaoQiang-b45475 force-pushed the imx93-sar-adc branch 2 times, most recently from d4ad0f1 to fb06496 Compare July 11, 2025 03:30
Add necessary configuration for sar_adc1 on imx93 core cm33
There are some issues with USERSPACE, so add an overlay to
disable CONFIG_TEST_USERSPACE, will drop it once it works.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
enable CPU_CORTEX_M_HAS_DWT for imx93 core m33

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
- Update imx93 headers and sar_adc driver

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Clock Control DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-hal_nxp platform: NXP Drivers NXP Semiconductors, drivers platform: NXP MPU platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants