I got some issues with a Pico Mini, in particular, I cannot get any of the C examples to run on the target.
I have checked out the recent SDK with git, installed the cross toolchain, and successfully built an example.
In this case, the iio ADC example.
But it seems the SDK / toolchain and the OS on the target don't add up.
Here are more details.
First, the OS running on the target (a Luckfox Pico Mini B).
I downloaded an Ubuntu Linux image from the Google Cloud directory the Wiki links to.
In this case, ../firmware/buildroot/Luckfox_Pico_Mini_Ubuntu_MicroSD.zip (671,3MB)
Installation on a SD card went fine, and board boots up correctly.
Her is what it says :
pico@luckfox:~$ uname -a
Linux luckfox 5.10.160 #2 Fri Oct 18 12:03:14 CST 2024 armv7l armv7l armv7l GNU/Linux
pico@luckfox:~$ cat /proc/version
Linux version 5.10.160 (root@DESKTOP-RUMO6US) (arm-rockchip830-linux-uclibcgnueabihf-gcc (crosstool-NG 1.24.0) 8.3.0, GNU ld (crosstool-NG 1.24.0) 2.32) #2 Fri Oct 18 12:03:14 CST 2024
pico@luckfox:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
pico@luckfox:~$
Building the C example and deploying it to the target (via scp), works fine as well.
Trying to execute yields :
pico@luckfox:~/dev$ ./iio_adc
-bash: ./iio_adc: No such file or directory
pico@luckfox:~/dev$
Checking with ldd, it seems libraries are missing.
After manually copying libc.so.0 and ld-uClibc.so.1 to the target, ldd tells me this :
pico@luckfox:~/dev$ ldd ./iio_adc
libc.so.0 => /lib/arm-linux-gnueabihf/libc.so.0 (0xa6f00000)
ld-uClibc.so.1 => /lib/arm-linux-gnueabihf/ld-uClibc.so.1 (0xa6ee0000)
pico@luckfox:~/dev$
But it still does not execute, error message is the same as above.
Trying to build the example on the target didn't work either, for the same reason (I guess):
pico@luckfox:~/dev$ gcc -o iio_adc iio_adc.c
/usr/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libc_nonshared.a: No such file or directory
collect2: error: ld returned 1 exit status
pico@luckfox:~/dev$
Finally, here the version information of the cross toolchain on the host:
fm@fm-ThinkPad-T480:~$ arm-rockchip830-linux-uclibcgnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-rockchip830-linux-uclibcgnueabihf-gcc
COLLECT_LTO_WRAPPER=/home/fm/tools/lf_sdk/arm-rockchip830-linux-uclibcgnueabihf/bin/../libexec/gcc/arm-rockchip830-linux-uclibcgnueabihf/8.3.0/lto-wrapper
Target: arm-rockchip830-linux-uclibcgnueabihf
Configured with: /opt/.build/arm-rockchip830-linux-uclibcgnueabihf/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=arm-rockchip830-linux-uclibcgnueabihf --prefix=/opt/x-tool/arm-rockchip830-linux-uclibcgnueabihf --with-sysroot=/opt/x-tool/arm-rockchip830-linux-uclibcgnueabihf/arm-rockchip830-linux-uclibcgnueabihf/sysroot --enable-languages=c,c++ --with-arch=armv7-a --with-fpu=neon-vfpv4 --with-float=hard --with-pkgversion='crosstool-NG 1.24.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --disable-libmpx --with-gmp=/opt/.build/arm-rockchip830-linux-uclibcgnueabihf/buildtools --with-mpfr=/opt/.build/arm-rockchip830-linux-uclibcgnueabihf/buildtools --with-mpc=/opt/.build/arm-rockchip830-linux-uclibcgnueabihf/buildtools --with-isl=/opt/.build/arm-rockchip830-linux-uclibcgnueabihf/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --enable-plugin --enable-gold --disable-nls --disable-multilib --with-local-prefix=/opt/x-tool/arm-rockchip830-linux-uclibcgnueabihf/arm-rockchip830-linux-uclibcgnueabihf/sysroot --enable-long-long
Thread model: posix
gcc version 8.3.0 (crosstool-NG 1.24.0)
fm@fm-ThinkPad-T480:~$
The Version so far matches with the Ubuntu output on the target.
As a side note, I have not done a full build of the SDK, only a "build.sh lunch" to setup the configuration.
I am fine with user space applications, and had not intended to modify/compile the OS.
I have the suspicion the Ubuntu image I installed is not the OS the SDK is intended to build against.
If this is correct, can I get my self-built examples to run with another image - and which one ?
Thank you !
Pico C example execution issues ...
Hello, ubuntu and buildroot are based on different cross-compilation tools. The SDK only provides the uclibc compilation tool used by buildroot, while ubuntu system needs to use the glibc cross-compilation tool. We tested using https://snapshots.linaro.org/gnu-toolch ... gnueabihf/. Most of the instructions in the WIKI are based on the buildroot system
Thank you for the quick response !
This was my first post, so the approval took some time, it seems.
In the meantime, I had flashed another SD card with a buildroot image, and tried the examples there.
And they work fine so far.
But I like the Ubuntu environment more, so I will definitely check out the linaro toolchain link.
This was my first post, so the approval took some time, it seems.
In the meantime, I had flashed another SD card with a buildroot image, and tried the examples there.
And they work fine so far.
But I like the Ubuntu environment more, so I will definitely check out the linaro toolchain link.
I downloaded the linaro toolchain, and set it up more or less successfully.Crocodile wrote: ↑2024-11-26 1:56 We tested using https://snapshots.linaro.org/gnu-toolch ... linux-gnu/.
A build still fails because the correct sysroot environment is missing.
The linaro toolchain certainly does not come with the proper Luckfox Pico environment, so it doesn't even find the C includes.
The SDK sysroot (for buildroot/uclib) doesn't match either, linking fails, understandably:
> ../aarch64-linux-gnu/bin/ld: /home/fm/tools/lf_sdk/arm-rockchip830-linux-uclibcgnueabihf/arm-rockchip830-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o: error adding symbols: file in wrong format
("error adding symbols" is manually translated into English, output is is in the local language).
Do you have instructions to fully setup this toolchain, perhaps a downloadable sysroot environment for Ubuntu applications ?
Try using the compilation tool in https://snapshots.linaro.org/gnu-toolch ... nueabihf/ , sorry for the wrong URL provided, aarch64 is a cross-compilation tool for 64-bit ARM processors.
Thank you, that was it !
I can build Ubuntu applications now, and tried the ADC example on the target successfully.
Although I should have noticed the AARCH64 prefix, hinting I was using the wrong toolchain ...
If I might add a follow-up question :
At login, the Pico board tells me the Ubuntu system was minimized to save space, and I can run "unminimize" to get those extra packages.
Specifically asking in regard to a Pico Ultra with an 8GB eMMC, how much space would such an "unminimized" Ubuntu system consume ?
Would it fit into the eMMC ?
I can build Ubuntu applications now, and tried the ADC example on the target successfully.
Although I should have noticed the AARCH64 prefix, hinting I was using the wrong toolchain ...
If I might add a follow-up question :
At login, the Pico board tells me the Ubuntu system was minimized to save space, and I can run "unminimize" to get those extra packages.
Specifically asking in regard to a Pico Ultra with an 8GB eMMC, how much space would such an "unminimized" Ubuntu system consume ?
Would it fit into the eMMC ?