cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP135 ADC buffer enable fails

BazongaChief
Associate

Hi, I am encountering some issues while trying to configure the ADC DMA Buffer on the STM32MP135 board , when I execute the following:

echo 1000 > /sys/bus/iio/devices/iio:device1/buffer/length
echo 1 > /sys/bus/iio/devices/iio:device1/scan_elements/in_voltage0_en
echo 1 > /sys/bus/iio/devices/iio:device1/buffer/enable

I receive the following error after the third command:

sh: write error: Invalid argumet

But when reading the ADC's raw output directly via:

cat /sys/bus/iio/devices/iio:device1/in_voltage0_raw

I am able to obtain a normal reading, which suggests that the basic functionality of the ADC is intact.

Operating System: 5.15.24 #1 PREEMPT Sat Apr 13 15:11:38 CST 2024 armv7l GNU/Linux

1 REPLY 1
BazongaChief
Associate

I have used the TIM trigger to operate the ADC in triggered buffer mode successfully.

However, the issue arises when I set the trigger frequency to high values, such as 1MHz.

cd /sys/bus/iio/devices/trigger0

echo 1000000 > sampling_frequency

I've noticed that the CPU usage spikes significantly, even the activation of RT Throttling and occurrences of RCU stalls.

I wonder if there are better ways to optimize this issue when using ADC buffer mode. How to use ADC continuous conversion mode without intervention from the CPU?

Thanks