cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157 MINI - ADC Analog Muti channel IO

bass34
Associate II

Hello friends,
Please, if you can really help me, I'm not an expert in the Linux device tree.

I urgently need to understand the commands to execute on the device tree on the powerful STM32MP157 MINI Linux board alientek ATOMIC (Note: Chinese language, please right click google automatically translate from browser):

https://www.bilibili.com/video/BV15U4y1E7Bh/

https://www.bilibili.com/video/BV1kr4y1c7bv/

https://www.alientek.com/Product_Details_17/31.html

 

WiKi Compiler YOCTO Linux Image:

https://han-ya.blogspot.com/2024/03/stm32mp157-linux.html

GUI QT

 

 

ADC1+ADC2  - Analog Multi channel IO

ARM_LINUX_ADC_RS485_MCU_EEPROM_PANEL_v2.jpg

STM32MP157_MINI_Periferiche_inizializzate.jpg

DEVICE TREE

It is essential to create from device tree :

- 8 ANALOG type GPIO physical pins on the board (AN0,AN1,AN2, AN3,AN4,AN5,AN6,AN7)

- 3 GPIO physical pins of PWM type real time motors on the board (PWM0, PWM1,PWM3)


But manufacturing company says only 2 ADC pins can be read,
I attach STM32MP157 MINI mapping:

bass34_0-1717702888727.png

bass34_0-1717704467061.png

STM32MP157DAA1_1G-RAM _ 8GB-eMMC - Datasheet
But the powerful SOM BOARD STM32MP157DAA1_1G-RAM _ 8GB-eMMC clearly specifies 22 multiple IO Analog channels on ADC1 and ADC2 and 32 multiple PWM IO channelsADC_PWM_channel.jpg


Please multiple control of 8 analog sensors and 3 PWM sensors (motor control) in Linux is fundamental for my machine control project from Linux CPU, that's why I chose the powerful STM32MP157 MINI board from alintek (STM32MP157DAA1_1G-RAM _ 8GB-eMMC)


Your precious help is essential, thanks

12 REPLIES 12
PatrickF
ST Employee

Hi @bass34 

I don't know which kind of default configuration the board manufacturer has made on their HW and their provided SDK.

 

You should ask board manufacturer in first intend.

If you need to rebuild the whole Yocto sequence for a particular board, please have a look to

https://wiki.st.com/stm32mpu/wiki/Category:STM32MPU_Embedded_Software_distribution

 

more specifically for ADC and PWM

https://wiki.st.com/stm32mpu/wiki/ADC_device_tree_configuration#DT_configuration_-board_level-

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

 

you might also need to look at component datasheet and reference manual to see which pins have ADC input and TIM output capabilities (link to STM32MP157F page)

 

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.

thanks Patrick but I'm very angry,
the manufacturer responded Alientek simply by sending the pin mapping of the motherboard saying that only 2 GPIO PINS can be used to read channels and therefore only 2 analog sensors B23 e B24:

bass34_0-1717786270249.png

bass34_1-1717786570048.png

 

while their data sheet of their assembled SOM CORE Board STM32MP157DAA1_1G-RAM _ 8GB-eMM clearly talks about ADC1 and ADC2 on which up to 22 analog channels can run, I am very angry now and confused:

ADC_PWM_channel.jpg

Link Mega pin MAPPING STM32MP157 MINI Linux development board Alientek:

https://mega.nz/file/QHtSWJwT#i2PgTgWjf48058L6PZbGG666GtgZ5CBr89ktRE0znoM

STM32MP157_MINI_Periferiche_inizializzate.jpg

 

Link MEGA SOM CORE Board STM32MP157DAA1_1G-RAM _ 8GB-eMM - Alientek:

https://mega.nz/file/ND12UJwB#ThZhvhrpqe2X3mz7G6Mb5SgykJ1XQyiwGn1z3Ebr9gc

 

 

 

Scheda di sviluppo Linux Alientek STM32MP157 (cinese, tradurre il pulsante dal browser):
nessuna indicazione su come mappare e inizializzare canali multi analogici e PWM sui pin del connettore GPIO:

http://47.111.11.73/thread-327490-1-1.html

https://www.cnblogs.com/toutiegongzhu/p/17632985.html#%E2%91%A4%20of_iomap%20%E5%87%BD%E6%95%B0

ADC_GPIO_B21_B22_B23_B24.pngSTM32MP157_MINI_TOUCHSCREEN_4.3.jpg

 

Is it possible to indicate here a ready-made YOCTO STM32MP157 factory linux image?                                              Device tree already integrated with multi analog pin GPIO and multi PWM pin GPIO real time motor control?

NOTE: Little information Linux system ready images fast run on STM32MP157 compared to the raspberry platform -

bass34
Associate II

is there anyone here?
Not possible too little information on STM32MP157 Linux platform, analog GPIO multi pin mapping,

bass34
Associate II

The manual for MULTIPLEXING GPIO pins has arrived and I attach it here on topic,
but it is not clear how to create a new .tsv file of the new firmware

1) after modifying the dtsi files of the KERNEL source device tree (mapping of the new 6 GPIO pins as Analog INPUT) how to create a new firmware .tsv file?

ANALOG_GPIO_PIN_MULTI_CHANNEL.jpg

Should these 3 commands for compiling the new device tree be executed via ssh directly on the file system of the STM32MP157 MINI board?

1)source /opt/st/stm32mp1/3.1-snapshot/environment-setup-cortexa7t2hf-neonvfpv4-ostl-linux-gnueabi
2) make stm32mp1_atk_defconfig
3) make uImage dtbs LOADADDR=0XC2000040 vmlinux -j16

make_compile_device_free_cn.jpg

 

 

2) The software to read the analog voltage on a specific GPIO PIN as per the MULTIPLEXING manual on page 56 is performed by calling together device 1 (entire ADC1 voltage) and device 2 (entire ADC2 voltage), but in the case of 6 pins GPIO separated and configured on ADC1 and ADC2 how do you read the analog voltage on the individual GPIO pins separately and independently:

READ_SOFTWARE_multi_channell_pin.jpg

 

Hi @bass34 

I cannot help you on the way to generate binaries from Alientek SDK (As ST support is done with Yocto based SDK, see https://wiki.st.com/stm32mpu/wiki/STM32MP1_Distribution_Package ).

Regarding ADC, please have a look to

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

https://wiki.st.com/stm32mpu/wiki/ADC_OpenSTLinux_drivers#Linux_kernel_driver

https://wiki.st.com/stm32mpu/wiki/How_to_use_the_IIO_user_space_interface#How_to_do_a_simple_ADC_conversion_using_the_sysfs_interface

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.

Hi Patrick
Thank you, 

 

The YOCTO factory image of the STM32MP157 is a .tsv:

YOCTO_Linux_factory_image.jpg

 

The MULTIPLEXING STM32MP157 MINI powerful board manual says that after editing the .dtsi files:

"Once you have completed editing the files, save the file and compile the device tree by indicating these commands MAKE Compile":

source /opt/st/stm32mp1/3.1-snapshot/environment-setup-cortexa7t2hf-neonvfpv4-ostl-linux-gnueabi
make stm32mp1_atk_defconfig
make uImage dtbs LOADADDR=0XC2000040 vmlinux -j16

make_compile_device_free_cn.jpg

1) but where should they be launched on the STM32MP157 MINI board or on the compiler PC?

2) how to create a new .tsv file with compiled analog GPIO multi pins?

 

bass34
Associate II

For reading the Analog IOs I want to use the powerful python3 pinPong libraries developed by DFRobot, a quick compile and run technique, specify only the IO pin number on which the sensor is connected, without any specification of the type of MCU microcontroller integrated on the ARM CPU (Arduino , ESP32, Risk), can you tell me does it also work on the Linux STM32MP157 board for analog IO reading MPU integrated?
https://www.unihiker.com/wiki/pinpong_python_lib​
https://wiki.dfrobot.com/pinpong_introduction​
https://www.unihiker.com/wiki/system-framework​
https://www.unihiker.com/wiki/ specifies

image (8).png