Kernel driver cannot be updated

Hi,
The camera driver is added to the kernel source. After compiling and burning, the kernel driver cannot be updated.

kernel-version:L4T_R32.4.2

  1. Flash Jetpack4.4dp to AGX Xavier developer kit with sdkmanager;
  2. Copy image( sudo ./flash.sh -r -k APP -G ~/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/bootloader/usb-pcie-ok-system.img jetson-xavier mmcblk0p1)
  3. Flash system.img to the customized board(sudo ./flash.sh -r -k APP jetson-xavier mmcblk0p1)
  4. Add camera driver(ar0143) to kernel and build;
  5. Replace DTB and Image file;
  6. Flash system.img to the customized board(sudo ./flash.sh -r -K kernel/Image -d kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb jetson-xavier mmcblk0p1)

Kconfig:
config VIDEO_FPDLINK
tristate “fpdlinkIII support”
—help—
This is a fpdlink for the AR0143 camera.
To compile this driver as a module, choose M here: the module
will be called ar0143.

config VIDEO_AR0143
	tristate "AR0143 camera sensor support"
	depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
	---help---
	  This is a Video4Linux2 sensor-level driver for the AR0143 camera.

	  To compile this driver as a module, choose M here: the module
	  will be called ar0143.

Makefile:
obj-$(CONFIG_VIDEO_FPDLINK) += fpdlink.o
obj-$(CONFIG_VIDEO_AR0143) += ar0143.o

Added in the tegra_defconfig file:
CONFIG_VIDEO_FPDLINK=y
CONFIG_VIDEO_AR0143=y

But CONFIG_VIDEO_AR0143=y is not found in the system.
nvidia@nvidia:~$ sudo zcat /proc/config.gz | grep AR0143
[sudo] password for nvidia:
nvidia@nvidia:~$ sudo zcat /proc/config.gz | grep FPDLINK
nvidia@nvidia:~$ sudo zcat /proc/config.gz | grep VIDEO
CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_VIDEO_V4L2=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
# CONFIG_VIDEO_PCI_SKELETON is not set
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEOBUF2_CORE=y
CONFIG_VIDEOBUF2_MEMOPS=y
CONFIG_VIDEOBUF2_DMA_CONTIG=y
CONFIG_VIDEOBUF2_VMALLOC=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_VIDEO_CPIA2=m
CONFIG_VIDEO_USBTV=m
# CONFIG_VIDEO_EM28XX is not set
# CONFIG_VIDEO_CAFE_CCIC is not set
# CONFIG_VIDEO_XILINX is not set
CONFIG_VIDEO_VIVID=m
CONFIG_VIDEO_VIVID_MAX_DEVS=64
# CONFIG_VIDEO_VIM2M is not set
CONFIG_VIDEO_CAMERA=y
CONFIG_VIDEO_TEGRA_VI=y
CONFIG_VIDEO_TEGRA_VI_TPG=m
CONFIG_VIDEO_CAMERA_SKT=m
# CONFIG_VIDEO_ISC is not set
CONFIG_VIDEO_TEGRA_VIVID=m
CONFIG_VIDEO_TEGRA_VIVID_MAX_DEVS=64
CONFIG_VIDEO_V4L2_TPG=m
# CONFIG_VIDEO_TVAUDIO is not set
# CONFIG_VIDEO_TDA7432 is not set
# CONFIG_VIDEO_TDA9840 is not set
# CONFIG_VIDEO_TEA6415C is not set
# CONFIG_VIDEO_TEA6420 is not set
# CONFIG_VIDEO_MSP3400 is not set
# CONFIG_VIDEO_CS3308 is not set
# CONFIG_VIDEO_CS5345 is not set
# CONFIG_VIDEO_CS53L32A is not set
# CONFIG_VIDEO_TLV320AIC23B is not set
# CONFIG_VIDEO_UDA1342 is not set
# CONFIG_VIDEO_WM8775 is not set
# CONFIG_VIDEO_WM8739 is not set
# CONFIG_VIDEO_VP27SMPX is not set
# CONFIG_VIDEO_SONY_BTF_MPX is not set
# CONFIG_VIDEO_SAA6588 is not set
# CONFIG_VIDEO_ADV7180 is not set
# CONFIG_VIDEO_ADV7183 is not set
# CONFIG_VIDEO_ADV7604 is not set
# CONFIG_VIDEO_ADV7842 is not set
# CONFIG_VIDEO_BT819 is not set
# CONFIG_VIDEO_BT856 is not set
# CONFIG_VIDEO_BT866 is not set
# CONFIG_VIDEO_KS0127 is not set
# CONFIG_VIDEO_ML86V7667 is not set
# CONFIG_VIDEO_AD5820 is not set
# CONFIG_VIDEO_SAA7110 is not set
# CONFIG_VIDEO_SAA711X is not set
# CONFIG_VIDEO_TC358743 is not set
# CONFIG_VIDEO_TVP514X is not set
# CONFIG_VIDEO_TVP5150 is not set
# CONFIG_VIDEO_TVP7002 is not set
# CONFIG_VIDEO_TW2804 is not set
# CONFIG_VIDEO_TW9903 is not set
# CONFIG_VIDEO_TW9906 is not set
# CONFIG_VIDEO_VPX3220 is not set
# CONFIG_VIDEO_SAA717X is not set
# CONFIG_VIDEO_CX25840 is not set
# CONFIG_VIDEO_SAA7127 is not set
# CONFIG_VIDEO_SAA7185 is not set
# CONFIG_VIDEO_ADV7170 is not set
# CONFIG_VIDEO_ADV7175 is not set
# CONFIG_VIDEO_ADV7343 is not set
# CONFIG_VIDEO_ADV7393 is not set
# CONFIG_VIDEO_ADV7511 is not set
# CONFIG_VIDEO_AD9389B is not set
# CONFIG_VIDEO_AK881X is not set
# CONFIG_VIDEO_THS8200 is not set
# CONFIG_VIDEO_OV2659 is not set
# CONFIG_VIDEO_OV7640 is not set
# CONFIG_VIDEO_OV7670 is not set
# CONFIG_VIDEO_OV9650 is not set
# CONFIG_VIDEO_VS6624 is not set
# CONFIG_VIDEO_MT9M032 is not set
# CONFIG_VIDEO_MT9M111 is not set
# CONFIG_VIDEO_MT9P031 is not set
# CONFIG_VIDEO_MT9T001 is not set
# CONFIG_VIDEO_MT9V011 is not set
# CONFIG_VIDEO_MT9V032 is not set
# CONFIG_VIDEO_SR030PC30 is not set
# CONFIG_VIDEO_NOON010PC30 is not set
# CONFIG_VIDEO_M5MOLS is not set
# CONFIG_VIDEO_S5K6AA is not set
# CONFIG_VIDEO_S5K6A3 is not set
# CONFIG_VIDEO_S5K4ECGX is not set
# CONFIG_VIDEO_S5K5BAF is not set
# CONFIG_VIDEO_SMIAPP is not set
# CONFIG_VIDEO_S5C73M3 is not set
# CONFIG_VIDEO_ADP1653 is not set
# CONFIG_VIDEO_AS3645A is not set
# CONFIG_VIDEO_LM3560 is not set
# CONFIG_VIDEO_LM3646 is not set
# CONFIG_VIDEO_UPD64031A is not set
# CONFIG_VIDEO_UPD64083 is not set
# CONFIG_VIDEO_SAA6752HS is not set
# CONFIG_VIDEO_THS7303 is not set
# CONFIG_VIDEO_M52790 is not set
CONFIG_VIDEO_IMX185=m
CONFIG_VIDEO_IMX219=y
CONFIG_VIDEO_IMX268=y
CONFIG_VIDEO_IMX274=m
CONFIG_VIDEO_IMX318=y
CONFIG_VIDEO_LC898212=y
CONFIG_VIDEO_OV5693=m
CONFIG_VIDEO_OV9281=y
CONFIG_VIDEO_OV10823=y
CONFIG_VIDEO_OV23850=y
CONFIG_VIDEO_TC358840=y
CONFIG_VIDEO_IMX390=y
# CONFIG_VIDEO_GS1662 is not set
CONFIG_VIDEO_IMX204=y
nvidia@nvidia:~$

pic1|647x435
dmesg.log (68.3 KB) dmesg-video.log (3.9 KB) Kconfig.log (5.0 KB) Makefile.log (933 Bytes) tegra_defconfig.log (27.5 KB)

Hi @tianying414

Are you sure this copies the correct kernel Image?

Usually after I build the kernel from source I copy the kernel as follows:

cp $JETSON_TX2_KERNEL_SOURCE/build/arch/arm64/boot/Image /home/$USER/nvidia/nvidia_sdk/JetPack_4.3_Linux_P3310/Linux_for_Tegra/kernel/

Then to flash only the kernel

sudo ./flash.sh -r -k kernel -K kernel/Image jetson-xavier mmcblk0p1

Also you can use the following command once the Xavier has been flashed:

uname -a

You can verified the time and date the kernel was compiled, to be sure you are flashing the correct version.

Regards,
Fabian
www.ridgerun.com

Thank you for your help.
After I use the command “uname-a”, the system displays the version time and date as April 8, 2020. The compiled kernel was not flashed to Xavier.

The following is the process:

  • Clone system.img from AGX Xavier developer kit
    sudo ./flash.sh -r -k APP -G ~/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/bootloader/usb-pcie-ok-system.img jetson-xavier mmcblk0p1

  • Flashing system.img to customized borad
    sudo ./flash.sh -r -k APP jetson-xavier mmcblk0p1

  • Compile the kernel

  • Replace /Linux_for_Tegra/kernel/Image with a copy of: $TEGRA_KERNEL_OUT/arch/arm64/boot/Image

  • Replace the contents of Linux_for_Tegra/kernel/dtb/ with the contents of: $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/

  • Flash the kernel image to the custom board
    sudo ./flash.sh -r -K kernel/Image -d kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb jetson-xavier mmcblk0p1

How should this situation be solved?

Thanks.

Hi,
When I use this command to flash, there will be errors.
$ sudo ./flash.sh -r -k jetson-xavier mmcblk0p1

Reusing existing system.img…
done.
Existing tbcfile(/home/lion/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/bootloader/cboot_t194.bin) reused.
copying tbcdtbfile(/home/lion/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb)… done.
copying cfgfile(/home/lion/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/bootloader/t186ref/cfg/flash_t194_sdmmc.xml) to flash.xml… done.
Existing flasher(/home/lion/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/bootloader/nvtboot_recovery_cpu_t194.bin) reused.
Existing flashapp(/home/lion/nvidia/xavier16G-jp4.4dp/JetPack_4.4_DP_Linux_DP_JETSON_AGX_XAVIER/Linux_for_Tegra/bootloader/tegraflash.py) reused.
*** Update [jetson-xavier] is not supported. ***

flash-error.log (14.9 KB)

hello tianying414,

  1. you should specify the partition names after -k options; please also refer to Flash Script Usage for the detailed information about flash.sh command line.

  2. for updating kernel images on Xavier, you may replace /kernel/Image and perform warm-reboot to let the changes takes effect.

  3. please also check Topic 122019 for an alternative way to update device tree.

hi JerryChang, thank you for your help.

I used the following command to successfully flash.
sudo ./flash.sh -r -K kernel/Image jetson-xavier mmcblk0p1
sudo ./flash.sh -r -k APP jetson-xavier mmcblk0p1
But the kernel still can’t be updated, and the configuration files and drivers I modified are not in effect.
Before using the same method to flash the system for TX2 , the kernel can be successfully updated, but the kernel cannot be updated for Xavier.

hello tianying414,

okay, we would also check internally about using -K kernel/Image.
please also tried with small -k option, you may replace your own kernel image with $OUT/Linux_for_Tegra/kernel/Image
and using below flash commands to update kernel

$ sudo ./flash.sh -r -k kernel jetson-xavier mmcblk0p1

Hi,JerryChang.

I’ve tried this command, but the system still can’t update the kernel.

Here is my operation process:

  1. cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image <top>/Linux_for_Tegra/kernel/Image

  2. Replace the contents of Linux_for_Tegra/kernel/dtb/ with the contents of: $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/

  3. sudo ./flash.sh -r -k kernel jetson-xavier mmcblk0p1

Thanks.

hello tianying414,

how about scp your own built image to target device, replace /boot/Image and perform a wam-reboot for checking.
thanks

Hi JerryChang,

I tried this method just now. The system can’t be started.

If you scp to the Jetson’s “/boot/Image”, and this won’t boot, a serial console boot log becomes valuable. This should show boot even before Linux starts.

Hi linuxdev,

The attachment is the startup log output from the serial console. I tried to replace the /boot/Image and tegra194-p2888-0001-p2822-0000.dtb files, but still could not start the system.
How can I refresh the kernel?
kernel-debug.log (40.3 KB)
Thanks.

Hi,

The log you pasted already show the login prompt in console. The system already boot up. Why did you say it cannot start?

As @WayneWWW mentions, the log shows boot is successful. Perhaps you are just running into a video configuration issue where graphics are not showing. If that is the case, are you using a purely HDMI monitor without any special adapters? Is there anything unusual about the monitor?

Hi Wayne

Sorry, what I described is not accurate. The desktop system cannot start normally.
The attached photo is the boot status.

Thanks.

there’s failure in the nvpmodel service, may I know what’s your configuration?

Hi JerryChang.

Nvpmodel.service the related files were not changed.
How to replace/boot/Image correctly to make the system start up properly?
nvpmodel-service.log (3.3 KB)

Thanks.

Nvpmodel.service the related files were not changed.

How to replace/boot/Image correctly to make the system start up properly?

What did you change in kernel? If you just replace the kernel built from public source, will you hit any error?

Sometimes changing something in kernel would cause the desktop manager fails to start.

/boot/extlinux/extlinux.conf → please check if you have “LINUX /boot/Image” here. If you have, then it would read Image from this path.

Hello Wayan

In the kernel source code, I only modified “CONFIG_VIDEO_OV5693 = y” in the tegra_defconfig file.
The following methods were tried, but the results were the same. The kernel still cannot be updated.
Replace /boot/Image
Replace bl_update_payload
sudo dd if=/tmp/boot_sigheader.img.encrypt of=/dev/mmcblk0p34
sudo nv_update_engine -i

I have been troubled by this problem for a long time, Why can’t Xavier update the kernel with the following commands, as in the TX2 series?
sudo ./flash.sh -r -k kernel jetson-xavier mmcblk0p1

Could you share the complete flashing steps and precautions for updating the kernel?

Thanks.

Hi,

Are you using jetpack4.4 DP? Xavier only supports to read kernel from partition if you use a release prior to jetpack4.3.

How do you tell the kernel is not updated? What is your method?

How about directly delete the /boot/Image from your device and see if it can boot up or not? If it cannot, it at least proves the system is reading the kernel from rootfs instead of partition.