Rebuilding play kernel

Hello –
Can Play build its own kernel?

Trying to attach a Pressure 4 click | MikroElektronika to a new Play, and I gather I need to compile in kernel support for the BMP280 chipset. While I’ve succeeded at building BBB kernels in the past, I found this difficult on Play.

Seemed like I should try to use GitHub - RobertCNelson/ti-linux-kernel-dev: vendor bsp..., but when I run this on the device.it begins to download a cross-compile toolchain for x86_64, like so:

 ./build_kernel.sh 
+ Detected build host [Debian GNU/Linux 11 (bullseye)]
+ host: [aarch64]
+ git HEAD commit: [f826170aa7762b8808de89c47f138f33274e2a63]
-----------------------------
cpio: cpio (GNU cpio) 2.13
lzop: lzop 1.04
Installing Toolchain: gcc_10_arm
-----------------------------
--2023-06-08 06:57:17--  https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.4.0/x86_64-gcc-10.4.0-nolibc-arm-linux-gnueabi.tar.xz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.199.223, 2604:1380:45d1:ec00::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.199.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29776888 (28M) [application/x-xz]
Saving to: ‘/home/debian/ti-linux-kernel-dev/dl/x86_64-gcc-10.4.0-nolibc-arm-linux-gnueabi.tar.xz’

abi.tar.xz                       45%[========================>                               ]  13.04M  1.21MB/s    eta 14s    


this eventually fails, but. note the second time it prints as though it were not cross compiling,

-----------------------------
scripts/gcc: Error: The GCC Cross Compiler you setup in system.sh (CC variable) is invalid.
-----------------------------
Using Existing Toolchain: gcc_10_arm
-----------------------------
/home/debian/ti-linux-kernel-dev/scripts/gcc.sh: 306: /home/debian/ti-linux-kernel-dev/dl/gcc-10.4.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc: Exec format error
scripts/gcc: Using: 
-----------------------------
CROSS_COMPILE=/home/debian/ti-linux-kernel-dev/dl/gcc-10.4.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
scripts/git: [git version 2.30.2]
-----------------------------

It’s now trying to execute /home/debian/ti-linux-kernel-dev/dl/gcc-10.4.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc:, which is in fact an x86_64 binary

$ file /home/debian/ti-linux-kernel-dev/dl/gcc-10.4.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc
/home/debian/ti-linux-kernel-dev/dl/gcc-10.4.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=ca3fc2b4f1ad9ee073507bd4363fff9a5bc4bbbb, stripped

Thanks! Fixed scripts: dont use x86_64 cross compiler on aarch64 · RobertCNelson/ti-linux-kernel-dev@4e2d40a · GitHub but a one little thing…

voodoo@jetson-agx-orin-devkit:~/ti-linux-kernel-dev$ ./build_kernel.sh 
+ Detected build host [Debian GNU/Linux 12 (bookworm)]
+ host: [aarch64]
+ git HEAD commit: [4e2d40abd69198db374b6c0869a2e770716ffbd6]
-----------------------------
cpio: cpio (GNU cpio) 2.13
lzop: lzop 1.04
-----------------------------
scripts/gcc: Using: gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 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.
-----------------------------
CROSS_COMPILE=
scripts/git: [git version 2.39.2]

Your on the wrong branch for the Play (arm64), so use ti-linux-arm64-5.10.y

2nd, that module is already enabled…

voodoo@jetson-agx-orin-devkit:~/ti-linux-kernel-dev$ cat patches/defconfig | grep BMP
CONFIG_SENSORS_IBMPEX=m
CONFIG_BMP280=m
CONFIG_BMP280_I2C=m
CONFIG_BMP280_SPI=m

Regards,

Thank you. OK, so I modprobe’d the bmp280-i2c module and tried to i2cdetect it–now it appears to be some other problem I’m having and I won’t cross the threads here.

The default branch of GitHub - RobertCNelson/ti-linux-kernel-dev: vendor bsp... is ti-linux-5.10.y, I missed the “arm64” part. Now the build_kernel step passes the gcc check, thank you!