0

I'm using this ARM AT91 Sam9x5ek Embedded Device, with my Linux Images made by a Buildroot. Usually my init-system is Busybox, now I changed it to systemd. Since then I can't access the GPIO anymore, or at least I can't change the value:

This is the working script I use for changing a pin with the Busybox init system:

#! /bin/sh
echo 104 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio104/direction
echo 1 > /sys/class/gpio/gpio104/value

Now my embedded device with systemd, runs everything but the last line (setting the actual value). I'm logged in as root, so permission right should actually not be the problem.

This is my service file:

[Unit]
Description=USER: Camilo - GPIO

[Service]
Type=idle
ExecStart=/home/exec_camilo
ExecStop=/home/setDownGPIO

[Install]
WantedBy=multi-user.target

Does anybody know why this happens? And has somebody an idea how to fix it ?

Kind Regards

  • Do you get an error message? Is this script being run as a systemd service? – derobert Aug 6 '14 at 11:03
  • It's running as systemd service, and I get no error messages. When I cat the pin, It shows my always the value from the very beginning, doesn't matter to which values I force it to put. – user3085931 Aug 6 '14 at 11:05
  • 1
    Does systemctl status your-service-name.service give anything useful? – derobert Aug 6 '14 at 11:10
  • 2
    Your service file is going to execute really early, since it doesn't have any After= ... It may just be coming up too early (e.g., before the GPIO driver is loaded, or somesuch). Not sure how that interacts with Type=idle personally. If you restart your service (after boot), does it work? – derobert Aug 6 '14 at 11:17
  • 2
    I would guess systemd loaded something in the wrong order. A compare of dmesg (e.g., diff or vim -d) from BusyBox/SysV boot vs. systemd boot might give some clues. Not sure if 2.6.39 prefixed all the lines with a since-boot timestamp, but if it did, you'll need to remove (or change to [X] or similar) those before feeding to diff. – derobert Aug 6 '14 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.