Contents

  1. Introduction
  2. Software Version List
  3. How to Startup
    1. Preparation of the software
      1. Quick preparation: download binary
      2. Normal preparation: build source code
    2. How to flash
      1. Flashing loader
      2. Flashing OS image into SD card
    3. How to boot
  4. How to Check Functions
    1. Software support list
    2. CAN
    3. Audio
    4. GPIO
    5. I2C
    6. UART
    7. Thermal
    8. Pi Camera
    9. Pi Display
    10. Pi Active Cooler
  5. Tips
  6. Known Issues & Restrictions
  7. Support

Introduction

This is the Debian based BSP page for Sparrow Hawk.

Software Version List

Software Version
Debian 12
Linux kernel 6.12.58
U-Boot 2025.10
Arm Trusted Firmware 2.14.0

How to Startup

If you want to quickly start, please start 3.1.1. Quick preparation: download binary.

If you want to normally start, please start 3.1.2. Normal preparation: build source code.

Preparation of the software

Quick preparation: download binary

  1. Download binary from GitHub
  2. Unzip download zip file
    unzip ipl-burning.zip
    

    Next, jump to 3.2. How to flash.

Normal preparation: build source code

# You need to prepare docker envrionment on your Host PC
./build_image/build_with_docker_sparrow-hawk.sh <DEBIAN_VERSION>
ex.) ./build_image/build_with_docker_sparrow-hawk.sh 12

or

# Note: Build requirements can be confirmed from build_image/Dockerfile.
sudo ./build_image/build_debian_12_for_sparrow-hawk.sh <DEBIAN_VERSION>
ex.) sudo ./build_image/build_debian_12_for_sparrow-hawk.sh 12

Next, jump to 3.2. How to flash.

How to flash

Flashing loader

Run script in ipl-burning directory(Linux: run.sh, Windows: run.bat). If using Linux host PC, please install python3 and pip command on your system before running the script and close other console which uses serial port of the board before executing the script.

Note:

Note:

Flashing OS image into SD card

Linux case

gzip -cd sparrow-hawk-debian-12-based-bsp.img.gz | sudo dd of=<device file> bs=1M status=progress && sync

Windows case

  1. Extract gzip image using 7zip or similer software.
  2. Flash extracted image into SD card using Etcher, win disk imager, and so on.

How to boot

  1. Insert the SD card into CN1 which is bottom of the board.
  2. Open terminal application and open serial device.
  3. Press SW1 to power on the board.
  4. After booting U-Boot, please press any key while showing “Hit any key to stop autoboot:” to enter U-Boot shell.
  5. Input following command into U-Boot shell and press enter key.
    env default -a; boot
    
  6. If command and environment is correct, Linux kernel log will output.

If you want to boot OS image automatically when power on the board, please run following to setup autoboot. Run following command:

env default -a
saveenv

After that, OS image boots automatically when power on the board.

How to Check Functions

Software support list

Function Status
CAN Supported
Ethernet Supported
Audio(Output/Input) Supported
Display Port Supported
GPIO Supported
I2C Supported
JTAG Supported
USB3.0 Not supported
UART Supported
Thermal Supported
M.2 Not supported
Pi Camera Supported
Pi Display Supported
PCIe Endpoint Not supported
Pi Active Cooler Supported
GPU Not supported
AI Accelerator Not supported
Desktop(GUI) Not supported

Note:

CAN

Loop back

  1. Connect the following pins of CONN2: Connect Pin1(CAN1L) - Pin2(CAN0L) and Pin5(CAN1H) - Pin6(CAN0H)
  1. Execute following commands on Linux:
# Setup
sudo apt update
sudo apt install can-utils psmisc

# Test
sudo ip link set can0 up type can restart-ms 100 bitrate 1000000 dbitrate 5000000 fd on
sudo ip link set can1 up type can restart-ms 100 bitrate 1000000 dbitrate 5000000 fd on
sudo candump can0 &
sudo cangen can1 -I i -L i -D i -f -n 16
sudo killall candump
sudo candump can1 &
sudo cangen can0 -I i -L i -D i -f -n 16
sudo killall candump

Audio

  1. Connect headset/earphone/Speaker to CONN3.
  2. (if possible) Connect audio output like a smartphone to CONN4.
  3. Setup(Mix Aux in and Headset mic and setup audio output via CONN3)
    sudo amixer set "Headphone" 40%
    sudo amixer set "Headphone" on
    sudo amixer set "Mixout Left DAC Left" on
    sudo amixer set "Mixout Right DAC Right" on
    sudo amixer set "Aux" on
    sudo amixer set "Aux" 80%
    sudo amixer set "Mixin PGA" on
    sudo amixer set "Mixin PGA" 50%
    sudo amixer set "ADC" on
    sudo amixer set "ADC" 80%
    sudo amixer set "Mixin Left Aux Left" on
    sudo amixer set "Mixin Right Aux Right" on
    sudo amixer set "Mic 1" on
    sudo amixer set "Mic 1" 80%
    sudo amixer set "Mixin Left Mic 1" on
    sudo amixer set "Mixin Right Mic 1" on
    
  4. Test function
    1. Recording and Playback test(5sec)
      sudo arecord -D hw:0,0 -t wav -d 5 -c 2 -r 48000 -f S16_LE | sudo aplay
      
    2. Only Playback test
      sudo speaker-test -c2
      

GPIO

Toggle GP2_12(Pin11 on Pin Header)

  1. Connect LED or Oscilloscope to the board
  2. Execute following command
    sudo apt update
    sudo apt install python3 python3-pip python3-venv
    python3 -m venv .venv
    source .venv/bin/activate
    pip3 install gpiod
    wget https://raw.githubusercontent.com/rcar-community/meta-sparrow-hawk/refs/heads/scarthgap/recipes-examples/example-apps/files/toggle_gpio_GP2_12.py
    sudo .venv/bin/python3 toggle_gpio_GP2_12.py
    

For more examples, please see also https://github.com/brgl/libgpiod/raw/refs/heads/master/bindings/python/examples

I2C

Please search i2c-tools to use other commands(i2cdump, i2cget, i2cset, i2ctransfer).

UART

Loop back

  1. Connect UART TX and RX(pin 8 and pin 10) on PinHeader.
  1. Execute following commands:
    sudo stty -F /dev/ttySC2 -echo
    sudo cat /dev/ttySC2 &
    echo Hello | sudo tee /dev/ttySC2
    

Thermal

Pi Camera

Note:

Note:

 

  1. Connect Raspberry Pi Camera V2 to J1 and/or J2 connector.
  2. Setup for using camera
    • Change bootcmd variable on U-Boot shell as follows:
      setenv bootcmd "load mmc 0:1 0x58000000 /boot/fitImage && bootm {CONFIG}"
      
    • Cobination of connected cameras

      J1 J2 CONFIG
      V2 - 0x58000000#default#j1-imx219
      - V2 0x58000000#default#j2-imx219
      V2 V2 0x58000000#default#j1-imx219#j2-imx219
      V3 - 0x58000000#default#j1-imx708
      - V3 0x58000000#default#j2-imx708
      V3 V3 0x58000000#default#j1-imx708#j2-imx708
      V2 V3 0x58000000#default#j1-imx219#j2-imx708
      V3 V2 0x58000000#default#j1-imx708#j2-imx219

      This table shows the results when connecting the Raspberry Pi Camera V2 and Raspberry Pi Camera V3 to either J1 or J2, and to both J1 and J2.

  3. Execute following commands for using libcamera command
    git clone https://git.libcamera.org/libcamera/libcamera.git
    cd libcamera
    git checkout -B work b9fa6e0e61d3ea605fe4b1201ede5745cd5800e5
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0001-libcamera-ipa_manager-Create-IPA-by-name.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0002-ipa-ipa_module-Remove-pipelineName.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0003-ipa-meson.build-Remove-duplicated-variable.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0004-ipa-Allow-pipelines-to-have-differently-named-IPA.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0005-ipa-rkisp1-Add-settings-for-DreamChip-RPPX1-ISP.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0006-libcamera-pipeline-Add-R-Car-Gen4-ISP-pipeline.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0007-ipa-rkisp1-Add-basic-CCM-calibration-for-imx219.patch
    wget https://github.com/rcar-community/meta-sparrow-hawk/raw/refs/heads/scarthgap/recipes-multimedia/libcamera/files/0008-ipa-CameraSensorHelper-Add-CameraSensorHelperImx708.patch
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"
    git am *.patch
    sudo apt update
    sudo apt install meson build-essential ninja-build cmake libyaml-dev python3-yaml python3-ply python3-jinja2 libevent-dev pkg-config python3-dev python3-pybind11 libdrm-dev
    meson setup  --prefix=/usr/ -Dpipelines=rcar-gen4,rkisp1 -Dipas=rkisp1 -Dcam=enabled -Dpycamera=enabled -Dtest=false -Ddocumentation=disabled build
    sudo ninja -C build install
    
  4. Check camera device is recognized

    Raspberry Pi Camera V2

    root@sparrow-hawk:~# sudo cam -l
    (snip)
    Available cameras:
    1: External camera 'imx219' (/base/soc/i2c@e6508000/cam@10)   // J1
    2: External camera 'imx219' (/base/soc/i2c@e6510000/cam@10)   // J2
    

    Raspberry Pi Camera V3

    root@sparrow-hawk:~# sudo cam -l
    (snip)
    Available cameras:
    1: External camera 'imx708' (/base/soc/i2c@e6508000/sensor@1a)   // J1
    2: External camera 'imx708' (/base/soc/i2c@e6510000/sensor@1a)   // J2
    
  5. Test camera
    • Display Output(Need to connect Display)
      • using one camera
         sudo cam -c 1 -C -D
        
      • using two cameras
         sudo cam -c 1 -C -D
         sudo cam -c 2 -C -D
        

Pi Display

Note:

Note:

 

  1. Setup
    • Connect Raspberry Pi Touch Display 2 cable to the J4 connector.
    • Connect the Power (red wire) to pin 2 of CN7 and the Ground (black wire) to pin 6 of CN7.
    • Pi Display
  2. Change bootcmd variable on U-Boot shell as follows:

    5 inch

    setenv bootcmd "load mmc 0:1 0x58000000 /boot/fitImage && bootm 0x58000000#default#rpi-display-2-5in"
    

    7 inch

    setenv bootcmd "load mmc 0:1 0x58000000 /boot/fitImage && bootm 0x58000000#default#rpi-display-2-7in"
    
  3. Display will work correctly after changing above.

Pi Active Cooler

Manual control of fan speed

echo 2 | sudo tee /sys/class/hwmon/hwmon4/pwm1_enable
echo 150 | sudo tee /sys/class/hwmon/hwmon4/pwm1

#1 ~ 255 is acceptable but low speeds are not recommended from thermal perspective.

Tips

  1. How to expand the rootfs
    • Please run the following command on your board. Rootfs is expanded to use whole stor age.
      sudo apt update
      sudo apt install e2fsprogs parted
      wget https://raw.githubusercontent.com/rcar-community/meta-sparrow-hawk/refs/heads/scarthgap/recipes-utils/expand-rootfs/files/expand-rootfs.sh
      sudo bash ./expand-rootfs.sh
      sudo reboot
      

Known Issues & Restrictions

  1. PCIe module outputs error log that firmware is not found in boot process. We are preparing the PCIe firmware, then please ignore it and please wait a moment.
    [    2.629357] pcie-rcar-gen4 e65d0000.pcie: Failed to load firmware (rcar_gen4_pcie.bin): -22
    

Support

FAQ: https://github.com/orgs/rcar-community/discussions/categories/faq

Q&A Forum: https://github.com/orgs/rcar-community/discussions/categories/q-a