Eclipse cross compiling when including libgpiod

trying to cross compile with Eclipse 2024-12
the cross compiling works until i add gpiod.h to the code
i added the include paths for gpiod.h and library libgpiod

/home/amf/dev/pb2/rootfs/usr/include/stdlib.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory

the rootfs was created with
rsync -avHAXR --delete-after --info=progress2 --numeric-ids debian@192.168.3.39:/{usr,lib} rootfs

this script is supose to fix the symbolic links, seems to work.
sysroot-relativelinks.py rootfs

now if i build the same c-code on the pocketbeagle 2, there are not errors
gcc gamepup_gpioset.c -o gamepup_gpioget -lgpiod

the gcc version on pocketbeagle 2
gcc version 12.2.0 (Debian 12.2.0-14)
Linux BeagleBone 6.12.17-ti-arm64-r33 #1bookworm

i grabed the cross compile tools from image-builder
x86_64-gcc-11.3.0-nolibc-arm-linux-gnueabi

now for the question,
is this Eclipse cross compiler issue related to the gcc version ?
if so, where do i get the correct cross compiler tools for the pocketbeagle 2 ?

1 Like

This is not a cross compile solution, however it is the simplest and most effective. Just do a remote build on the target. As long as you can SSH into your target you can remote build with clion (paid commercial version), or if you chose python use pycharm and run it remotely from your big box.

pocketbeagle should not require any special tools, it would be the same for any of the 64 bit systems.

If you must cross compile you can use a yocto toolchain and go that way.

However, with the multi-core stuff remote is the best or just do a yocto build.

only issue with ssh into the system is it’s a pain to do all editing in nano

Clion and Pycharm, seamless. Just like dev on your big box.

Ditch the text tools like nano and move into an ide that allows you to remote build. Using nano is like walking to work everyday instead of driving.

Also, look into python. It runs fine on these multicore boards, setup a venv (virtual environment) on your target or just ride bare back.

C/C++ is practical if you need to get extremely close to the registers, nowdays use python along with its vast libraries that others have been so generous to develop for everyone to use.

Here is one example I ported the old c version of the spi test to python. This was for a project on another board. Main point with this is you can run it on other boards.

The snippet below is all you need to change so you can test spi port. I was planning on doing more examples but I am out of free time at the moment.

#loopback connect pins 19 & 21 radxa rock5b
# Default SPI device
SPI_BUS = 0  # Change to 1 if using SPI1
SPI_DEVICE = 0    # Change to 1 if using SPI1 CS1

@foxsquirrel
does the personal version of clion work for this?
looked at their pricing, i can live with the personal version, if it works

some hefty requirements, 4G ram, 4 cores.
beaglepocket 2 doesn’t even get close

seems to be resource hungry, took all memory plus 512M of swap.

You need to set it up differently, the core application only runs on the host and handshakes/uploads files to the target. The setup for remote is not very well documented. I will have some more time this late weekend and post some screen shots. The weather is getting better and I have plenty to do at the farm.

2 Likes