Yocto Scarthgap build issue

I am trying to build Yocto Scarthgap for the Verdin i.MX8M Plus. I am running into the error shown below:

ERROR: kernel-module-isp-vvcam-4.2.2.24.1-r0 do_compile: oe_runmake failed
ERROR: kernel-module-isp-vvcam-4.2.2.24.1-r0 do_compile: ExecutionError(‘/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/temp/run.do_compile.969804’, 1, None, None)
ERROR: Logfile of failure stored in: /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/temp/log.do_compile.969804
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4 KERNEL_SRC=/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source KERNEL_PATH=/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source KERNEL_VERSION=5.15.148-7.0.0-devel+git.284966e8d6ee CC=aarch64-tdx-linux-gcc -fuse-ld=bfd -fmacro-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam=/usr/src/debug/kernel-module-isp-vvcam/4.2.2.24.1-r0 -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam=/usr/src/debug/kernel-module-isp-vvcam/4.2.2.24.1-r0 -fcanon-prefix-map -fmacro-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2=/usr/src/debug/kernel-module-isp-vvcam/4.2.2.24.1 -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2=/usr/src/debug/kernel-module-isp-vvcam/4.2.2.24.1 -fmacro-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2=/usr/src/debug/kernel-module-isp-vvcam/4.2.2.24.1 -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2=/usr/src/debug/kernel-module-isp-vvcam/4.2.2.24.1 -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/recipe-sysroot= -fmacro-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/recipe-sysroot= -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/recipe-sysroot-native= -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source=/usr/src/kernel -fdebug-prefix-map=/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-build-artifacts=/usr/src/kernel LD=aarch64-tdx-linux-ld.bfd AR=aarch64-tdx-linux-ar OBJCOPY=aarch64-tdx-linux-objcopy STRIP=aarch64-tdx-linux-strip O=/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-build-artifacts KBUILD_EXTRA_SYMBOLS=
| make[1]: Entering directory ‘/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe’
| make -C /home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source ARCH=arm64 M=/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe modules
| make[2]: Entering directory ‘/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source’
| CC [M] /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/…/video/vvbuf.o
| CC [M] /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/dwe_driver_of.o
| CC [M] /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/dwe_devcore.o
| CC [M] /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/…/…/dwe/dwe_ioctl.o
| /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/dwe_driver_of.c: In function ‘dwe_set_stream’:
| /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/dwe_driver_of.c:155:15: error: implicit declaration of function ‘media_pad_remote_pad_first’ [-Werror=implicit-function-declaration]
| 155 | pad = media_pad_remote_pad_first(pad);
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~
| /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/dwe_driver_of.c:155:13: error: assignment to ‘struct media_pad *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
| 155 | pad = media_pad_remote_pad_first(pad);
| | ^
| cc1: all warnings being treated as errors
| make[4]: *** [/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source/scripts/Makefile.build:289: /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe/dwe_driver_of.o] Error 1
| make[4]: *** Waiting for unfinished jobs…
| make[3]: *** [/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source/Makefile:1907: /home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe] Error 2
| make[2]: *** [Makefile:226: __sub-make] Error 2
| make[2]: Leaving directory ‘/home/sutter/oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source’
| make[1]: *** [Makefile:40: all] Error 2
| make[1]: Leaving directory ‘/home/sutter/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/kernel-module-isp-vvcam/4.2.2.24.1/git/vvcam/v4l2/dwe’
| make: *** [Makefile:6: all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/sutter/oe-core/build/…/layers/meta-freescale/recipes-kernel/kernel-modules/kernel-module-isp-vvcam_4.2.2.24.1.bb:do_compile) failed with exit code ‘1’

Is there a known solution to this issue?

tdx-info:

Software summary

Bootloader: U-Boot
Kernel version: 5.15.148-6.7.0-devel+git.f437ddb7191d #1 SMP PREEMPT Wed May 15 17:04:15 UTC 2024
Kernel command line: root=PARTUUID=dc0260aa-02 ro rootwait console=null console=ttymxc2,115200 consoleblank=0 earlycon
Distro name: NAME=“TDX Wayland with XWayland”
Distro version: VERSION_ID=6.7.0-devel-20240611161604-build.0
Distro variant: -
Hostname: verdin-imx8mp-15335644

Hardware info

HW model: Toradex Verdin iMX8M Plus on Verdin Development Board
Toradex version: 0063 V1.1B
Serial number: 15335644
Processor arch: aarch64

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


:handshake:

The error you’re encountering is due to the implicit declaration of the function media_pad_remote_pad_first in your kernel module code. This function is not recognized, which leads to the compilation failure.

Here are some steps to troubleshoot and resolve this issue:

  1. Check Kernel Headers: Ensure that the kernel headers you are using match the kernel version you are compiling against. The function media_pad_remote_pad_first should be declared in the appropriate header file. Verify that the header file is included in your source code.

  2. Kernel Version Compatibility: The function media_pad_remote_pad_first might not be available or might have been renamed in the kernel version you are using. Check the kernel documentation or source code for the correct function name and its availability.

  3. Update the Source Code: If the function has been renamed or is not available, you might need to update your source code to use the correct function or an alternative function. For example, in some kernel versions, the function might be named differently or might require additional parameters.

  4. Disable Warnings as Errors: As a temporary workaround, you can disable treating warnings as errors by modifying the Makefile or the compiler flags. This can help you identify other potential issues in the code without stopping at the first warning.

  5. Patch the Code: If the function is missing, you might need to patch the code to provide an alternative implementation or to include the necessary header files.

Here is an example of how you might modify the Makefile to disable treating warnings as errors:

# Add this line to your Makefile
CFLAGS += -Wno-error=implicit-function-declaration

After making these changes, try recompiling the kernel module.

If the function media_pad_remote_pad_first is indeed missing or renamed, you will need to find the correct function or update your code accordingly. You can search the kernel source code for similar functions or check the kernel documentation for guidance.

Best regards, Toradex AI Assistant

Hey @Sutter99,

Currently Yocto Scarthgap is not supported under an active release. Each BSP release for a Toradex module is matched to the Yocto LTS. So BSP 5 with Dunfell, BSP 6 with Kirkstone, and we can expect BSP 7 to be matched with Scarthgap. While it’s possible that you can build with Scarthgap now, it may not be without it’s complications.

-Eric

Hi @eric.tx,

Might you have an estimate for when BSP 7 will be released?

Thank you

Hey @Sutter99,

Unfortunately I do not have an ETA. There is still testing underway.

-Eric

Hi @eric.tx,

Thank you for your quick reply.