GPIO example using libgpiod. Meant to run on an arm64 target
1.0K
Running the container with correct device access on target
docker pull nddrnd/arm64-gpiod
docker run --rm -it --device /dev/gpiochip0 nddrnd/arm64-gpiod
gpio-toggle SODIMM_210
With the arm-gpiod:variable-pulse version, add the pulse length in ms:
gpio-toggle SODIMM_210 10
With the arm-gpiod:soft-rt version, pthread_setschedparam() and mlockall() are used (see https://www.drdobbs.com/soft-real-time-programming-with-linux/184402031?pgno=1). To make sure they succeed when run by a container, 2 extra capabilities need to be added (SYS_NICE for pthread_setX() and IPC_LOCK for mlockall()):
docker run --rm -it --device /dev/gpiochip0 --cap-add SYS_NICE --cap-add IPC_LOCK nddrnd/arm64-gpiod:soft-rt
Run detached and then add a CPU stress in parallel:
docker run --rm -d --entrypoint gpio-toggle --device /dev/gpiochip0 --cap-add IPC_LOCK --cap-add SYS_NICE nddrnd/arm64-gpiod:soft-rt SODIMM_210 10
docker run -it --rm alexeiled/stress-ng --cpu 4 --timeout 60s --metrics-brief
Content type
Image
Digest
sha256:a1b75feb3…
Size
35.9 MB
Last updated
over 3 years ago
docker pull nddrnd/arm64-gpiod