How to compile and install NVIDIA kernel on TX1

I want to change other camera module that is not camera module on carrier module.

Which folder is the other camera module source file added?

How to compile and flashing NVIDIA Kernel on eMMC of TX1 board?

And the camera module is 1lane data and clock (differential) using ADV7282M that is converter analog to csi2.

Is it possible?

Hi HerJonh

Download the doc from below link. After that you just need boot to the system and replace the /boot/Image to the new one to apply it.

http://developer.nvidia.com/embedded/dlc/l4t-documentation-24-2-1
External Media

Some info you may find useful…

The kernel itself goes in “/boot” as a file copy. The exact name and location is the “LINUX” key/value pair entry in “/boot/extlinux/extlinux.conf”. I always suggest to never destroy the original kernel and simply add new kernels with a new extlinux.conf entry or altered name.

For a kernel build you’ll always need to configure the source to the current kernel configuration…your running system can provide this via file “/proc/config.gz” (just copy it somewhere and then “gunzip config.gz”).

If you only change module features, then you don’t need to update the kernel…only the modules need to be added (just to see if things are set up correctly you probably still want to build the kernel, just don’t install it). A feature change in the base kernel which is not done in the form of a module will probably be best accomplished with an update of both kernel image and modules.

Note that when the system runs you can get a version via “uname -r”. The kernel will look for its modules in “/lib/modules/uname -r/”. The left half of the version is part of the kernel source…the right half suffix in the name (such as “-tegra”) is from a kernel config item set just prior to compile. This is the CONFIG_LOCALVERSION. If you want to match the current kernel, and if “uname -r” is “3.10.96-tegra”, then CONFIG_LOCALVERSION must be set to “-tegra”. If you are modifying the base kernel, you might change CONFIG_LOCALVERSION to instead be something like “-modified” (and save the Image as “/boot/Image-3.10.96-modified”…this would be the new LINUX key/value pair in extlinux.conf).

Here are some more specific notes based on the R24.2.1 kernel:
[url]https://devtalk.nvidia.com/default/topic/936880/jetson-tx1/jetson-tx1-24-1-release-need-help-with-complier-directions-can-not-complie/post/4885136/#4885136[/url]

Thank you… ShaneCCC and linuxdev…
I will try.

Hi…
I succeed in compile and install the NVIDIA kernel.
I just copy the “Image” file to /boot directory. (not copy or flash the components, zImage…)

But when I run the sample program (tegra_multimedia_api/samples/09_camera_jpeg_capture/camera_jpeg_capture), just output black screen on monitor.

so when I copy and run original kernel (install by JetPack L4T R24.2.1), it output correct screen on monitor.
How to output correct screen using compiled the NVIDIA kernel?

Error Message:

NvPclHwGetModuleData: Misc Driver v4l2_focuser_stub already exists. Avoiding duplicate drivers
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Waiting until producer is connected...
CONSUMER: Waiting until producer is connected...
PRODUCER: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
CONSUMER: Producer has connected; continuing.
Sensor_GetV4LPixelType: pixel type 0x101 invalid
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
launchCC abort cc 104

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
(Argus) Error Timeout: Failed to submit first capture request (propagating from src/api/CaptureSessionImpl.cpp, function submitCaptureRequests(), line 301)
(Argus) Error Timeout:  (propagating from src/api/CaptureSessionImpl.cpp, function threadFunction(), line 741)
Error: waitCsiFrameStart timeout guid 0
Error: waitCsiFrameStart timeout guid 0

Was CONFIG_LOCALVERSION set to the same as the original kernel (probably “-tegra”)?

Second, was the starting config from “/proc/config.gz”?

Last, were the changes in config which you made based on addition of modules (“m” in the config editor), or were integrated kernel features changed (a “Y” in the config editor)? If changes were to modules, then changing Image would not change anything (requires CONFIG_LOCALVERSION to match to not change anything)…if changing only modules then Image could be left alone and only modules copied (plus “sudo depmod -a”).

Thank you for replying… linuxdev…

Now I didn’t change any module… just compiled and installed the L4T kernel source (Ver 24.1) that have downloaded on NVIDIA site… (https://developer.nvidia.com/embedded/downloads#?tx=$product,jetson_tx1$software,l4t-tx1)

And then I compiled and installed by your references, I run example code (camera_jpeg_capture) as described above.
But it output black screen.

Original kernel mean the NVIDIA kernel created during installation and fusing using the JetPack.

Compile Sequence

export DIR_TOOL=$HOME/l4t/toolchain
export DIR_WS=$HOME/l4t/workspace
export DIR_L4T=$HOME/l4t/pack
export DIR_KERNEL=$HOME/l4t/kernel

export CROSS_COMPILE=$DIR_TOOL/aarch64/install/bin/aarch64-unknown-linux-gnu-
export CROSS32CC=$DIR_TOOL/armhf/install/bin/arm-unknown-linux-gnueabi-gcc
export ARCH=arm64
export TEGRA_KERNEL_OUT=$DIR_WS/tx1_kernel
export TEGRA_MODULE_OUT=$DIR_WS/tx1_module

mkdir -p $TEGRA_KERNEL_OUT
mkdir -p $TEGRA_MODULE_OUT

make O=$TEGRA_KERNEL_OUT mrproper

make O=$TEGRA_KERNEL_OUT tegra21_defconfig

make O=$TEGRA_KERNEL_OUT zImage

Now I just copy uncompressed image file (~/l4t/workspace/tx1_kernel/arch/arm64/boot/Image) on the host PC to the directory /boot on Tegra TX1

Do I check the your reply on above?
Check my question again… please…

If the kernel is built without CONFIG_LOCALVERSION it would cause the command “uname -r” to respond only with the base version, 3.10.96. If CONFIG_LOCALVERSION is set to “-tegra”, then “uname -r” will reply “3.10.96-tegra”. The kernel itself will look for its modules in “/lib/modules/uname -r/”, so missing this on the Image file will cause all modules to go missing (the search would be in the wrong place). You may find modules being rejected if the kernel things they were built for the wrong “uname -r”. So…what does “uname -r” respond as?

“uname -r” respond as just “3.10.96”.

I added the parameter “CONFIG_LOCALVERSION=”-tegra" in “tegra21_defconfig” file (kernel/arch/arm64/configs) and checked “3.10.96-tegra”
But it’s the same result.
Is it wrong?

With modules and kernel built to use the same “uname -r” result (CONFIG_LOCALVERSION) you will at least know the kernel and any modules can find each other and won’t reject a module+kernel combination from this.

Were any modules added, or just the Image file? If modules were added, did you run “sudo depmod -a” after installing the module?

What was the actual driver or feature CONFIG_ item which you changed or added to support this camera? E.G., what was changed in “make menuconfig” or “make nconfig”? Knowing if this was added as a module or an integrated feature matters…knowing if you edited the config file directly or used a program like “make menuconfig” also matters since features may have dependencies and those programs track dependencies (but editing a file does not).

Hi… linuxdev…

I haven’t added any modules. And I haven’t modified any CONFIG_ items.
Only I downloaded the NVIDIA kernel on NVIDIA site.
( Embedded download center : https://developer.nvidia.com/embedded/downloads#?tx=$product,jetson_tx1$software,l4t-tx1 )

And then I created the uncompressed image that compiled to the sequence described above and copied the image file in the “/boot” on TX1 board.

I added only the set value (CONFIG_LOCALVERSION=“-tegra”) in tegra21_defconfig.

A part of tegra21_defconfig file

# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_LOCALVERSION="-tegra"
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
...

Hi herJonh
Could you do a basic check by v4l2-ctl and media-ctl

v4l2-ctl --list-devies
media-ctl -p

Hi… ShaneCCC

I can’t check both command.
Both command is respond as “command not found” when I input both command “v4l2-ctl --list-devices” and “media-ctl -p”.

You need to install the v4l2-utils by below command
sudo apt-get install v4l-utils

It should be ok to use tegra21_defconfig with CONFIG_LOCALVERSION edited. So I’m assuming your above edits made it in to the final “.config” which results from the “make tegra21_defconfig”. However, if your goal was to add a driver required for other video or camera compatibility, then the kernel which matches a default system will not help. Some error messages may change depending on what compiler was used, but overall your description was for adding a kernel which matched the existing kernel. You would have to add modules or alter other features of the config for new drivers or new features.

FYI, try the utils install which is mentioned above…it may not be kernel related.

Hi…
I have some other question.
If I want to change i2c address 0x36 to 0x21, which part of file do I change?
I tried to change the address or the device name in files that are ov5693.c, board-t210ref-camera.c.
But it wasn’t changed… the address 0x36, the device name “ov5693”.

And… Do you have reference sources for coding the module ADV7282M?
Thank you…

When you build a kernel you can tell it to build the dtb file via:

make dtbs

…or if you have set up a temp directory in some location specified by environment variable “TEGRA_KERNEL_OUT”:

make O=$TEGRA_KERNEL_OUT dtbs

The dtb file itself is looked for at the location specified in “/boot/extlinux/extlinux.conf” (be careful to not lose the original if you experiment). This file copy to “/boot” is separate from other kernel build file copies. The file specified there is loaded by U-Boot just prior to loading the kernel.

I solved the problem.
I modified device address in dts file and compiled the file.
And then the file copied the “/boot” directory.
Thank you for your replying.