Skip to content

Instantly share code, notes, and snippets.

@mathis-m
Last active April 10, 2023 11:43
Show Gist options
  • Save mathis-m/facd241fe1f324c7b22338484f60338f to your computer and use it in GitHub Desktop.
Save mathis-m/facd241fe1f324c7b22338484f60338f to your computer and use it in GitHub Desktop.
Blinking LED - Assembly ARM 32bit - Raspberry Pi4

Usage blink.s

To compile the file download it eg. using wget <url to raw file>:

First Argument is the GPIO PIN Number eg. GPIO 21 => arg=21

as -o blink.o blink.s
gcc -o blink blink.o
./blink 21

Usage blink-simple.s

Is a somewhat simpler version it has the GPIO PIN 21(PIN) and corresponding values(GPFSEL2, GPCLR0, GPSET0, GPFSEL2_GPIO21_MASK, MAKE_GPIO21_OUTPUT) hardcoded.

as -o blink-simple.o blink-simple.s
gcc -o blink-simple blink-simple.o
./blink 21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment