cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with ADC Acquisition on STM32MP157D-DK1 Board

FedericoB
Associate

Hello STM community,

I've been encountering some difficulties with ADC acquisition on my STM32MP157D-DK1 board. I've attempted to perform an acquisition of a potentiometer value using the ADC, but unfortunately, I haven't been successful.

I've tried two approaches:

  1. Starting with an STM32 project with pre-set pins (Discovery kit with STM32MP157D MPU).
  2. Starting with an STM32 project without pre-configured pins (STM32MP157DAC1).

In both scenarios, I've failed to obtain a correct analog readings. Despite trying various configurations, I haven't had any luck. Here's what's happening:

Upon connecting the signal connector to the correct pin on the board, I consistently observe the same value (the maximum) for any voltage value, except when the potentiometer reaches the end of travel (0 voltage), at which point the value begins to fluctuate. It seems like the digital value is being saturated during the conversion process.

The potentiometer was connected to the GND and 3V3 pins of the Arduino connector CN16.

I've tried adjusting configurations and settings, but so far, nothing has worked. I would greatly appreciate any insights or guidance on how to resolve this issue. Thank you in advance for your assistance.

 

image.pngFedericoB_1-1710608364130.png

Potentiometer connectionPotentiometer connection

FedericoB_2-1710608613624.png

 

Best regards, 

Federico

3 REPLIES 3
PatrickF
ST Employee

Hi @FedericoB 

This is usually when there is no supply or no reference on ADC.

Did you have correct &m4_adc node in your Linux device tree ?

As VDDA and VREFBUF are managed by Cortex-A7 SW, you should tell Linux that the Cortex-M4 is using ADC, otherwise Linux shutdown any unused supplies (you usually show this shutdown on Linux console few seconds after Linux prompt).

Please have a look to https://wiki.st.com/stm32mpu/wiki/How_to_configure_system_resources#ADC_example

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
FedericoB
Associate

Good morning,

Thank you for your response.

I have checked and indeed, when I turn on the board, I get the message "vdda: disabling". I have never been able to configure the device tree. I followed this guide (1)  to install Buildroot and configure a kernel with preemption. When I try to use a device tree source built with CubeMX, I cannot compile it with Buildroot because some files are missing (like "stm32mp157c-m4-srm.dtsi"). I noticed that the files in the "dts" folder are different from the files present in the online guides. In particular, I have this file (2) while most of the guides refer to this (3). I don't understand what I'm doing wrong in creating the dts.

HI @FedericoB 

I recommend to use latest Ecosystem Revision (latest is v5 based on Linux kernel 6.1.28) as Device Tree are not fully compatible in between revision.

https://github.com/STMicroelectronics/linux/blob/v6.1-stm32mp-r1.1/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi

 

Device tree generated by CubeMX are only partial and you always need to handle some manual adding (usually using diff with existing and working files of the board starter package)

https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package

Regards.

 

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.