Upstreamed kernel missing necessary header files for respeaker 4 mic board driver to be compiled and installed on Jetson TX1

Hello!

Recently I got Respeaker 4 mic microphone array board released on 23 June 2017. This board has I2C port that I want to hook up to the GPIO pins on the TX1 board.

I got all necessary drivers for Raspbian and tried to install it and the installation process worked fine. But not on TX1.

The problem is that the drivers for this microphone array require linux kernel 4.9 and I already contacted support and they confirmed that I need 4.9 kernel version.

The newest linux for tegra release 28.1 has kernel v4.4 which still doesn’t meet Respeaker 4 mic board drivers requirement.

So I found this tutorial on the internet that teaches how to upstream kernel: Jetson/TX1 Upstream Kernel - eLinux.org

I sucessfully managed to boot the board with upstreamed kernel 4.13.

I cross compiled kernel on Ubuntu host machine and copied files:

# mount /dev/sdc1 /mnt # mounted the board through miniUSB port to Ubuntu host
 # cp build/jetson-tx1/arch/arm64/boot/Image /mnt/boot/Image-upstream # the Image file I got after cross copiling copied to the board
 # cp build/jetson-tx1/arch/arm64/boot/dts/nvidia/*.dtb /mnt/boot/ # copied *.dtb files to the board
 # umount /mnt

then added these changes to /mnt/boot/extlinux/extlinux.conf

LABEL upstream
MENU LABEL upstream kernel
LINUX /boot/Image-upstream
FDT /boot/tegra210-p2371-2180.dtb
APPEND console=ttyS0,115200n8 root=/dev/mmcblk0p1 rw rootwait

after that also did before kernel boot:

Tegra210 (P2371-2180) # env delete fdt_copy_node_names
Tegra210 (P2371-2180) # env delete fdt_copy_src_addr
Tegra210 (P2371-2180) # env set fdt_copy_node_names /cpus:/psci
Tegra210 (P2371-2180) # boot

And after that kernel is booted.

It’s only working now trough Serial Console USB cable connected to GPIO pins on TX1 and no HDMI display output. So I basically have access to the terminal of Upstreamed kernel of TX1.
But the current OS doesn’t have all necessarry header files for Respeaker 4 mic board driver and I siply can’t compile it.

In /lib/modules folder I have only 3.10.96-tegra folder
there is no folder for the

4.13.0-rc1-next-20170720

that I got when I execute

uname -r

and inside this /lib/modules/3.10.96-tegra there is build folder that is symlinked to the /usr/src/linux-headers-3.10.96-tegra where all necessary header files are stored for the 3.10 kernel

but since I only did this:

# cp build/jetson-tx1/arch/arm64/boot/Image /mnt/boot/Image-upstream # the Image file I got after cross copiling copied to the board
 # cp build/jetson-tx1/arch/arm64/boot/dts/nvidia/*.dtb /mnt/boot/ # copied *.dtb files to the board

the nesessary /lib/modules/4.13.0-rc1-next-20170720
and /usr/src/linux-headers-4.13.0-rc1-next-20170720
are missing

I’m attaching a zip file with all driver files needed:

Questions:

What changes should I make in a system so the installer of the driver for respeaker 4 mic array board will eventually compile?
Is it true that the TX1 OS will become unstable if it works with Upstreamed kernel? What exactly is going to happen during the work process?
Thank you for your help!

Paul

I would actually suggest back-porting the upstream kernel’s driver into the 4.4 kernel. There are many hardware-specific support issues when throwing in an upstream kernel.

When you build an image for a kernel there is an option in there for CONFIG_LOCALVERSION. If the base kernel version is “4.13.0-rc1”, and if the CONFIG_LOCALVERSION is “-next-20170720”, then “uname -r” is “4.13.0-rc1-next-20170720”. Modules will be searched for at “/lib/modules/$(uname -r)/”. Setting an alternate install path during kernel build would allow you to output what modules should be, then you copy that tree to “/lib/modules/$(uname -r)/” on the Jetson. Without the modules you’re not going to get very far.

Notice in the original L4T installs that “/lib/modules/$(uname -r)/” has an “extras” subdirectory, and a “kernel” subdirectory. Kernel-provided files from a “make modules_install” target go into the kernel subdirectory; the “extras” subdirectory contains files provided in binary format by NVIDIA. You’d copy “extras” to the new module directory, and provide “kernel” via the “make modules_install” target (followed by copy of the file tree to that location).