I need Jetpack 4.2.1 ( L4T 32.2 ) but E-con e-CAM131_CUTX2 only built for L4T 28.2

So im working on a project that pushes docker containers with machine learning codes from
Azure Cloud onto the Jetson TX2 with something called Azure IoT Edge.

the latest Jetpack brings Nvidia Docker and Azure IoT Edge installation from repo is clean.

great!

so i went and bought an E-Con 13 mp camera… the e-CAM131_CUTX2

im a newb so was hoping the camera would just “come up” on a brand new flash from Jetpack 4.2.1

then i went on the e-con website and realized their directions tell me to

  1. switch my development machine to Ubuntu 14.04 down from 18.04
  2. build a custom kernel + their patch and flash or use their quickstart kernel and flash

needless to say I DONT WANT TO DO THAT! :)

  1. ill lose all the cool stuff that comes with jetpack 4.2.1 that i dont know how to use yet.
  2. the older kernel as i recall doesnt run nvidia docker out of the box.
  3. who knows how this will affect Azure IoT Edge and the ONNX ML modules.
  4. ?

So i went to our friend from Jetson Hacks.
He has a video showing how to build a custom kernel on the device itself.

based on this i figure i can

  1. Download the L4T 32.2 Kernel sources
  2. Manually go line by line through e-Cons LT4 28.2 patch and find the places in the 32.2 Kernel
    that need to be changed.
  3. Make the new Kernel as per Jetson Hacks on device method and swap it out and I can keep all the fresh stuff from Jetpack 4.2.1 as well as get my camera working.

So far ive gone through the attached patch file and kinda see how it can work but i got to this one point and i dont think i understand DIFF syntax well enough. can someone interpret this for me?
can i ignore this DIFF and keep going?

here is the patch file
https://aidevkitsa.blob.core.windows.net/e-cam131-cutx2-jetson-tx2-28-2-1-kernel-patch/e-CAM131_CUTX2_JETSON_TX2_28.2.1_kernel.patch

here is the part im stuck at…

diff --git a/kernel/kernel-4.4/drivers/media/platform/tegra/camera/camera_common.c b/kernel/kernel-4.4/drivers/media/platform/tegra/camera/camera_common.c
index 625fa06..fa25804 100644
--- a/kernel/kernel-4.4/drivers/media/platform/tegra/camera/camera_common.c
+++ b/kernel/kernel-4.4/drivers/media/platform/tegra/camera/camera_common.c
@@ -36,6 +36,7 @@
 #define HDR_ENABLE		0x1
 
 static const struct camera_common_colorfmt camera_common_color_fmts[] = {
+#if 0
 	{
 		MEDIA_BUS_FMT_SRGGB12_1X12,
 		V4L2_COLORSPACE_SRGB,
@@ -70,6 +71,13 @@ static const struct camera_common_colorfmt camera_common_color_fmts[] = {
 		V4L2_COLORSPACE_SRGB,
 		V4L2_PIX_FMT_XRGGB10P,
 	},
+#endif
+	/* e-con camera only supports UYVY format */
+	{
+		MEDIA_BUS_FMT_UYVY8_1X16,
+		V4L2_COLORSPACE_SRGB,
+		V4L2_PIX_FMT_UYVY,
+	},
 };
 
 static const char *camera_common_csi_io_pads[] = {
@@ -498,8 +506,10 @@ int camera_common_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
 
 	err = v4l2_g_ctrl(s_data->ctrl_handler, &hdr_control);
 	if (err < 0) {
-		dev_err(sd->dev, "could not find device ctrl.\n");
-		return err;
+		/* Error check removed to add support for NON HDR cameras */
+		//dev_err(sd->dev, "could not find device ctrl.\n");
+		//return err;
+		err = 0;
 	}
 
 	/* mode_type can be filled in sensor driver */

can anyone help me understand?

here is the camera_common.c from the 32.2 Kernel sources im supposed to edit with the e-con 28.2.1 patch.

link…
https://aidevkitsa.blob.core.windows.net/e-cam131-cutx2-jetson-tx2-28-2-1-kernel-patch/camera_common.c

So basically i interpreted this as …

comment out everything in
static const struct camera_common_colorfmt camera_common_color_fmts = {
and replace with the follow.

/* e-con camera only supports UYVY format */
	{
		MEDIA_BUS_FMT_UYVY8_1X16,
		V4L2_COLORSPACE_SRGB,
		V4L2_PIX_FMT_UYVY,
        },

as for the HDR check i ignored it since the new camera_common.c has totally different code where looks like maybe not an issue.

so when i run

make -j5 Image

i get the following errors seem to have nothing to do with the changes i made i never touched any of these files.

In file included from ./include/trace/define_trace.h:95:0,
                 from ./include/trace/events/sched.h:1113,
                 from kernel/sched/core.c:94:
./include/trace/events/sched.h: In function ‘trace_raw_output_sched_load_avg_task’:
./include/trace/events/sched.h:666:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘u32 {aka unsigned int}’ [-Wformat=]
  TP_printk("comm=%s pid=%d cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu"
            ^
./include/trace/trace_events.h:327:22: note: in definition of macro ‘DECLARE_EVENT_CLASS’
  trace_seq_printf(s, print);     \
                      ^~~~~
./include/trace/trace_events.h:65:9: note: in expansion of macro ‘PARAMS’
         PARAMS(print));         \
         ^~~~~~
./include/trace/events/sched.h:626:1: note: in expansion of macro ‘TRACE_EVENT’
 TRACE_EVENT(sched_load_avg_task,
 ^~~~~~~~~~~
./include/trace/events/sched.h:666:2: note: in expansion of macro ‘TP_printk’
  TP_printk("comm=%s pid=%d cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu"
  ^~~~~~~~~
In file included from ./include/trace/trace_events.h:361:0,
                 from ./include/trace/define_trace.h:95,
                 from ./include/trace/events/sched.h:1113,
                 from kernel/sched/core.c:94:
./include/trace/events/sched.h:667:39: note: format string is defined here
    "util_avg_pelt=%lu util_avg_walt=%lu load_sum=%llu"
                                     ~~^
                                     %u
In file included from ./include/trace/define_trace.h:95:0,
                 from ./include/trace/events/sched.h:1113,
                 from kernel/sched/core.c:94:
./include/trace/events/sched.h: In function ‘trace_raw_output_sched_load_avg_cpu’:
./include/trace/events/sched.h:715:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘u32 {aka unsigned int}’ [-Wformat=]
  TP_printk("cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu "
            ^
./include/trace/trace_events.h:327:22: note: in definition of macro ‘DECLARE_EVENT_CLASS’
  trace_seq_printf(s, print);     \
                      ^~~~~
./include/trace/trace_events.h:65:9: note: in expansion of macro ‘PARAMS’
         PARAMS(print));         \
         ^~~~~~
./include/trace/events/sched.h:685:1: note: in expansion of macro ‘TRACE_EVENT’
 TRACE_EVENT(sched_load_avg_cpu,
 ^~~~~~~~~~~
./include/trace/events/sched.h:715:2: note: in expansion of macro ‘TP_printk’
  TP_printk("cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu "
  ^~~~~~~~~
In file included from ./include/trace/trace_events.h:361:0,
                 from ./include/trace/define_trace.h:95,
                 from ./include/trace/events/sched.h:1113,
                 from kernel/sched/core.c:94:
./include/trace/events/sched.h:716:41: note: format string is defined here
      "util_avg_pelt=%lu util_avg_walt=%lu",
                                   ~~^

im also getting these additional errors when i run

make -j5 Image

even though they seem totally unrelated to the patch i manually applied to the kernel sources

kernel/watchdog_hld.c:35:22: warning: ‘hardlockup_allcpu_dumped’ defined but not used [-Wunused-variable]
 static unsigned long hardlockup_allcpu_dumped;
                      ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/asm-generic/percpu.h:6:0,
                 from ./arch/arm64/include/asm/percpu.h:277,
                 from ./arch/arm64/include/asm/smp.h:32,
                 from ./include/linux/smp.h:59,
                 from ./include/linux/percpu.h:6,
                 from ./arch/arm64/include/asm/mmu.h:25,
                 from ./include/linux/mm_types.h:17,
                 from ./include/linux/sched.h:27,
                 from ./include/linux/nmi.h:7,
                 from kernel/watchdog_hld.c:14:
kernel/watchdog_hld.c:22:44: warning: ‘watchdog_ev’ defined but not used [-Wunused-variable]
 static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);
                                            ^
./include/linux/percpu-defs.h:111:19: note: in definition of macro ‘DEFINE_PER_CPU_SECTION’
  __typeof__(type) name
                   ^~~~
kernel/watchdog_hld.c:22:8: note: in expansion of macro ‘DEFINE_PER_CPU’
 static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);

LD      drivers/cpufreq/built-in.o
  LD      sound/soc/xtensa/built-in.o
  LD      sound/soc/zte/built-in.o
  LD      sound/soc/snd-soc-core.o
  CC      drivers/cpuidle/cpuidle.o
  LD      sound/soc/built-in.o
  LD      sound/synth/built-in.o
  CC      sound/usb/card.o
  LD      fs/nfs/nfs.o
  LD      fs/nfs/nfsv2.o
  LD      fs/nfs/nfsv3.o
  LD      fs/nfs/built-in.o
  CC      kernel/membarrier.o
  CC      fs/notify/fsnotify.o
  CC      sound/usb/clock.o
  CC      kernel/memremap.o
  CC      drivers/cpuidle/driver.o
  CC      net/bluetooth/hci_core.o
kernel/memremap.c:176:0: warning: "SECTION_MASK" redefined
 #define SECTION_MASK ~((1UL << PA_SECTION_SHIFT) - 1)
 
In file included from ./arch/arm64/include/asm/processor.h:43:0,
                 from ./arch/arm64/include/asm/spinlock.h:21,
                 from ./include/linux/spinlock.h:87,
                 from ./include/linux/rcupdate.h:38,
                 from ./include/linux/radix-tree.h:29,
                 from kernel/memremap.c:13:
./arch/arm64/include/asm/pgtable-hwdef.h:88:0: note: this is the location of the previous definition
 #define SECTION_MASK  (~(SECTION_SIZE-1))
 
kernel/memremap.c:177:0: warning: "SECTION_SIZE" redefined
 #define SECTION_SIZE (1UL << PA_SECTION_SHIFT)
 
In file included from ./arch/arm64/include/asm/processor.h:43:0,
                 from ./arch/arm64/include/asm/spinlock.h:21,
                 from ./include/linux/spinlock.h:87,
                 from ./include/linux/rcupdate.h:38,
                 from ./include/linux/radix-tree.h:29,
                 from kernel/memremap.c:13:
./arch/arm64/include/asm/pgtable-hwdef.h:87:0: note: this is the location of the previous definition
 #define SECTION_SIZE  (_AC(1, UL) << SECTION_SHIFT)
 
  CC      fs/notify/notification.o
  CC      sound/usb/endpoint.o
  CC      drivers/cpuidle/governor.o
kernel/memremap.c:176:0: warning: "SECTION_MASK" redefined
 #define SECTION_MASK ~((1UL << PA_SECTION_SHIFT) - 1)
 
In file included from ./arch/arm64/include/asm/processor.h:43:0,
                 from ./arch/arm64/include/asm/spinlock.h:21,
                 from ./include/linux/spinlock.h:87,
                 from ./include/linux/rcupdate.h:38,
                 from ./include/linux/radix-tree.h:29,
                 from kernel/memremap.c:13:
./arch/arm64/include/asm/pgtable-hwdef.h:88:0: note: this is the location of the previous definition
 #define SECTION_MASK  (~(SECTION_SIZE-1))
 
kernel/memremap.c:177:0: warning: "SECTION_SIZE" redefined
 #define SECTION_SIZE (1UL << PA_SECTION_SHIFT)
 
In file included from ./arch/arm64/include/asm/processor.h:43:0,
                 from ./arch/arm64/include/asm/spinlock.h:21,
                 from ./include/linux/spinlock.h:87,
                 from ./include/linux/rcupdate.h:38,
                 from ./include/linux/radix-tree.h:29,
                 from kernel/memremap.c:13:
./arch/arm64/include/asm/pgtable-hwdef.h:87:0: note: this is the location of the previous definition
 #define SECTION_SIZE  (_AC(1, UL) << SECTION_SHIFT)

fs/pstore/inode.c: In function ‘pstore_unlink’:
fs/pstore/inode.c:178:6: warning: unused variable ‘err’ [-Wunused-variable]
  int err;
      ^~~

Please save yourself the trouble and DO NOT buy anything from e-Con systems.

so i see so far e-Con systems lacking strategy of deploying a camera clean so it just works by installing a driver and i can keep my latest kernel and softwares.

they hide the documentation by forcing you to log in with a “corporate account” before you can download the documentation. a corporate account being something thats not gmail. so i had to go pay 20 bucks for a domain just to log into e-Con and get the documentation.

since e-Con claims Nvidia partner status i figured the camera would just work.

yeah it only works if you downgrade your development desktop to Ubuntu 14. So basically wipe your only computer clean and start fresh just for e-Con. Then you find out they basically wipe your Jetson Clean to put a L4T 28.2 Kernel they patch so you lose all the good softwares you get from Jetpack!!!

and i see e-Con lacking integrity by cleansing thier site and process of things that would make me realize i should not have bought this camera in the first place.

the company is a foreign company. so the video of the camera “working” has no voices in it. Just happy music and text at the bottom instead of someone talking.

when you order the actual device you dont realize its coming from india and you are paying an arm and a leg for the delivery until you get a link to DHL tracking that says first stop CHennai. They even cheat by giving you the delivery date and time in their time instead of my time so i think its coming today and not 24 hours from now.

I still have not received any help from them despite numerous avenues ive taken including email, web chat ( the dont show up you are always next in the queue ).

please please dont buy anything from this company. i can see why the company name is e-CON. CON as in criminal.

1 Like

I haven’t had that great of an experience with MIPI Sensors on the Jetson platform regardless of the vendor. Sure we can blame the various vendors for not having support on the latest Jetpack, but can they really afford the resources of constantly updating for every single Jetpack update?

Like here is the list from E-Con, and that’s a lot of cameras to constantly update drivers/instructions/etc for.

The camera you’re trying to integrate seems to be stuck all the way back on Jetpack 3.3.

My recommendation would be to pause the work you’re doing, and first make sure what you want to get working will work with the default Jetson TX2 Camera. The part I would test specifically is to make sure you Nvidia Docker will work with the camera. I believe I read somewhere that it wouldn’t with MIPI cameras, but maybe that was just the Jetson Nano.

For Cameras on the TX2 I’ve had pretty good luck with Leopard Imaging despite all the compatibility issues among Jetpack versions. They have good support, and more importantly I really like how their cameras connect though the I-PEX connector. I can’t be the only one that hates ribbon cable connectors. How inflexible they are for placement, and how easy they break.

Ohh no! lol

So even if i got it working Nvidia Docker doesnt work with MIPI Cameras?

SMH.

There seems to be a lot of touch points in the embedded world.

  1. you need the build tool chain from a particular version of linux ( that may not be your default dev machine )
  2. nvidia docker had to be compiled into the kernel previously and now still doesnt talk to MIPI
  3. its not easy to test from your dev box
  4. cameras have compatibility issues with operating systems

we still havent gotten to what CUDA is and will be able to talk the ONNX Machine learning from Microsoft Tensor flow gstreamer plugins directly.

just the tip of the iceberg.

Is there a good book or resource for a newb like me to get a sense soup to nuts of this world of embedded programming so i can make the right decisions at each of these points?

Do i need to learn how to use QEMU.
what else dont i know.

I come from the windows world where you buy device from target and it just works.

I know it’s an old thread but I stumbled upon this same error in L4T 32.7.X and solved it by disabling the kernel config:
CONFIG_GENERIC_EARLY_IOREMAP

Note that ioremap() calls may be used for the TX2 by particular e-con drivers, other than the e-CAM131, so they will need to be commented out.