Hello there,
I'm working on MangoPi-r3 based on F1C200S, I'm trying to communicate with TFT st7735r using spidev1.0
I wrote a code that working on RaspberryPi Zero and worked with the tft , but when I tried it on F1C200S it doesn't work , I think the problem in the spi driver
I also tried to run the spidev_test.c
https://github.com/rm-hull/spidev-test/blob/master/spidev_test.c
I was able to compile it but when trying to run it on F1C200S I got a strange message
/usr/lib/libc.so.6: version `GLIBC_2.33' not found
any help?
离线
@johnatia
What build system did you use to make the rootfs for the f1c200s? How did you compile your spidev program? Sounds like it could be a cross-compilation problem.
最近编辑记录 unturned3 (2022-05-15 16:58:17)
离线
有两个解决方案:
① 用静态链接编译 -static
② 用编译文件系统的同一个gcc编译spidev_test.c
加一个:
append "-lm" to the LD FLAG
这个看上去比较奇怪. 系统是用的 gcc-linaro-4.8, 但是发现向量化的优化不够好,
于是找 gcc-linaro-6.5 试下, 就碰到同样的错误提示, 后来无意加了-lm 就好了, 具体什么原因倒没去深究
在线
I build the image here
https://github.com/mangopi-sbc/buildroot-mangopi-r
the build system I used the default buildroot toolchain
I compiled the spidev_test.c with cross compiler: arm-linux-gnueabi-gcc
I tried another program using this cross compiler and it worked for me
└─$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Debian 11.2.0-18) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
最近编辑记录 johnatia (2022-05-19 00:55:29)
离线
could someone tell me .. is the cross compiler I used is right or there's an official cross compiler for f1c200s ??
离线
Use the compiler which your image builder generated (in $BUILDROOT/output/host/opt/ext-toolchain/bin/$TUPLE-gcc) should just work, as u were using the system provided cross-compiler which provided a higher version of glibc (2.33) not forward-compatible with the version configured in image builder.
Also, compiling with the '-static' flag should attach all the library used to your program, preventing any possible missing / version miss matched / etc. library problem at all, consider it when you are not familiar with target system environment.
最近编辑记录 Seas0 (2022-06-20 11:42:23)
离线
The compiler you showed is provided by Ubuntu and is NOT the one you can considered as "OFFICIALLY" supported by Allwinner.
Correct compiler version is something like this: (I'm using a D1 chip based on RISC-V, so your version info is guaranteed differ from mine)
❯ pwd
/home/seas0/Sources/Embedded/buildroot-d1x-t113/buildroot/output/host/opt/ext-toolchain/bin
❯ ./riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/seas0/Sources/Embedded/buildroot-d1x-t113/buildroot/output/host/opt/ext-toolchain/bin/../libexec/gcc/riscv64-unknown-linux-gnu/8.1.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/build/../source/riscv/riscv-gcc/configure --target=riscv64-unknown-linux-gnu --with-mpc=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/lib-for-gcc-x86_64-linux/ --with-mpfr=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/lib-for-gcc-x86_64-linux/ --with-gmp=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/lib-for-gcc-x86_64-linux/ --prefix=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/install --with-sysroot=/ldhome/software/toolsbuild/slave/workspace/riscv64_build_linux_x86_64/install/sysroot --with-system-zlib --enable-shared --enable-tls --enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp --disable-libquadmath --disable-nls --disable-bootstrap --src=../../source/riscv/riscv-gcc --enable-checking=yes --with-pkgversion='C-SKY RISCV Tools V1.8.4 B20200702' --enable-multilib --with-abi=lp64d --with-arch=rv64gcxthead 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medany' CC=gcc CXX=g++
Thread model: posix
gcc version 8.1.0 (C-SKY RISCV Tools V1.8.4 B20200702)
离线