Gpio not working

i am using raspberry pi 3 model B with ubuntu core 18 for pi 2/3/4.
here the link to my project https://github.com/codebase82/led-blink.
i have successfully cross compiled the project and deploy it to the target board, installed , done manual gpio plug and bc-gpio-24 successfully.
when i started the snap no error reported but there is not desired output on gpio 24. i tried with other gpios or pins still no success.
can some please assist me. i am newb in this field.

the pin mapping that is used by the pi gadgets is documented under:

do you see any denials in your journal or in dmesg ?

thank you ogra

gotora@localhost:~$ sudo journalctl --output=short --follow --all
– Logs begin at Wed 2020-04-15 14:50:31 UTC. –
Apr 16 13:28:29 localhost systemd[1]: snap.led-pulse.led-pulse.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 16 13:28:29 localhost systemd[1]: snap.led-pulse.led-pulse.service: Failed with result ‘exit-code’.
Apr 16 13:28:30 localhost systemd[1]: snap.led-pulse.led-pulse.service: Service hold-off time over, scheduling restart.
Apr 16 13:28:30 localhost systemd[1]: snap.led-pulse.led-pulse.service: Scheduled restart job, restart counter is at 5.
Apr 16 13:28:30 localhost systemd[1]: Stopped Service for snap application led-pulse.led-pulse.
Apr 16 13:28:30 localhost systemd[1]: snap.led-pulse.led-pulse.service: Start request repeated too quickly.
Apr 16 13:28:30 localhost systemd[1]: snap.led-pulse.led-pulse.service: Failed with result ‘exit-code’.
Apr 16 13:28:30 localhost systemd[1]: Failed to start Service for snap application led-pulse.led-pulse.
Apr 16 13:28:36 localhost sudo[2217]: gotora : TTY=pts/0 ; PWD=/home/gotora ; USER=root ; COMMAND=/bin/journalctl --output=short --follow --all
Apr 16 13:28:36 localhost sudo[2217]: pam_unix(sudo:session): session opened for user root by gotora(uid=0)

well, that doesnt look like there are any denials so the interface connection seems to be fine, it looks more like your app is actually just crashing … i’d try to drop the daemon: simple and run it manually (via sudo) to get more debug output.

when i removed daemon: simple
gotora@localhost:~$ sudo snap start led-blink
error: snap “led-blink” has no services

please tell what do i have to change in snap.yaml file or how do i exactly go about it.

NB: its still the same project led-pulse and led-blink

gotora@localhost:~$ sudo /snap/bin/led-blink
/snap/led-blink/x1/snap/command-chain/snapcraft-runner: 4: exec: /snap/led-blink/x1/bin/led-blink: Exec format error

gotora@localhost:~$ sudo journalctl --output=short --follow --all

– Logs begin at Thu 2020-04-16 12:50:05 UTC. –
Apr 16 15:38:51 localhost kernel: audit: type=1400 audit(1587051531.548:68): apparmor=“ALLOWED” operation=“capable” info=“optional: no audit” error=-1 profile=“snap.led-blink.led-blink” pid=3279 comm=“snap-exec” capability=12 capname=“net_admin”
Apr 16 15:38:51 localhost sudo[3278]: pam_unix(sudo:session): session closed for user root
Apr 16 15:40:33 localhost sudo[3302]: gotora : TTY=pts/0 ; PWD=/home/gotora ; USER=root ; COMMAND=/snap/bin/snappy-debug
Apr 16 15:40:33 localhost sudo[3302]: pam_unix(sudo:session): session opened for user root by gotora(uid=0)
Apr 16 15:40:34 localhost sudo[3302]: pam_unix(sudo:session): session closed for user root
Apr 16 15:41:01 localhost sudo[3330]: gotora : TTY=pts/0 ; PWD=/home/gotora ; USER=root ; COMMAND=/snap/bin/led-blink
Apr 16 15:41:01 localhost sudo[3330]: pam_unix(sudo:session): session opened for user root by gotora(uid=0)
Apr 16 15:41:01 localhost sudo[3330]: pam_unix(sudo:session): session closed for user root

there you go … looks like your cross compiling somehow does not work and the binary is not an arm one …

thank you
so how do i go about this compiling issue any links to tutorial because just followed https://snapcraft.io/blog/easy-iot-with-ubuntu-core-and-raspberry-pi. i downloaded little-orange-display snap from the snap store and run it. in the journal it give same error.

and you are running the armhf (32bit) image variant ?

yes downloaded on this site https://ubuntu.com/download/raspberry-pi-core

i solved this problem by compiling by first compiling my led-blink.c with


with help of this blog
https://medium.com/@au42/the-useful-raspberrypi-cross-compile-guide-ea56054de187
and packaged the pre-built app or binary into snap of with snapcraft as follows