NVIDIA THOR 7.0.0.0编译调试

https://forums.developer.nvidia.com/t/error-might-be-timeout-in-usb-write/254513

To boot in recovery mode:
tegrarecovery x1 on
tegrareset x1
To boot:
tegrarecovery x1 off
tegrareset x1
串口
sudo minicom -D /dev/tty/USB0		SOC
sudo minicom -D /dev/tty/USB3 		MCU

or

sudo ./tools/muxer/tcu_muxer/tcu_muxer -m T264 -d /dev/ttyUSB0 -c CCPLEX/b=14,g=15 -s $PWD/file/ -l $PWD/file/uart.log
sudo minicom -D /dev/pts/16

“qemu-aarch64 not in database of installed binary formats”

docker save -o qemu-user-static.tar multiarch/qemu-user-static
docker load -i /path/to/your/qemu-user-static.tar
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes 
sudo update-binfmts --enable qemu-aarch64
how to build kernel in docker driveos 7.0.0.0

# 1. download and start docker,  apply patch 
# 2. Prepare the output folders:  
cd /drive
export NV_WORKSPACE=$PWD
export LOCALVERSION="-rt-tegra"
  
cd $NV_WORKSPACE/drive-linux/kernel
rm -R tmp
mkdir -p tmp/kernel tmp/kernel/kernel-6.1
cp -rf nvidia-6.1/source/* tmp/kernel/kernel-6.1
cp -rf common/nvidia-oot tmp/kernel
cp -rf common/nvgpu tmp/kernel
cp -rf common/hwpm tmp/kernel
mkdir -p tmp/kernel/conftest/nvidia
cp -rf common/nvidia-oot/scripts/conftest/* tmp/kernel/conftest/nvidia/
#cp -rf common/nvidia-oot/scripts/conftest/* tmp/kernel/conftest/
cp -rf common/nvidia-t264 tmp/kernel
cp -rf common/kernel-t264 tmp/kernel
  
# 3. apply the rt-patches and soc specific patches.  
cd tmp/kernel/kernel-6.1
#cp ~/nvidia/automotive_70ed1_0710/kernel-build/scripts/* scripts/
bash scripts/generic-soc-patch.sh -i $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/kernel-t264 -p kernel-oot-soc-patches.list -o $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/kernel-6.1
bash scripts/generic-rt-patch.sh apply-patches
bash scripts/copy-source-files.sh -i $NV_WORKSPACE/drive-linux/kernel/tmp/kernel -l nvidia-t264/kernel-src-files-copy-list.txt -o $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot
bash scripts/generic-soc-patch.sh -i $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-t264 -p nvidia-oot-soc-patches.list -o $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot
  
# 4. Configure the kernel and build  
export ARCH=arm64
export CROSS_COMPILE=${NV_WORKSPACE}/toolchains/aarch64--glibc--stable-2022.03-1/bin/aarch64-buildroot-linux-gnu-
make ARCH=arm64 CROSS_COMPILE=${CROSS_COMPILE} O=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux defconfig
make ARCH=arm64 CROSS_COMPILE=${CROSS_COMPILE} O=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux -j20

# 5. Build modules:
export SRC_DIR=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/kernel-6.1
cd $NV_WORKSPACE/drive-linux/kernel/tmp/kernel

make src=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/conftest/nvidia obj=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/conftest/nvidia CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld NV_KERNEL_SOURCES=${SRC_DIR} NV_KERNEL_OUTPUT=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux -f $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/conftest/nvidia/Makefile

ARCH=arm64 CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld make -j$n_threads -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux M=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/hwpm/drivers/tegra/hwpm srctree.hwpm=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/hwpm V=1 modules CONFIG_TEGRA_OOT_MODULE=m CONFIG_TEGRA_VIRTUALIZATION=y srctree.nvconftest=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/conftest

ARCH=arm64 CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld make -j$n_threads -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux M=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot srctree.nvidia-oot=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot srctree.nvidia=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot srctree.hwpm=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/hwpm srctree.nvconftest=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/conftest KBUILD_EXTRA_SYMBOLS=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/hwpm/drivers/tegra/hwpm/Module.symvers V=1 modules CONFIG_TEGRA_OOT_MODULE=m CONFIG_TEGRA_VIRTUALIZATION=y

ARCH=arm64 CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld make -j$n_threads -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux M=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvgpu/drivers/gpu/nvgpu srctree.nvidia-oot=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot srctree.nvidia=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot srctree.nvconftest=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/conftest KBUILD_EXTRA_SYMBOLS=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot/Module.symvers V=1 modules CONFIG_TEGRA_OOT_MODULE=m CONFIG_TEGRA_VIRTUALIZATION=y
  
export INSTALL_MOD_PATH=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux
export INSTALL_MOD_PATH=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux
make ARCH=arm64 -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux O=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux INSTALL_MOD_STRIP=1 modules_install
make ARCH=arm64 -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux M=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot INSTALL_MOD_STRIP=1 modules_install
make ARCH=arm64 -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux M=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/hwpm/drivers/tegra/hwpm INSTALL_MOD_STRIP=1 modules_install
make ARCH=arm64 -C $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux M=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvgpu/drivers/gpu/nvgpu INSTALL_MOD_STRIP=1 modules_install
  
  
cd $NV_WORKSPACE/drive-linux/kernel/tmp/kernel
cat nvidia-oot/Module.symvers >> out-linux/Module.symvers
rsync -avzpq nvidia-oot/include/ out-linux/include
rsync -avzpq nvidia-oot/drivers/gpu/host1x/include/ out-linux/drivers/gpu/host1x/include
  
  
tar -xvf $NV_WORKSPACE/drive-linux_src/NVIDIA-kernel-module-source-TempVersion.tar.xz
  
export IGNORE_PREEMPT_RT_PRESENCE=1
cd NVIDIA-kernel-module-source-TempVersion
make \
    modules \
    SYSSRC=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/kernel-6.1 \
    SYSOUT=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux \
    SYSSRCHOST1X=$NV_WORKSPACE/drive-linux/kernel/tmp/kernel/nvidia-oot/drivers/gpu/host1x/include \
    CC=${CROSS_COMPILE}gcc \
    LD=${CROSS_COMPILE}ld.bfd \
    AR=${CROSS_COMPILE}ar \
    CXX=${CROSS_COMPILE}g++ \
    OBJCOPY=${CROSS_COMPILE}objcopy \
    TARGET_ARCH=aarch64 \
    ARCH=arm64  
  
export KERNEL_VERSON=6.1.80-rt26-rt-tegra  
mkdir -p $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux/lib/modules/$KERNEL_VERSON/updates/opensrc-disp/
cd kernel-open
cp nvidia.ko nvidia-modeset.ko nvidia-drm.ko $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux/lib/modules/$KERNEL_VERSON/updates/opensrc-disp/
cd $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/kernel-6.1
  
# 6. Copy the kernel and modules to SDK kernel and modules path:  
# Before copying the new kernel images, back up the default kernels provided.
export PROD_SUFFIX=""
cp -v $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux/arch/arm64/boot/Image $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux/vmlinux $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux/System.map $NV_WORKSPACE/drive-linux/kernel/nvidia-6.1/preempt_rt${PROD_SUFFIX}/images/
cp -a $NV_WORKSPACE/drive-linux/kernel/tmp/kernel/out-linux/lib/modules/* $NV_WORKSPACE/drive-linux/kernel/nvidia-6.1/preempt_rt${PROD_SUFFIX}/modules
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值