2022-09-27 12:22 AM
Hi! I'm really new to this world, so I'll appreciate the simplicity of your answers.
I have an STM32MP157F-DK2 at the University and I need to measure a voltage signal and an UART signal. Can I use only the dual Cortex®-A7 32 bits for configuring the board pins? Or do I must use the Cortex®-M4?
Either way, I'm having problems with understanding all this. I have finished reading the instalation wikis, what's the difference between working with the Cortex®-M4 with STM32CubeMP1 installed, and working with the Cortex®-A7 32 bits with the Linux Kernell?
I need to create a GUI that shows the voltage signal an the UART that represents temperature, but I need the pins of the board for detecting those signals.
Solved! Go to Solution.
2022-10-05 11:53 PM
Hi,
in_voltage6_raw correspond to ADCx_INP6
Here is a step by step to acquire ADC1_INP6 on DK2 with ecosystem v4.x
root@stm32mp1:~# grep -H "" /sys/bus/iio/devices/*/name | grep adc
/sys/bus/iio/devices/iio:device5/name:48003000.adc:adc@0
/sys/bus/iio/devices/iio:device6/name:48003000.adc:adc@100
root@stm32mp1:~# ls /sys/bus/iio/devices/iio:device5/in*_raw
/sys/bus/iio/devices/iio:device5/in_voltage0_raw
/sys/bus/iio/devices/iio:device5/in_voltage13_raw
/sys/bus/iio/devices/iio:device5/in_voltage18_raw
/sys/bus/iio/devices/iio:device5/in_voltage19_raw
/sys/bus/iio/devices/iio:device5/in_voltage1_raw
/sys/bus/iio/devices/iio:device5/in_voltage6_raw
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage6_raw
47065
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage_scale
0.038146972
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage_offset
0
Regards,
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
2022-09-28 06:43 AM
Hi @Andrés Bonilla
Except if you have very tight real-time constrains, you should probably being able to do what you want by using STM32MP157F-DK2 starter package and Cortex-A7 Linux.
Cortex-M4 is usually required when there is hard real time constrains (e.g. motor control, high input reactivity, etc...).
Some ADC and TTY(UART) trials with Linux command lines are possible
(note that you need to choose '2: stm32mp157f-dk2-a7-examples' during boot to get confirmation listed below) :
Some ADC pins are available with this starter package Device Tree on DK2 board (please also refer to board documentation:(
For UART,
See https://wiki.st.com/stm32mpu/wiki/Serial_TTY_overview
Then, you could use them from any application (e.g. in python).
For GUI, I'm not expert, but there is many possible options with Weston Wayland (https://wiki.st.com/stm32mpu/wiki/Wayland_Weston_overview).
Demo is using GTK (https://wiki.st.com/stm32mpu/wiki/GTK_demo_launcher), but there is certainly other options.
Regards
2022-09-28 10:52 PM
Ok, I understand the pin configuration! I appreciate a lot your answer.
Now, once I have those measurements, how can I use that information for the GUI?
Or even then, how can I run Python on the STM for showing the measurements in a Python implemented GUI, do I need to use the STMcube IDE or SDK?
Or implementing a GUI in Python is not needed and I can jump to Weston Wayland directly for showing those measurements?
2022-09-29 01:19 AM
Hi,
I'm not expert of application development on Linux. That's a very generic embedded Linux question not really linked to a specific processor.
Maybe not the right place to post this question.
There is many way to do what you expect, but STM32CubeIDE is usually not required (used mostly today only for M4 FW development). Nevertheless, you could refer to this example of debug of user space application https://wiki.st.com/stm32mpu/wiki/How_to_debug_a_user_space_application_with_STM32CubeIDE/User_space_GTK_library_project
Python or C code are languages to build your application, not a GUI.
Wayland is a display framework which could be used by an application to build a GUI based on libraries like: GTK (native on Starter package), Qt, etc....
Here you need to get your own insight to develop your application and the associated GUI.
I guess it is similar issue than on any Linux PC, except that using different display management and that you do cross development on a PC then download the application to the STM32MP1 target filesystem.
Regards.
2022-10-05 10:08 AM
Hi! I'm trying to do the voltage meausure with this pins
But I'm having problems with the terminal configuration. Here: https://wiki.stmicroelectronics.cn/stm32mpu/index.php?title=How_to_use_the_IIO_user_space_interface&diff=prev&oldid=75950 it says that I must use the device matching the ADC peripheral.
How do I know wich device is associated to the pin that I am using for measure the voltage? Because in there it says as an example "in_voltage6_raw", but I don't know wich pin is that.
2022-10-05 11:53 PM
Hi,
in_voltage6_raw correspond to ADCx_INP6
Here is a step by step to acquire ADC1_INP6 on DK2 with ecosystem v4.x
root@stm32mp1:~# grep -H "" /sys/bus/iio/devices/*/name | grep adc
/sys/bus/iio/devices/iio:device5/name:48003000.adc:adc@0
/sys/bus/iio/devices/iio:device6/name:48003000.adc:adc@100
root@stm32mp1:~# ls /sys/bus/iio/devices/iio:device5/in*_raw
/sys/bus/iio/devices/iio:device5/in_voltage0_raw
/sys/bus/iio/devices/iio:device5/in_voltage13_raw
/sys/bus/iio/devices/iio:device5/in_voltage18_raw
/sys/bus/iio/devices/iio:device5/in_voltage19_raw
/sys/bus/iio/devices/iio:device5/in_voltage1_raw
/sys/bus/iio/devices/iio:device5/in_voltage6_raw
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage6_raw
47065
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage_scale
0.038146972
root@stm32mp1:~# cat /sys/bus/iio/devices/iio:device5/in_voltage_offset
0
Regards,
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
2022-10-09 06:46 PM
Hi! I've been stuying the GUI development for the STM32. If I want to do it with Python, I should develop the code and then import the code and the libraries to the board, right?
While I was investigating I also ran into "Embedded Wizard". Is another a good option for extracting the measure from the pins and displaying in the monitor?