Skip to main content
Miguel Olivan
Visitor II
May 20, 2021
Question

How to get correct ADC values in STM32MP157C-DK2

  • May 20, 2021
  • 1 reply
  • 945 views

I was trying to test the ADC of a STM32MP157C-DK2. I downloaded a basic example program to perform the data acquisition in the M4 processor (https://github.com/STMicroelectronics/STM32CubeMP1/tree/master/Projects/STM32MP157C-DK2/Examples/ADC/ADC_SingleConversion_TriggerTimer_DMA)

The results that I'm having in the DMA buffer don't correspond with de DAC configuration guided by the USER1 button, getting values such as 0xfff or 0x800 instead of the values I'm expecting ( from 0 to maximum range in 4 steps as stated in the documentation)

Should I connect some input to some output?

The documentation doesn’t seem clear to me. It states that "If same pin is used no connection is required, it is done internally. Otherwise, user need to connect a wire between PA4 and PA4". I searched PA4 in the DK2 schematics with no luck.

What could be the source of this behavior?

This topic has been closed for replies.

1 reply

PatrickF
ST Employee
May 20, 2021

Hi,

is the VDDA enabled ? By default this supply is disabled if ADC is not used in Linux and not declared in DT as M4 ressource.

See https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_Package#Select_boot_mode_for_m4_examples how to run examples

See also 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 'Best Answer' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent