Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Seiderer <ps.report@gmx.net>
To: Gerd Kautzmann <G.Kautzmann@PRIMES.de>
Cc: "buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: Re: [Buildroot] generating a kernel with camera support (video 4 linux)
Date: Thu, 30 Mar 2023 19:21:23 +0200	[thread overview]
Message-ID: <20230330192123.2ea69676@gmx.net> (raw)
In-Reply-To: <1619D009AA8C9E469331A8EE22395AEC8C24E16F@Exchange2013.PRIMES.local>

Hello Gerd,

On Thu, 30 Mar 2023 15:47:14 +0000, Gerd Kautzmann <G.Kautzmann@PRIMES.de> wrote:

> Thank you Peter for your fast reply
>
> > Add 'dtparam=i2c=on' and 'dtoverlay=imx219' to the config.txt file on the first partition, reboot and (dependent on your configuration) load the module
> > via 'modprobe imx219' (or re-build your buildroot image with '/dev management' set to Dynamic mdev or eudev which will enable the udev autoload
> > magic of the kernel modules)...
>
> I tried:
>
> dtparam=i2c=on
> dtoverlay=imx219
>
> and typed:
> >modprobe -v imx219
> (no confirmation or error message)
>
> > modprobe -l | grep imx219
> kernel/drivers/media/i2c/imx219.ko
> (with or without modprobe -v imx219)
>
> I tried some variations I found online:
> dtparam=i2c=on
> dtoverlay=imx219,media-controller=0
> camera_auto_detect=1
>
> No success
>
> I built a new image with
>
> system configuration -> /dev management -> [*] Dynamic using devtmpfs + mdev
>
> didn't help either.
>
> I tested the camera and some of your settings with a standard raspberry image, at least I know this camera could be detected from the raspberry with v4l2-ctl and I got /dev/video0 .
>
> So there seems to be a very basic error in the configuration I made, here ist he configuration I used:
>
> -------------------
>
> make clean
> make raspberrypi4_defconfig
> make menuconfig
>
> Target 			-> [*] ARM (little endian)
> Target Architecture	-> [*] cortex-A72		// attention RaspPi 4 specific!
> Target ABI 		-> [*] EABIhf			// hard float
> Floating Point Strat-> [*] NEON/VFPvi4			// attention RaspPi 4 specific!
> ARM instruction set	-> [*] ARM			// Thumb2 may be more compact but not compatible
>
> Toolchain type		-> [*] buildroot toolchain 	// default Buildroot toolchain
> c library		-> [*] glibc			// uClibc is more compact, glibc is larger but maybe more compatibel
> Kernel headers		-> Same as kernel being built	// should be tested for compatibility later
> Custom kernel headers	-> (5.10.x)			// default
> Enable C++ support	-> [*]
>
> Filesystem images	-> [*] ext2/3/4 root filesystem
> 					`-> [*] ext4		// default
>
> Filesystem images	-> [*] tar the root filesystem
> 					`-> [*] no compression
>
> Networking Applications	->	[*] dropbear	// for ssh client & server
> System config. root pw	->	(PiManiaZX81)		// needed for root login via ssh
>
>
> target packages -> hardware handling -> firmware -> [*] rpi-firmware
> 							`-> [*] rpi 4 (extended)
>
> target packages -> hardware handling -> [*] rpi-userland
>
>
> target packages -> libraries -> graphics [*] opencv4
> 					`-> [*] v4l support
> 					      [*] imgcodecs
> 					      [*] imgproc
>
>
> target packages -> libraries -> hardware handling [*] libgpiod
> target packages -> libraries -> hardware handling [*] lib4l
> 						`-> [*] v4l-utils
> target packages -> libraries -> multimedia [*] libcamera
> 						`-> [*] libcamera v4l compatibility layer
>
> -------------------
> system configuration -> /dev management -> [*] Dynamic using devtmpfs + mdev
> -------------------
>
> The drivers for the camera imx219 are also included with this setting but maybe there is something missing or interfering with v4l ....
>
> Any ideas?

Just tested with the following defconfig (buildrooot-git-master):

BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
BR2_TARGET_GENERIC_ROOT_PASSWD="000000"
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi4/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,0b54dbda3cca2beb51e236a25738784e90853b64)/linux-0b54dbda3cca2beb51e236a25738784e90853b64.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2711-rpi-4-b"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_X=y
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi4/config_4.txt"
BR2_PACKAGE_RPI_USERLAND=y
BR2_PACKAGE_OPENCV4=y
BR2_PACKAGE_OPENCV4_LIB_IMGCODECS=y
BR2_PACKAGE_OPENCV4_WITH_V4L=y
BR2_PACKAGE_LIBGPIOD=y
BR2_PACKAGE_LIBV4L=y
BR2_PACKAGE_LIBV4L_UTILS=y
BR2_PACKAGE_LIBCAMERA=y
BR2_PACKAGE_LIBCAMERA_V4L2=y
BR2_PACKAGE_LIBCAMERA_PIPELINE_RASPBERRYPI=y
BR2_PACKAGE_DROPBEAR=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y


And on the RPi:

	$ mount /dev/mmcblk0p1 /mnt/
	$ cat /mnt/config.txt
# Please note that this is only a sample, we recommend you to change it to fit
# your needs.
# You should override this file using BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE.
# See http://buildroot.org/manual.html#rootfs-custom
# and http://elinux.org/RPiconfig for a description of config.txt syntax

start_file=start4.elf
fixup_file=fixup4.dat

kernel=zImage

# To use an external initramfs file
#initramfs rootfs.cpio.gz

# Disable overscan assuming the display supports displaying the full resolution
# If the text shown on the screen disappears off the edge, comment this out
disable_overscan=1

# How much memory in MB to assign to the GPU on Pi models having
# 256, 512 or 1024 MB total memory
gpu_mem_256=100
gpu_mem_512=100
gpu_mem_1024=100

# fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
dtoverlay=miniuart-bt

# enable autoprobing of Bluetooth driver without need of hciattach/btattach
dtoverlay=krnbt=on

dtoverlay=imx219


	$ lsmod | grep imx219
imx219                 20480  1
v4l2_fwnode            24576  2 imx219,bcm2835_unicam
videodev              253952  9 bcm2835_isp,bcm2835_codec,v4l2_mem2mem,bcm2835_v4l2,imx219,bcm2835_unicam,v4l2_fwnode,videobuf2_v4l2,videobuf2_common
mc                     45056  8 bcm2835_isp,bcm2835_codec,v4l2_mem2mem,imx219,bcm2835_unicam,videobuf2_v4l2,videobuf2_common,videodev


	$ v4l2-ctl --all
Driver Info:
	Driver name      : unicam
	Card type        : unicam
	Bus info         : platform:fe801000.csi
	Driver version   : 5.10.92
	Capabilities     : 0xa5a00001
		Video Capture
		Metadata Capture
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x25200001
		Video Capture
		Read/Write
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : unicam
	Model            : unicam
	Serial           :
	Bus info         : platform:fe801000.csi
	Media version    : 5.10.92
	Hardware revision: 0x00000000 (0)
	Driver version   : 5.10.92
Interface Info:
	ID               : 0x03000006
	Type             : V4L Video
Entity Info:
	ID               : 0x00000004 (4)
	Name             : unicam-image
	Function         : V4L2 I/O
	Flags            : default
	Pad 0x01000005   : 0: Sink
	  Link 0x02000008: from remote pad 0x1000002 of entity 'imx219 10-0010' (Camera Sensor): Data, Enabled, Immutable
Priority: 2
Video input : 0 (unicam-image: ok)
Format Video Capture:
	Width/Height      : 640/480
	Pixel Format      : 'YUYV' (YUYV 4:2:2)
	Field             : None
	Bytes per Line    : 1280
	Size Image        : 614400
	Colorspace        : sRGB
	Transfer Function : sRGB
	YCbCr/HSV Encoding: ITU-R 601
	Quantization      : Limited Range
	Flags             :


Camera detected...

Regards,
Peter


> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-03-30 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 15:22 [Buildroot] generating a kernel with camera support (video 4 linux) Gerd Kautzmann
2023-03-29 15:38 ` Peter Seiderer
2023-03-30 15:47   ` Gerd Kautzmann
2023-03-30 17:21     ` Peter Seiderer [this message]
     [not found]       ` <1619D009AA8C9E469331A8EE22395AEC8C24E1BC@Exchange2013.PRIMES.local>
2023-03-31 19:59         ` Peter Seiderer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230330192123.2ea69676@gmx.net \
    --to=ps.report@gmx.net \
    --cc=G.Kautzmann@PRIMES.de \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox