How do I modify the grinch kernel to set UVCMODULE as external?

I need to configure the TK1 to work with kobuki base (it’s a turtlebot) and an intel r200 realsense camera.

To make the r200 camera work, apparently you need to recompile the kernel setting the UVCVIDEO module to be an external module, as shown in this tutorial:

And in order to make the kobuki base work, you need to use this grinch kernel:

https://devtalk.nvidia.com/default/topic/906018/jetson-tk1/-customkernel-the-grinch-21-3-4-for-jetson-tk1-developed/

(Not necessarily the specific kernel, but it has some modifications that allow the kobuki base to be recognized, otherwise it gives the error Kobuki : device does not (yet) available on this port, waiting…. I am not quite sure what it is, but it has to do with FTDI configuration: Connection to the kobuki base is via usb enabled by an ftdi usb-serial converter)

My question then is how do I integrate both? My guess is I need to recompile the kernel applying the patches described in the second link together with the UVCMODULE change in the .config file (set as external module) and then just copy the compiled zImage to the /boot/zImage.

I’m fairly new to this, so I expect to encounter some problems. For instance, after compiling the kernel you only get the zImage, right? I don’t get where did this firmware and those modules given by the second link came from; do I just ignore them?

One last question!: What is the difference between changing the .config file, as shown in the first link, and applying those patches shown in the second link? I guess in the later one we change code, while in the former we change certain flags, but is there any relation between the two that I need to be careful?

It might not be so complicated if the issue is only FTDI. How does the device connect to the Jetson…is it via USB? If so, then it is probably an FTDI chipset USB bridge. For reference, are you using L4T R21.5 (see “head -n 1 /etc/nv_tegra_release” if not sure)? Basically support for FTDI is nothing more than building a module for an existing driver which simply isn’t configured.

To see what you have configured:

# Views and saves as "unzipped_config.txt"...
cat /proc/config.gz | gunzip | tee unzipped_config.txt
# See current FTDI options...
egrep FTDI unzipped_config.txt

Probably UVCMODULE is “USB Video Class”…a standard interface already enabled in R21.5. Check:

egrep CONFIG_USB_VIDEO_CLASS unzipped_config.txt

(Sorry, misspelled UVCMODULE)

Yes, connects via USB, both the camera and the kobuki base.

I flashed with 21.4. I don’t know what you mean by standard interface already enabled in R21.5; what I understood from the tutorial from the first link is that this module is needed in order for the realsense camera to work (i.e., there needs to be a uvcmodule when you type lsmod in terminal) - it can’t be an internal kernel module, has to be external - but again, I’m newbie at this so I might not be making sense.

“Basically support for FTDI is nothing more than building a module for an existing driver which simply isn’t configured.” Is there any place explaining how I would do this?

The thing is that the kobuki base doesn’t get recognized by jetson by default like it does on normal laptops, so my guess is that it has to do with the kernel. After installing the grinch kernel it worked. However I lost the UVCMODULE, which only appears with another kernel modification (in 21.4, I don’t know about 21.5).

First, some information on USB…

Every USB connection is nothing more than a communications pipe…what is connected on the pipe is announced to the operating system at the time of connect. The USB device describes itself, and drivers are offered a chance to take ownership of the device. The USB device has a choice of simply saying it is a custom device, and having a custom driver take ownership. However, USB has many pre-defined utility drivers for common devices. An example would be HID is the human interface device…mice, keyboards, joysticks, so on. If your mouse or keyboard is a standard HID, then USB already has drivers for it, not additional driver is needed (well, this isn’t strictly true, an additional driver is needed, but that driver is not custom and all computers I know of install the HID driver by default).

USB has a standardized class for video, the USB Video Class (UVC). This is not a custom driver, and is available for use with a wide range of cameras or video devices. You may need to install the driver, but it is standard with the Linux kernel source…there is nothing custom required other than making sure it exists in the current configuration. The command I mentioned in the previous post regarding “CONFIG_USB_VIDEO_CLASS” will tell us if your kernel already supports UVC standard devices. If not, a module could be built based on this without needing custom source code.

FTDI is a well-known chipset manufacturer for USB serial communications. It needs a seemingly “custom” driver, but it is so well known that it might as well be considered “standardized”. The command I gave above with “FTDI” mentioned in it will tell you if FTDI is already configured.

Knowing the output of those egrep commands I gave tells what is needed if your camera is a generic interface (and it probably is if somebody mentioned UVC). Secondly, having the existing configuration from config.gz is where you would have to start when configuring a module for build anyway…you’d use this for your starting “.config” in a kernel compile. Knowing what steps you need to take depends on answering the above egrep questions.

If you are not using R21.5 I highly suggest flashing to this first, it has many improvements. This would also produce a different “/proc/config.gz”.