# How to modify camera device driver

**URL:** <https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164>\
**Category:** Jetson Xavier NX\
**Tags:** camera\
**Created:** [December 16, 2021, 2:03am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164 "2021-12-16T02:03:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![seogs](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@seogs](https://forums.developer.nvidia.com/u/seogs)\
**Post date:** [December 16, 2021, 2:03am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/1 "2021-12-16T02:03:51Z")

</div>

My end goal is a jetson mipi without i2c in fpga.

I first confirmed that the jetson and mipi interface with imx219 pi-cam.

After looking through many articles, I thought that I should study the sensor software driver program first.

However, I couldn’t find the following code used as an example.

- tegra194-camera-imx185-a00.dtsi
- imx185\_1.c

I have no knowledge of kernel and device tree.

So I need an example using the jetson xavier nx that I am using.

I ask you because you seem to be kind to answer. @ShaneCCC

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 16, 2021, 4:44am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/2 "2021-12-16T04:44:23Z")

</div>

Have reference to below document. You also able check the kernel customize chapter to get all kernel source and device tree for reference.

[https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera\_sensor\_prog.47.1.html#](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.47.1.html#)

---

<div class="post-metadata">

**Author:** ![seogs](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@seogs](https://forums.developer.nvidia.com/u/seogs)\
**Post date:** [December 17, 2021, 6:55am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/3 "2021-12-17T06:55:57Z")

</div>

Thanks for your responds

I do step by step.

I face the problem below.

now, my step is  
Building the NVIDIA KERNEL - To build the jetson Linux Kernel - step 4 : Execute the following commands to build the kernel including all DTBs and modules  
( make ARCH=arm64 O=$TEGRA\_KERNEL\_OUT -j

```auto
make[1]: Entering directory '/home/eslab/dev'
arch/arm64/Makefile:49: LSE atomics not supported by binutils
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
  CHK include/config/kernel.release
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
  GEN ./Makefile
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
  CHK include/generated/uapi/linux/version.h
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
  CHK include/generated/utsrelease.h
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
  Using /home/eslab/Linux_for_Tegra/source/public/kernel/kernel-4.9 as source for kernel
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: "(" unexpected
  CC scripts/mod/empty.o
/bin/sh: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Exec format error
/home/eslab/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:335: recipe for target 'scripts/mod/empty.o' failed
make[3]: *** [scripts/mod/empty.o] Error 2
make[3]: *** Waiting for unfinished jobs....
  CC scripts/mod/devicetable-offsets.s
/bin/sh: 1: /home/eslab/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Exec format error
/home/eslab/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:155: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[3]: *** [scripts/mod/devicetable-offsets.s] Error 2
/home/eslab/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:649: recipe for target 'scripts/mod' failed
make[2]: *** [scripts/mod] Error 2
make[2]: *** Waiting for unfinished jobs....
/home/eslab/Linux_for_Tegra/source/public/kernel/kernel-4.9/Makefile:589: recipe for target 'scripts' failed
make[1]: *** [scripts] Error 2
make[1]: Leaving directory '/home/eslab/dev'
Makefile:171: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

```

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 22, 2021, 6:43am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/5 "2021-12-22T06:43:06Z")

</div>

Did you install the toolchain?  
Did you build it on host PC or Xavier NX?

[https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/xavier\_toolchain.html#wwpID0EQHA](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/xavier_toolchain.html#wwpID0EQHA)

---

<div class="post-metadata">

**Author:** ![seogs](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@seogs](https://forums.developer.nvidia.com/u/seogs)\
**Post date:** [December 22, 2021, 7:49am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/6 "2021-12-22T07:49:38Z")

</div>

I did build it on Xavier NX.  
Do I build it on Host PC?

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [December 22, 2021, 8:23am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/7 "2021-12-22T08:23:44Z")

</div>

The document guidance is build on host PC.  
You can build on NX but the toolchain is different. Have reference below link for building on NX.

> [@Compiling Linux JETSON XAVIER NX on the evaluation board](https://forums.developer.nvidia.com/t/compiling-linux-jetson-xavier-nx-on-the-evaluation-board/186142/2):
>
> You can build directly on the Jetson if you have downloaded the kernel source to the Jetson. Don’t know about the MIPI driver, but if the driver is available as a module, then configuring a matching kernel on the Jetson, and then adding MIPI, the driver addition would be a simple file copy to the module location. FYI, this is “native” compile. Directories in what follows are somewhat arbitrary and can be changed, and this assumes the kernel full source is at “/usr/src/sources/kernel/kernel-4.9”…

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [January 19, 2022, 5:28am UTC](https://forums.developer.nvidia.com/t/how-to-modify-camera-device-driver/198164/9 "2022-01-19T05:28:00Z")

</div>

Closed on January 19, 2022, 5:28am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
