VEYE IMAGING Forum
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    • Register
    • Login

    Install camera to rpi4

    Scheduled Pinned Locked Moved Raspberry Pi App Software
    14 Posts 3 Posters 4.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V Offline
      Viktor @veye_xumm
      last edited by Viktor

      I have tried:

      crosscompile kinux image veye327 driver for Ubuntu Desktop 21.04 Rpi4

      on rpi4

      uname -r
      
      5.11.0-1008-raspi
      
      uname -a
      
      Linux number 5.11.0-1008-raspi #8-Ubuntu SMP PREEMPT Thu May 6 17:46:38 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
      

      on host

      sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev crossbuild-essential-arm64
      
      mkdir rpi_ubuntu_source
      cd rpi_ubuntu_source
      
      git clone --depth=1 git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux-raspi/+git/hirsute
      
      git clone https://github.com/veyeimaging/raspberrypi_v4l2.git
      
      
      cp raspberrypi_v4l2/driver_source/cam_drv_src/rpi-5.x_all/veye327.c hirsute/drivers/media/i2c
      

      edit hirsute/drivers/media/i2c/Kconfig

      find section imx219 and after it add:

      config VIDEO_VEYE327
      	tristate "VEYE VEYE327 sensor support"
      	depends on I2C && VIDEO_V4L2
      	select MEDIA_CONTROLLER
      	select VIDEO_V4L2_SUBDEV_API
      	select V4L2_FWNODE
      	help
      	  This is a Video4Linux2 sensor driver for the VEYE
      	  IMX327 camera.
      
      	  To compile this driver as a module, choose M here: the
      	  module will be called veye327.
      

      edit hirsute/drivers/media/i2c/Makefile

      find line imx219 and after it add:

      obj-$(CONFIG_VIDEO_VEYE327)	+= veye327.o
      
      
      cp raspberrypi_v4l2/driver_source/dts/rpi-5.10.y/veye327-overlay.dts hirsute/arch/arm64/boot/dts/overlays
      

      edit hirsute/arch/arm64/boot/dts/overlays/Makefile

      find line imx219 and after it add:

      veye327.dtbo \
      

      build

      cd hirsute
      
      KERNEL=kernel8
      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
      
      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
      

      got to Device Drivers --> Multimedia Support --> Media ancillary drivers --> Camera sensor devices

      select veye327 and save

      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j4
      

      copy image and dtb

      on rpi4 replace vmlinuz-* with compiled hirsute/arch/arm64/boot/Image

      on rpi4 copy to /boot/firmware/overlays dtb file hirsute/arch/arm64/boot/dst/overlays/veye327.dtbo


      Before was imx219 connected and it works on Ubuntu Desktop 21.04 rpi4 as /dev/video0

      Was replaced imx219 to veye327E.

      After reboot rpi4 loaded but /dev/video0 gone.

      Can you help me to understand what files i need to copy?
      May be config, system.map, initrd or other dtb files?

      1 Reply Last reply Reply Quote 0
      • V Offline
        Viktor @veye_xumm
        last edited by

        This post is deleted!
        V 1 Reply Last reply Reply Quote 0
        • V Offline
          Viktor @Viktor
          last edited by

          Here is rpi boot contents:

          number@number:/boot$ ls
          config-5.11.0-1008-raspi  dtb-5.11.0-1008-raspi  grub                          
          System.map-5.11.0-1008-raspi
          config.txt                
          dtbs                  
          initrd.img                    
          vmlinuz-5.11.0-1008-raspi
          dtb                       
          firmware               
          initrd.img-5.11.0-1008-raspi
          
          V 1 Reply Last reply Reply Quote 0
          • V Offline
            Viktor @Viktor
            last edited by Viktor

            I tried installing veye327 to rpiOs.

            I have 5.10.36 firmware. veye drivers don't have this version.

            I tried build from source, but failed.
            Copied built zImage and veye327.dtbo to rpi and got load kernel modules failed on startup.

            Updated: i did modules_install and veye327 works on rpiOs now.

            Can you help build kernel for Ubuntu Desktop Rpi?

            V 1 Reply Last reply Reply Quote 0
            • V Offline
              Viktor @Viktor
              last edited by Viktor

              I did it.

              crosscompile kinux image veye327 driver for Ubuntu Desktop 21.04 Rpi4

              on rpi4

              uname -r
              5.11.0-1008-raspi
              
              uname -a
              Linux number 5.11.0-1008-raspi #8-Ubuntu SMP PREEMPT Thu May 6 17:46:38 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
              

              on host

              sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev crossbuild-essential-arm64
              
              mkdir rpi_ubuntu_source
              cd rpi_ubuntu_source
              
              git clone --depth=1 git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux-raspi/+git/hirsute linux
              
              git clone https://github.com/veyeimaging/raspberrypi_v4l2.git
              
              
              cp raspberrypi_v4l2/driver_source/cam_drv_src/rpi-5.x_all/veye327.c linux/drivers/media/i2c
              

              edit linux/drivers/media/i2c/Kconfig

              find section imx219 and after it add:

              config VIDEO_VEYE327
              	tristate "VEYE VEYE327 sensor support"
              	depends on I2C && VIDEO_V4L2
              	select MEDIA_CONTROLLER
              	select VIDEO_V4L2_SUBDEV_API
              	select V4L2_FWNODE
              	help
              	  This is a Video4Linux2 sensor driver for the VEYE
              	  IMX327 camera.
              
              	  To compile this driver as a module, choose M here: the
              	  module will be called veye327.
              

              edit linux/drivers/media/i2c/Makefile

              find line imx219 and after it add:

              obj-$(CONFIG_VIDEO_VEYE327)	+= veye327.o
              
              
              cp raspberrypi_v4l2/driver_source/dts/rpi-5.10.y/veye327-overlay.dts linux/arch/arm64/boot/dts/overlays
              

              edit linux/arch/arm64/boot/dts/overlays/Makefile

              find line imx219 and after it add:

              veye327.dtbo \
              

              build kernel

              cd linux
              
              KERNEL=kernel8
              make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
              
              make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
              

              go to Device Drivers --> Multimedia Support --> Media ancillary drivers --> Camera sensor devices

              select veye327 and save

              make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j4
              

              mount sd to host

              mkdir mnt
              mkdir mnt/fat32
              mkdir mnt/ext4
              sudo mount /dev/sdd1 mnt/fat32
              sudo mount /dev/sdd2 mnt/ext4
              

              copy modules

              sudo env PATH=$PATH make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=mnt/ext4 modules_install
              

              copy kernel and dtb

              sudo cp mnt/fat32/vmlinuz mnt/fat32/vmlinuz.old
              sudo cp arch/arm64/boot/Image mnt/fat32/vmlinuz
              sudo cp arch/arm64/boot/dts/broadcom/*.dtb mnt/fat32/
              sudo cp arch/arm64/boot/dts/overlays/*.dtb* mnt/fat32/overlays/
              sudo cp arch/arm64/boot/dts/overlays/README mnt/fat32/overlays/
              sudo umount mnt/fat32
              sudo umount mnt/ext4
              

              on rpi4

              edit /boot/firmware/config.txt

              add lines

              gpu_mem=400
              dtparam=i2c_vc=on
              cma=128M
              dtoverlay=veye327.dtbo
              start_x=1
              
              sudo reboot
              
              dmesg | grep veye
              
              veye327 probed
              

              preview

              gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! videoconvert ! autovideosink sync=false text-overlay=false -v
              

              success

              V F 2 Replies Last reply Reply Quote 0
              • V Offline
                Viktor @Viktor
                last edited by

                Add to /etc/modules

                i2c-dev
                

                i2c bus 10,11 for sensor control

                veye_xummV 1 Reply Last reply Reply Quote 0
                • veye_xummV Offline
                  veye_xumm @Viktor
                  last edited by

                  @viktor
                  Great! Thank you for trying and sharing.

                  Questions will be answered as soon as possible, please be patient.
                  如果你使用中文,请直接用中文提问。
                  May the force be with YOU. (This is the translation of the mysterious Chinese symbol above.)

                  V 1 Reply Last reply Reply Quote 0
                  • V Offline
                    Viktor @veye_xumm
                    last edited by

                    😎

                    1 Reply Last reply Reply Quote 0
                    • F Offline
                      fire @Viktor
                      last edited by

                      @viktor
                      Thanks very much.
                      I wonder how did you set camera parameters, I found that the cs_mipi_i2c.sh not working.

                      V 1 Reply Last reply Reply Quote 0
                      • V Offline
                        Viktor @fire
                        last edited by

                        @fire Veye327 i2c fully works.

                        F 1 Reply Last reply Reply Quote 0
                        • F Offline
                          fire @Viktor
                          last edited by

                          @viktor
                          Can you use the original pi commands (e.g. raspistill raspivid), instead of using gst-launch?

                          V 1 Reply Last reply Reply Quote 0
                          • V Offline
                            Viktor @fire
                            last edited by Viktor

                            @fire Yes, raspivid and raspistill works too on Ubuntu.

                            1 Reply Last reply Reply Quote 0

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            • First post
                              Last post