Enable camera in buildroot SDK

  • I just wanted to add some additional info here:

    Here is my `/etc/luckfox.cfg` file:

    ```
    SPI0_M0_CS_ENABLE=1
    SPI0_M0_MODE=1
    SPI0_M0_STATUS=1
    SPI0_M0_MISO_ENABLE=0
    SPI0_M0_SPEED=40000000
    CSI_ENABLE=1
    UART4_M1_STATUS=0
    PWM11_M1_STATUS=0
    PWM10_M1_STATUS=0
    PWM9_M1_STATUS=0
    PWM8_M1_STATUS=0
    PWM0_M1_STATUS=0
    PWM11_M2_STATUS=0
    I2C3_M1_STATUS=0
    I2C3_M1_SPEED=0
    I2C1_M1_STATUS=0
    I2C1_M1_SPEED=0
    ```
  • In the end, I got it.

    It seems like LIBCAMERA_APPS was the missing one.

    ```
    BR2_PACKAGE_LIBCAMERA_ARCH_SUPPORTS=y
    BR2_PACKAGE_LIBCAMERA=y
    BR2_PACKAGE_LIBCAMERA_V4L2=y
    BR2_PACKAGE_LIBCAMERA_HAS_PIPELINE=y
    # BR2_PACKAGE_LIBCAMERA_PIPELINE_RASPBERRYPI is not set
    BR2_PACKAGE_LIBCAMERA_PIPELINE_RKISP1=y
    # BR2_PACKAGE_LIBCAMERA_PIPELINE_SIMPLE is not set
    # BR2_PACKAGE_LIBCAMERA_PIPELINE_UVCVIDEO is not set
    # BR2_PACKAGE_LIBCAMERA_PIPELINE_VIMC is not set
    BR2_PACKAGE_LIBCAMERA_COMPLIANCE=y
    BR2_PACKAGE_LIBCAMERA_APPS=y
    ```
  • In the end, I DONT GOT IT.

    The above configuration, does work using SPI flash, but in MicroSD mode, it does not work.

    I am quite stumped at this point.
  • Hello libcamera is suitable for Raspberry Pi or related ISP products, Luckfox Pico uses the ISP developed by rockchip, buildroot adds LIBCAMERA and cannot be used on RV1103/RV1106, The use of the camera has been described in https://wiki.luckfox.com/Luckfox-Pico/L ... CSI-Camera, please attach the test method you used or the relevant logs
  • Can you please provide me `.config` file and highlight the relevant sections?

    ```
    sysdrv/source/buildroot/buildroot-2023.02.6/.config
    ```

    I can compile buildroot images for SPI flash which work fine (camera works), but if I do the same exact process (as far as I can tell) using a SD card target, the camera doesn't work!

    ```
    # ls /userdata/
    lost+found
    ```
    (no rkisp.ini)

    It would be very helpful to me if you could add additional information to the wiki about how to build a buildroot image, exactly how luckfox does it. My application is working great with SPI flash, but the use case explicitly forbids using SPI flash. It MUST be SD card. I've gotten some traction getting other people excited about my project, and it will hopefully drive more sales to you, but this hurdle has been plaguing me for months!

    If this is not the proper way to enable the camera, then what is?
    Screenshot 2025-05-08 at 11.14.49.png
    The only thing which mentions rkisp in buildroot is related to a LIBCAMERA pipeline. @Crocodile Your message is confusing.

    ```bash
    [root@luckfox ]# rkipc
    /bin/sh: rkipc: not found
    ```
    This `rkipc` command not found seems problematic, but no if I search `./build.sh buildrootconfig` there doesnt appear to be any way to select it?

    Now I turn off the device, take out the MicroSD card, and boot into SPI flash:
    ```bash
    [root@luckfox ]# which rkipc
    /oem/usr/bin/rkipc
    ```
    So it appears rkipc is an `oem` type package? Hmm? I will begin here.

    I will keep updating this post until I fix the problem or the mods approve it.

    FINAL EDIT:
    I think I figured it out:
    You must do these steps:
    ```bash
    ./build.sh media
    # AND
    ./build.sh app
    ```

    `rkipc` is not installed until you do `./build.sh app`, which is pretty confusing because you'd think that it would get installed in the `./build.sh media` step. I don't necessarily want to have to install the example app to get the camera?

    Is there a more straightforward way? I think this above info needs to get documented somewhere in the WIKI please!
    Last edited by kornpow on 2025-05-08 19:49, edited 4 times in total.
  • I rechecked the documentation regarding libcamera’s support for ISPs at [url]https://libcamera.org/libcamera_architecture.html[urls]. libcamera does indeed support more than just the Raspberry Pi platform — it can support different ISPs through its pipeline handler architecture. However, unfortunately, for Rockchip, it only supports the RK3399 (rkisp1). The ISP version used in the Luckfox-Pico is rkisp 3.2, and without access to the ISP driver source code, it's very difficult to get libcamera working on the Luckfox-Pico.

    The script ./build.sh media is used to build Rockchip-specific libraries (such as rkisp, rkmpi, etc.) and related test applications. These test applications alone can be used to drive the camera or perform streaming.
    The script ./build.sh app is used to build release applications, such as rkisp. These applications are separated from the Buildroot build process for secondary development purposes, and the type of application built can be specified via the RK_APP_TYPE variable in BoardConfig.mk.
    rkipc is a higher-level wrapper built on top of libraries like rkisp, rkmpi, and rockit, so it is not included in the ./build.sh media build process.