Skip to content

Add MCXN947 core temperature reading #127

Description

@plskeggs

Support is missing in zephyr/drivers/adc/adc_mcux_lpadc.c for kLPADC_SampleChannelDualSingleEndBothSide. I think this is the proper mode to set to support ADC channel 26 temperature sensor reading, where there will end up being 2 results in the result FIFO in the hardware. These 2 results are used in an equation, together with 3 constants whose values come from the datasheet, to calculate the core temperature in C.

The section in the reference manual:
41.3.7 Temperature sensor on page 1496 in the NXP MCX Nx4x Reference Manual, Document identifier: MCXNP184M150F70RM, Rev. 7, 2025-10-10.. This describes the ADC setup (which in Zephyr is done by the NXP adc driver and the underlying HAL module) and algorithm for calculating temperature.

The device-family-member-specific constants used in the equation:
Table 57, page 63, of the NXP MCXNx4x Product Data Sheet, Rev. 8.2, 11-June 2026.

I think the reference manual has a typo regarding the mode to put the ADC in. It says differential = 2, but that would generate only a single FIFO entry, the difference between the two results. We want each result separately in order to do the calculation,

The relevant NXP Zephyr driver files:
zephyr/drivers/adc/adc_mcux_lpadc.c
zephyr/dts/arm/nxp/nxp_mcxn94x_ns.dtsi -> zephyr/dts/arm/nxp/nxp_mcxn94x_common.dtsi -> zephyr/dts/arm/nxp/nxp_mcxnx4x_common.dtsi
zephyr/dts/bindings/adc/nxp,lpc-lpadc.yaml

The relevant NXP HAL files:
modules/hal/nxp/mcux/mcux-sdk-ng/drivers/lpadc/fsl_lpadc.h
modules/hal/nxp/mcux/mcux-sdk-ng/drivers/lpadc/fsl_lpadc.c
modules/hal/nxp/mcux/mcux-sdk-ng/devices/MCX/MCXN/MCXN947/MCXN947_cm33_core0_features.h
modules/hal/nxp/mcux/mcux-sdk-ng/devices/MCX/MCXN/periph/PERI_ADC.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions