Kernel rebuild in jetson nano 2GB devkit

Hi,

Currently, I am using jetson nano 2GB Development kit and I am trying integrate quectel GSM modem EC200S-CN.

For that they provides driver files and user guide for configuration.

But I am not exactly getting how to do this.

Please check below attachment sent by quectel.
v5.3.1.zip (24.7 KB)
EC200T_linux_USB_Driver_User_Guide_V1.0.pdf (3.7 MB)

Hi,
@WayneWWW, Can you help me in this matter.

Please share your valuable suggestion as soon as possible.

Corrected the topic to jetons nano forum.

Maybe put the code on device and run make to see what is the result?

Hello sir,

Sorry sir, I am not able to understand properly. Can you please explain me in a bit detail
So that, I can try and share result.

Please find below attached result of the ‘uname -a’.

What should I explain? Didn’t you use make to build code before?

There is a makefile in that driver code. So try it on your device first.

In the driver guide you posted here, it asked you to do cross compile.

To do that, you can follow the document here.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/kernel_custom.html#wwpID0E06C0HA

1 Like

Hello sir,

I apologize for that. I didn’t understand it properly at that time because as per quectel reference document we need to some changes in below file as per kernel version:

  • [KERNEL]/drivers/usb/serial/option.c
  • [KERNEL]/drivers/usb/serial/qcserial.c
  • [KERNEL]/drivers/net/usb/qmi_wwan.c
  • [KERNEL]/drivers/usb/serial/usb_wwan.c

Also, In the kernel menuconfig editor, enabling (to be added a module):

  • USB driver for GSM and CDMA modems
  • USB Modem (CDC ACM) support
  • QMI WWAN driver for Qualcomm MSM based 3G and LTE modems
  • PPP (Point-to-point protocol) support
  • Host for RNDIS and ActiveSync devices

For that I checked kernel source in /usr/src/linux-headers-4.9.201-tegra-ubuntu18.04_aarch64/kernel-4.9/drivers/usb/serial. but in this folder no any file available like option.c etc.

That is just the header file. Please download the full source from our download center.

Hello sir,

A per your suggestion, we are trying to do “make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j4” command. Currently we are trying with two different process.

1). Trial 1:

  • Extract the kernel source.
  • Changes in option.c and qcserial.c file as per quectel document.
  • Trying to excute make command with below sequence.
    1).TEGRA_KERNEL_OUT=
    2). Go to kernel directory
    3). make mrproper
    4). mkdir -p $TEGRA_KERNEL_OUT
    5). make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
    6). make ARCH=arm64 O=$TEGRA_KERNEL_OUT menuconfig
    7). Enable required modules.
    8). make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j4

But we are getting “receipt for target ‘prepare3’ failed”. Please find below attachment for your reference.

2). Trial 2:

  • Extract the kernel source.
  • Changes in option.c and qcserial.c file as per quectel document.
  • Trying to excute make command with below sequence.
    1).TEGRA_KERNEL_OUT=
    2). Go to kernel directory
    3). For enable modules, manually change in existing tegra_defconfig file located in /arch/arm64/configs as per requirement.
    4). make mrproper
    5). mkdir -p $TEGRA_KERNEL_OUT
    6). make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
    7). make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j4

In this way, MAKE command done successfully but we found some .ko files missing in “TEGRA_KERNEL_OUT/drivers/usb/serial” folder which are most useful for us like (option.ko, usb_wwan.ko etc.).

Also, there are specify above missing file path in modules.builtin file but not in modules.order file.

Please find below attachment for your reference.
modules.builtin (21.5 KB) modules.order (26.9 KB)

Please suggest us how we can generate missing .ko files because it is important file for GSM integration.

Also there is facing little bit difficulty in setup 5,6,7 for build Nvidia kernel. Herewith, I attached screenshot.

Hi,

I cannot give you the precise answer either because we do not know every upstream kernel driver there.
The “tegra_defconfig” is a pre-defined list for tegra specific driver. Thus, when you only use tegra_defconfig, it indeed has chance the driver you want is gone. As for menuconfig, it will ask you to enable those driver you need. However, it may also create conflict with tegra_defconfig so you need to figure it out by yourselves.

As for your “difficulty” for stpe 5,6,7, please elaborate what difficulty you have.

Hi,

In steps 5, we need to replace the file from TEGRA_KERNEL_OUT folder to<release_packagep> path. But what is <release_packagep> path. also where we can excute step 7 command?

Also note that we are doing all this things on jetson nano 2GB dev board directly not in any x86 machine.

If you are doing this on target device

For kernel image: Put Image to /boot/
For kernle modules: /lib/modules.

Also, our document suggests to use x86 host to do cross compile.

Hello sir,

In a similar step 6, we found “$TEGRA_KERNEL_OUT/arch/arm64/boot/dts/” but not able to get any “Linux_for_Tegra/kernel/dtb/”. I thing this “Linux_for_Tegra/kernel/dtb/” path is same where we untar “public_resources.tbz2”.

Linux_for_Tegra is the driver package that would be installed by sdkmanager. It is not inside the public source tarball.

Also, if you are doing all this just for enabling some driver, then updating dts is not needed. Device tree is needed when your board is changing to custom board.

Hi,

Also we are trying to setup ubuntu18.04 system with SDKmanager. So we need to do same steps or different steps for this.

Also if we used same process then how we can identify that which steps is not used for SDK manger.

Also which method is best like direct do everything on board with SD card or first to do process in host system that flash on the board?

SDcard image is just providing a easy step for someone to try jetson nano/nx easily. However, when it comes to do customization or make it as a product, the sdcard image.

Also we are trying to setup ubuntu18.04 system with SDKmanager. So we need to do same steps or different steps for this.
Also if we used same process then how we can identify that which steps is not used for SDK manger.

The whole document for building a kernel is for sdkmanager case, which is doing cross compilation on host.

Also which method is best like direct do everything on board with SD card or first to do process in host system that flash on the board?

From my personal opinion, I would suggest you can try to learn how to use host system + Linux_for_Tegra to flash the board. It would be harder to learn it but you will also be aware of how those jetson tools are doing.

Hello sir,

We have done full setup on x86 host system. We have done many setup successfully but unfortunately found error in “sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT modules_install \INSTALL_MOD_PATH=/Linux_for_Tegra/rootfs/”

Please find below attachment of the error screenshot.

Is this error from pure official sources? Or your customized one?

Hi,

No, I just change in option.c and qcserial.c files only as per quectel document. No any changes in tegra_defconfig.

Could you try to attach the full log?