您尚未登录。

楼主 # 2022-05-15 01:21:24

johnatia
会员
注册时间: 2022-05-15
已发帖子: 5
积分: 20

problem with spidev

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?

离线

#1 2022-05-15 16:53:20

unturned3
会员
注册时间: 2020-07-01
已发帖子: 271
积分: 300

Re: problem with spidev

@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)

离线

#2 2022-05-15 17:33:08

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,388
积分: 1902
个人网站

Re: problem with spidev

有两个解决方案:
① 用静态链接编译 -static
② 用编译文件系统的同一个gcc编译spidev_test.c





离线

#3 2022-05-16 08:56:01

真的是很烦
会员
注册时间: 2018-10-08
已发帖子: 156
积分: 148.5

Re: problem with spidev

哇酷小二 说:

有两个解决方案:
① 用静态链接编译 -static
② 用编译文件系统的同一个gcc编译spidev_test.c

加一个:
append "-lm" to the LD FLAG

这个看上去比较奇怪. 系统是用的 gcc-linaro-4.8, 但是发现向量化的优化不够好,
于是找 gcc-linaro-6.5 试下, 就碰到同样的错误提示, 后来无意加了-lm 就好了, 具体什么原因倒没去深究

离线

楼主 #4 2022-05-19 00:43:50

johnatia
会员
注册时间: 2022-05-15
已发帖子: 5
积分: 20

Re: problem with spidev

I build the image here
https://github.com/mangopi-sbc/buildroot-mangopi-r

the build system I used the default buildroot toolchain
buildroot.jpeg bbcode buildroot

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)

离线

楼主 #5 2022-05-19 22:14:17

johnatia
会员
注册时间: 2022-05-15
已发帖子: 5
积分: 20

Re: problem with spidev

could someone tell me .. is the cross compiler I used is right or there's an official cross compiler for f1c200s ??

离线

#6 2022-06-20 11:33:19

Seas0
会员
注册时间: 2021-06-25
已发帖子: 5
积分: 1

Re: problem with spidev

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)

离线

#7 2022-06-20 11:39:59

Seas0
会员
注册时间: 2021-06-25
已发帖子: 5
积分: 1

Re: problem with spidev

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)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn