2023-07-29 12:26 PM
Hi,
I like to use spidev_test tool:
I am following this guide for compiling the tool by developer package:
https://wiki.st.com/stm32mpu/wiki/How_to_build_Linux_kernel_user_space_tools
These are commands I have used:
cd ~/Distribution-Package/openstlinux-5.10-dunfell-mp1-21-03-31/build-openstlinuxweston-stm32mp157a-visionsom-hdmi-emmc-mx/tmp-glibc/deploy/sdk
./st-image-weston-openstlinux-weston-stm32mp157a-visionsom-hdmi-emmc-mx-x86_64-toolchain-3.1-snapshot.sh
. /opt/st/stm32mp157a-visionsom-hdmi-emmc-mx/3.1-snapshot/environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
cd ~/Developer-Package
tar xfJ en.SOURCES-stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17_tar.xz
cd stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0
tar xfJ linux-5.10.61.tar.xz
cd linux-5.10.61
for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
mkdir -p ../build
make ARCH=arm O="$PWD/../build" multi_v7_defconfig fragment*.config
for f in `ls -1 ../fragment*.config`; do scripts/kconfig/merge_config.sh -m -r -O $PWD/../build $PWD/../build/.config $f; done
yes '' | make ARCH=arm oldconfig O="$PWD/../build"
cd ../build
make ARCH=arm uImage vmlinux dtbs LOADADDR=0xC2000040
make ARCH=arm modules
make ARCH=arm INSTALL_MOD_PATH="$PWD/../build/install_artifact" modules_install
mkdir -p $PWD/../build/install_artifact/boot/
cp $PWD/../build/arch/arm/boot/uImage $PWD/../build/install_artifact/boot/
cp $PWD/../build/arch/arm/boot/dts/st*.dtb $PWD/../build/install_artifact/boot/
make tools/spi
Whole kernel build looks fine.
But the very last command "make tools/spi" have this result:
DESCEND spi
CC /home/stmyocto/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0/build/tools/spi/spidev_test.o
In file included from spidev_test.c:11:
/opt/st/stm32mp157a-visionsom-hdmi-emmc-mx/3.1-snapshot/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/9.3.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
9 | # include_next <stdint.h>
| ^~~~~~~~~~
compilation terminated.
make[4]: *** [/home/stmyocto/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0/linux-5.10.61/tools/build/Makefile.build:97: /home/stmyocto/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0/build/tools/spi/spidev_test.o] Error 1
make[3]: *** [Makefile:39: /home/stmyocto/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0/build/tools/spi/spidev_test-in.o] Error 2
make[2]: *** [Makefile:68: spi] Error 2
make[1]: *** [/home/stmyocto/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0/linux-5.10.61/Makefile:1948: tools/spi] Error 2
make: *** [/home/stmyocto/Developer-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-11-17/sources/arm-ostl-linux-gnueabi/linux-stm32mp-5.10.61-stm32mp-r2-r0/linux-5.10.61/Makefile:185: __sub-make] Error 2
Where is the problem?
Regards,
Peter.