TX2 Flashing / WiFi Problem

Hello all. I’ve been able to flash my TX2 from my source code that I synced from source_synch.sh

L4T version: 28.2.1
JetPack version: 3.3

I use these lines to flash my device; (commands are mostly from ridgerun)

export DEVDIR=/home/burak/JetPackTX2/64_TX2/Linux_for_Tegra
export CROSS_COMPILE=/usr/local/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- 
export CROSS32CC=/usr/local/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc 
export KERNEL_MODULES_OUT=$DEVDIR/images/modules
export TEGRA_KERNEL_OUT=$DEVDIR/images
export ARCH=arm64

cd $DEVDIR/sources/kernel/kernel-4.4
make mrproper
make O=$TEGRA_KERNEL_OUT tegra18_defconfig -j6
make O=$TEGRA_KERNEL_OUT menuconfig -j6
sleep 5
make O=$TEGRA_KERNEL_OUT zImage -j6
make O=$TEGRA_KERNEL_OUT dtbs -j6
make O=$TEGRA_KERNEL_OUT modules -j6
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$KERNEL_MODULES_OUT -j6
export KERNEL_MODULES_NAME=4.4.38+ 
cd $DEVDIR/images/modules/lib/modules/$KERNEL_MODULES_NAME
rm build source
cd $DEVDIR/images/modules/
tar -cjf kernel_supplements.tbz2 *
mv kernel_supplements.tbz2 $DEVDIR/images/packages
cd $DEVDIR/kernel
tar -xf kernel_headers.tbz2
export KERNEL_HEADERS_NAME=linux-headers-4.4.38-tegra
mv $KERNEL_HEADERS_NAME linux-headers-$KERNEL_MODULES_NAME
tar -cjf kernel_headers_custom.tbz2 linux-headers-$KERNEL_MODULES_NAME
mv kernel_headers_custom.tbz2 $DEVDIR/images/packages
sudo rm -rf linux-headers-$KERNEL_MODULES_NAME 
cp $DEVDIR/images/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb $DEVDIR/kernel/dtb
cd $DEVDIR/images
cp -rf arch/arm64/boot/Image arch/arm64/boot/zImage packages/kernel_supplements.tbz2 $DEVDIR/kernel/
cp -rf packages/kernel_headers_custom.tbz2 $DEVDIR/kernel/kernel_headers.tbz2
cd $DEVDIR/
sudo ./apply_binaries.sh 
sudo ./flash.sh jetson-tx2 mmcblk0p1

When the flash finished, the TX2 cold-rebooted and there was a single [FAILED] message in dmesg. But I didnt really care about it since it started just fine, with one exception, WiFi.

The error is this;

[FAILED] Failed to start Load Kernel Modules.
see 'systemctl status systemd-modules-load.service' for details

And when I run (check picture)

Tried ifconfig but there was no wlan0. I couldn’t get it to work. (Notice that before custom compiled source, I was able to use WiFi and connect to the internet with the current setup, so It’s not hardware related)

I got Warning

make[1]: Leaving directory '/home/burak/JetPackTX2/64_TX2/Linux_for_Tegra/images'
make[1]: Entering directory '/home/burak/JetPackTX2/64_TX2/Linux_for_Tegra/images'
  CHK     include/config/kernel.release
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  Using /home/burak/JetPackTX2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4 as source for kernel
  CHK     include/generated/utsrelease.h
make[2]: 'include/generated/mach-types.h' is up to date.
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    /home/burak/JetPackTX2/64_TX2/Linux_for_Tegra/sources/kernel/kernel-4.4/scripts/checksyscalls.sh
  DTC     drivers/misc/mods/mods.dtb
  DTB     drivers/misc/mods/mods.dtb.S
  AS [M]  drivers/misc/mods/mods.dtb.o
  LD [M]  drivers/misc/mods/mods.o
rm drivers/misc/mods/mods.dtb drivers/misc/mods/mods.dtb.S
  Building modules, stage 2.
  MODPOST 143 modules
WARNING: could not open drivers/misc/mods/mods.dtb.S: No such file or directory
  LD [M]  drivers/misc/mods/mods.ko
make[1]: Leaving directory '/home/burak/JetPackTX2/64_TX2/Linux_for_Tegra/images'
make[1]: Entering directory '/home/burak/JetPackTX2/64_TX2/Linux_for_Tegra/images'
  INSTALL crypto/cmac.ko
  INSTALL crypto/drbg.ko
  INSTALL crypto/echainiv.ko
  INSTALL crypto/jitterentropy_rng.ko

but it continued compiling and flashing just fine. It didnt exit. But I suspect this is what causing my Wi-Fi problems.

Adding compile/flash output of my script above. Please help me.

ForumSubmit.txt (207 KB)

Added; CONFIG_LOCALVERSION="-tegra" inside defconfig

and then edited;

“scripts/setlocalversion” file, making scm_version function return nothing.

scm_version()
{
        local short
        short=false 
        return
}

Now the WiFi driver is working as intended! Hope this helps anyone trying to find an answer.

Btw, “CROSS32CC” is not used except in the original R24.x releases. You can safely leave this out of any kernel compiles (this was for 32-bit support during the transition from 32-bit to 64-bit).

Oh I see, so it’s effectless… The solution was based on you as well. Thank you linuxdev!