Dear Toradex Community,
I am trying to get a most basic gpio sample to work on a Verdin AM62 SoM on a Dahlia board.
I have Win11, with VSCode running, using WSL. The SoM runs Torizon OS.
Before I followed How to Use GPIO on Torizon OS | Toradex Developer Center and a could download and run the pre-compiled container to test access to the GPIO pins.
I made a python script run, and am now trying a C/C++ Makefile Project, which I changed to C and use the GCC (as the README explained).
I added to the docker-compose.yml: (for both “services” gpiotest10-debug: and gpiotest10, as i named my project gpiotest10)
devices:
- “/dev/gpiochip0”
In the makefile, i added " -lgpiod" to the LDFLAGS
i simply copied the code from the sample on git:
and i replaced in launch.json:
“sourceFileMap”: {
“${config:torizon_app_root}”: “${workspaceFolder}”
},
with
“sourceFileMap”: {
“/home/torizon/app”: “${workspaceFolder}”
},
To solve the “Cannot read properties of undefined (reading ‘replaceAll’)” error.
Now after clicking “Start Debugging” button (for Torizon arm64) in the Run and Debug - Area, i still get
“arch64-linux-gnu-gcc -Iincludes/ -c -g -o build-arm64/debug/main.o src/main.c
src/main.c:2:10: fatal error: gpiod.h: No such file or directory
2 | #include <gpiod.h>
| ^~~~~~~~~
compilation terminated.
make: *** [Makefile:44: build-arm64/debug/main.o] Error 1”
Do i have to manually copy the header file into the “include” folder of the project? I cannot find it in the sample c GPIO project. Do i have to install the libgpiodev library in WSL? How can i properly include the library?
Any help would be appreciated.
Kind regards,
Dom