Skip to main content
Visitor II
June 6, 2024
Question

STM32MP157 MINI - ADC Analog Muti channel IO

  • June 6, 2024
  • 5 replies
  • 4751 views

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

    This topic has been closed for replies.

    5 replies

    Technical Moderator
    June 7, 2024

    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.

     

    bass34Author
    Visitor II
    June 7, 2024

    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

     

     

     

    bass34Author
    Visitor II
    June 7, 2024

    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

     

    bass34Author
    Visitor II
    June 9, 2024

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

    bass34Author
    Visitor II
    June 13, 2024

    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

     

    Technical Moderator
    June 14, 2024
    bass34Author
    Visitor II
    June 14, 2024

    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?

     

    bass34Author
    Visitor II
    June 14, 2024

    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

    bass34Author
    Visitor II
    June 16, 2024

    Hello all friends,
    a beautiful day today!

    A first uImage KERNEL Linux YOCTO STM32MP157 board image has been generated, it is only a first generation test but the cross compiler did not throw errors:

    uImage_YOCTO_kernel_created.jpg


    this guide was fundamental (Chinese, right click automatically translate from Browser please):
    https://www.bilibili.com/read/cv11484220/

    Now what needs to be done:
    1) uImage (local pc):
    uImage should be loaded on the File System of the STM32MP157 board in /boot or in which path??

    2) DEVICE TREE FILES MODIFIED (local pc)
    NOTE: I remember the modified device tree files are the following (see ADC MULTIPLEXING manual EN on page 52:
    - stm32mp15-pinctrl.dtsi
    - stm32mp157d-atk.dtsi

    Which device tree files should be loaded onto the File System of the STM32MP157 motherboard and where should they be loaded in which path??:
    - stm32mp157d-atk-hdmi.dtb (???)
    - stm32mp157d-atk-hdmi.dts (???)
    - stm32mp15-pinctrl.dtsi (???)

    file_dtsi_dts_dtb_UPLOAD_SCP_STM32MP157_board.jpg


    3) SOFTWARE TEST READING MULTI ANALOG DEVICE - MULTI PIN Analog GPIO 
    It is possible to indicate an example of a Python3 script to read 8 analog devices connected to the respective GPIO pins compiled in the files
    Device tree modified:
    - stm32mp15-pinctrl.dtsi
    - stm32mp157d-atk.dtsi

    --------------------------------------------------------------------

    Note*: PowerFull DFRobot pinPong Library (Prefer):

    https://www.unihiker.com/wiki/pinpong_python_lib​
    https://wiki.dfrobot.com/pinpong_introduction
    https://www.unihiker.com/wiki/system-framework​
    -----------------------------------------------------------------

     

    4) BACKUP FIRMWARE YOCTO STM32MP157 (eMMC)

    Is there a method to extract entire Linux YOCTO system image of STM32MP157 board written to eMMC (backup)????
    NB. It is important to have an entire backup image of the working firmware on the board, for quick recovery in the event of a crash of the YOCTO Linux operating system, STM32MP157 board unreachable after loading new uImage system files and other device tree dtb files, etc. 

     

     

    Link MEGA MULTIPLEXING Manual STM32MP157 Board (multi-language):

    https://mega.nz/file/0iJTjApI#3x6eQ35KSevHkDpJcFvLIR6EgpqzxIrTPmTkU-hLRNM

     


    Thank you for your support, it is now fundamental, alientek does not release information

    bass34Author
    Visitor II
    June 29, 2024

    is there anyone here who can help to make ADC multiplexing work, read 5 analog devices on 5 GPIO pins on Linux STM32MPX boards???