Hi,
in_voltage6_raw correspond to ADCx_INP6
Here is a step by step to acquire ADC1_INP6 on DK2 with ecosystem v4.x
- Reset the board and press a key within uBoot just after autoboot little pause and select choice '2' (stm32mp157f-dk2-a7-examples). This is to use a device tree which includes some additional ADC inputs of the board

- Type the grep command below and look at the device number for ADC1 (as per product Reference Manual, 0x48003000 is the base address of ADC1 and ADC2 and ADC1 is @0 and ADC2 is @100). Here ADC1 is iio:device5
root@stm32mp1:~# grep -H "" /sys/bus/iio/devices/*/name | grep adc
/sys/bus/iio/devices/iio:device5/name:48003000.adc:adc@0
/sys/bus/iio/devices/iio:device6/name:48003000.adc:adc@100
- Confirm the available inputs of ADC1 (linked to chosen device tree according to your board)
root@stm32mp1:~# ls /sys/bus/iio/devices/iio:device5/in*_raw
/sys/bus/iio/devices/iio:device5/in_voltage0_raw
/sys/bus/iio/devices/iio:device5/in_voltage13_raw
/sys/bus/iio/devices/iio:device5/in_voltage18_raw
/sys/bus/iio/devices/iio:device5/in_voltage19_raw
/sys/bus/iio/devices/iio:device5/in_voltage1_raw
/sys/bus/iio/devices/iio:device5/in_voltage6_raw
- Do the raw acquisition and also get scale and offset data (to convert raw value in mV) :
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage6_raw
47065
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage_scale
0.038146972
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage_offset
0
- Compute scaled value = (raw + offset) * scale. Here it is (47065+0)*0.038146972 = 1.795V . This result is ok as I connected externally Arduino A5 (ADC1_INP6) to an 1.8V supply.
Regards,
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
In order to give better visibility on the answered topics, please click on 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent