https://github.com/seeed-studio/recamera-os
upstream: https://github.com/sophgo/sophpi/tree/sg200x-evb
https://github.com/seeed-studio/recamera-os
Last synced: 4 months ago
JSON representation
upstream: https://github.com/sophgo/sophpi/tree/sg200x-evb
- Host: GitHub
- URL: https://github.com/seeed-studio/recamera-os
- Owner: Seeed-Studio
- Created: 2024-04-03T11:33:47.000Z (about 2 years ago)
- Default Branch: sg200x-reCamera
- Last Pushed: 2025-09-19T11:54:08.000Z (9 months ago)
- Last Synced: 2025-09-19T13:33:57.204Z (9 months ago)
- Language: Shell
- Homepage:
- Size: 4.29 MB
- Stars: 48
- Watchers: 16
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
- [1. Official reference](#1-official-reference)
- [2. How to start](#2-how-to-start)
- [2.1 Build in Docker](#21-build-in-docker)
- [2.2 Build in Dev Containers](#22-build-in-dev-containers)
- [2.3 Build in Host](#23-build-in-host)
- [2.3.1 Install Dependencies](#231-install-dependencies)
- [2.3.2 Checkout code](#232-checkout-code)
- [2.3.3 Build](#233-build)
- [2.4 Flashing](#24-flashing)
## 1. Official reference
- [Developer Portal](https://developer.sophgo.com/thread/471.html)
## 2. How to start
### 2.1 Build in Docker
```bash
sudo ./docker_build.sh sg2002_recamera_emmc
```
If you want to run the build script without sudo (recommended for convenience):
1. Ensure Docker is installed and the daemon is running.
2. Add your user to the docker group:
```bash
sudo usermod -aG docker "$USER"
# re-login OR run:
newgrp docker
docker info | grep -i 'server version'
```
3. Then run without sudo:
```bash
./docker_build.sh sg2002_recamera_emmc
```
Temporary (not persistent) alternative if you cannot modify groups:
```bash
sudo setfacl -m user:$(id -un):rw /var/run/docker.sock
```
Rootless Docker (optional): follow official guide https://docs.docker.com/engine/security/rootless/ then run the same script (no sudo needed).
Troubleshooting:
- Permission denied: ensure group change took effect (new shell) and `groups` shows `docker`.
- Cannot connect to the Docker daemon: start service (`sudo systemctl start docker`) or rootless service (`systemctl --user start docker`).
### 2.2 Build in Dev Containers
Please refer to [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) for more details.
### 2.3 Build in Host
#### 2.3.1 Install Dependencies
- Recommended OS: Ubuntu 20.04 LTS
- Recommended C/C++: GCC/G++ >= 11.4.0
- Recommended cmake: 3.31.2
- Recommended minimum free space: 30 GB
- Install dependencies
```bash
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt-get install -y pkg-config build-essential ninja-build automake autoconf libtool wget curl git libssl-dev bc squashfs-tools android-sdk-libsparse-utils \
jq tclsh scons parallel ssh-client tree python3-dev python3-pip device-tree-compiler libssl-dev ssh cpio \
squashfs-tools fakeroot flex bison mtools gcc-11 g++-11 libbz2-dev \
android-sdk-ext4-utils python3-distutils slib libncurses5 rsync
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 60
pip install cmake jinja2
```
- Check evironment
```bash
$ cmake --version
cmake version 3.31.2
$ gcc --version
gcc (Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0
$ g++ --version
g++ (Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0
```
#### 2.3.2 Checkout code
- Clone the Repository
```bash
git clone https://github.com/Seeed-Studio/reCamera.git -b sg200x-reCamera
cd reCamera
git submodule init
git submodule update --depth 1
```
- Update Submodules (optional)
```bash
./scripts/repo_clone.sh --gitpull external/subtree.xml
```
#### 2.3.3 Build
- Location of the ${project}_defconfig
```bash
ls external/configs/
sg2002_recamera_emmc_defconfig sg2002_recamera_sd_defconfig sg2002_xiao_sd_defconfig
```
- Building the Project
```bash
make ${project}
```
Example:
```bash
make sg2002_recamera_emmc
```
- Location of the Build Targets
```bash
ls -l output/${project}/install/soc_${project}/${project}
```
Example:
```bash
cd output/sg2002_recamera_emmc/install/soc_sg2002_recamera_emmc/
ls -l *.zip
sg2002_reCamera_0.0.1_emmc_ota.zip
sg2002_reCamera_0.0.1_emmc_recovery.zip
sg2002_reCamera_0.0.1_emmc_sd_compat.zip
sg2002_reCamera_0.0.1_emmc.zip
```
### 2.4 Flashing
- Booting from eMMC (Example: sg2002_reCamera_0.0.1_emmc.zip)
- Install windows driver: [CviUsbDownloadInstallDriver.zip](https://github.com/Seeed-Studio/reCamera/releases/download/0.0.1/CviUsbDownloadInstallDriver.zip)
- Unzip the [CviBurn_v2.0_cli_windows.zip](https://github.com/Seeed-Studio/reCamera/releases/download/0.0.1/CviBurn_v2.0_cli_windows.zip) package.
- Unzip the package generated by [Section 2.3](#23-build), for example:
./output/sg2002_recamera_emmc/install/soc_sg2002_recamera_emmc/sg2002_reCamera_0.0.1_emmc.zip
- Execute the following command in Windows (use [-m xx:xx:xx:xx:xx:xx] to configure the Ethernet MAC address):
`usb_dl.exe -c cv181x -s linux -i ..\sg2002_reCamera_0.0.1_emmc [-m xx:xx:xx:xx:xx:xx]`
- SD Card recovery (Example: sg2002_reCamera_0.0.1_emmc_recovery.zip)
- Use [balenaEtcher](https://etcher.balena.io/#download-etcher) to flash the `sg2002_reCamera_0.0.1_emmc_recovery.zip` file into the SD card.
- Then insert the SD card into the board, and power on. It will automatically burn image into emmc.
- Booting from SD Card (Example: sg2002_reCamera_0.0.1_emmc_sd_compat.zip)
- Use [balenaEtcher](https://etcher.balena.io/#download-etcher) to flash the `sg2002_reCamera_0.0.1_emmc_sd_compat.zip` file into the SD card.
- Then insert the SD card into the board, and power on. The board will booting from SD card.
- OTA (Example: sg2002_reCamera_0.0.1_emmc_ota.zip)
- This image is specifically designed for OTA updates via the WebUI.