Wednesday, April 27, 2016

LED blink STM32f429 with uClinux.

STM32f429 Discovery board has two user LED, and the they LED defined in the uClinux image. STM32f429 Discovery board pin configuration exists at ~/stm32f429-linux-builder/uclinux/arch/arm/mach-stm32/iomux.c that seek keywords 'PG13' or 'PG14' where define gpio PGx to LED configurations.

You can do blinking LEDs from console.

Before Using:
 echo 109 > /sys/class/gpio/export
 echo 110 > /sys/class/gpio/export

Brinking example:
#!/bin/sh

echo 109 > /sys/class/gpio/export
echo 110 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio109/direction
echo out > /sys/class/gpio/gpio110/direction

a=1
while [ $a -ne 0 ]
do
   if [ $a -eq 1 ]
   then
      a=2
      echo 1 > /sys/class/gpio/gpio109/value
      echo 0 > /sys/class/gpio/gpio110/value
   else
      a=1
      echo 0 > /sys/class/gpio/gpio109/value
      echo 1 > /sys/class/gpio/gpio110/value
   fi
   sleep 1
done



No comments:

Post a Comment