2020-11-09 04:43 AM
Hello,
I am completely newby on embedded linux stuffs.
Can any one tell me how to drive any available LED on the STM32MP157C-Dk2 board by using the linux shell commands.
Unfortunatelly i did not find the information on the wiki stm32mcu.
Thank you by advance.
Solved! Go to Solution.
2020-11-09 09:02 AM
Hello,
https://github.com/brgl/libgpiod/blob/master/README
A "new" libgpiod library is installed in the stlinux kernel. ( Apparently Sysfs is deprecated).
In my case of the STM32MP157C-Dk2 the lib woks well. example
-"gpiodetect" gives all available GPIOx ports
-"gpioinfo gpiochip7" gives all pins and the config states
-"gpioset gpiochip7 7=1" makes the LED7 Orange ON.
- "gpioget gpiochip0 14" gives the state of the user button USER1.
Regards
2020-11-09 05:05 AM
Hello,
maybe this will help : https://community.st.com/s/article/FAQ-STM32MP1-How-to-get-initialized-a-generic-GPIO-to-control-a-LED-with-a-pull-up-pull-down
Regards.
2020-11-09 05:15 AM
STM32 Education = https://www.st.com/content/st_com/en/support/learning/stm32-education.html Many Sections & Styles
ST Getting Started = https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:STM32_step_by_step_overview
ST Development Zone = https://wiki.st.com/stm32mcu/wiki/Development_zone
I recommend the set of tutorials under education for the STM32 series you have selected (F4, L4, H7...), they seem to be a bit more complete than the others.
You will see many references to examples in this path, but I found those to mostly be pre-STM32CubeMX
Paul
2020-11-09 06:16 AM
Thank you Paul for this usefull informations. I dive into them.
Regards
2020-11-09 06:25 AM
Hello Patrick,
Thank you for your answer.
This sounds like developping driver module on linux.
I hoped that some leds where already available for driving from the stlinux shell on this STM32MP157C-Dk2 plateforme.
Now, lets take this readings !
Regards.
2020-11-09 09:02 AM
Hello,
https://github.com/brgl/libgpiod/blob/master/README
A "new" libgpiod library is installed in the stlinux kernel. ( Apparently Sysfs is deprecated).
In my case of the STM32MP157C-Dk2 the lib woks well. example
-"gpiodetect" gives all available GPIOx ports
-"gpioinfo gpiochip7" gives all pins and the config states
-"gpioset gpiochip7 7=1" makes the LED7 Orange ON.
- "gpioget gpiochip0 14" gives the state of the user button USER1.
Regards
2020-11-12 01:11 AM
Hi @Sisyphus38 ,
I confirm your finding.
You may have find all information in wiki page https://wiki.st.com/stm32mpu/wiki/How_to_control_a_GPIO_in_userspace
And in an already provided exemple in /usr/local/Linux-A7-examples/GPIO/leds on your target.
Olivier