Thingino firmware consists of multiple partitions that are combined into a single binary image file. The build system creates two types of firmware images:
Filename: thingino-<camera>.bin
This image contains all partitions including U-Boot bootloader and is used for:
- Initial installation on new cameras
- Complete firmware replacement
- Recovery from serious system failures
Filename: thingino-<camera>-update.bin
This image excludes the U-Boot bootloader partition and is used for:
- Regular firmware updates on cameras already running Thingino
- Faster updates since bootloader doesn't need to be reflashed
The firmware consists of the following partitions, written sequentially to flash:
| Partition | Size | Type | Description |
|---|---|---|---|
| U-Boot | 256 KB | Fixed | Bootloader (first stage and SPL) |
| Env | 32 KB | Fixed | U-Boot environment variables |
| Config | 224 KB | Fixed | JFFS2 filesystem for persistent configuration |
| Kernel | Dynamic | Dynamic | Linux kernel (uImage format) |
| RootFS | Dynamic | Dynamic | Root filesystem (SquashFS, compressed) |
| Extras | Dynamic | Dynamic | Optional additional files (JFFS2) |
Contains the bootloader that initializes the hardware and loads the kernel.
Stores U-Boot environment variables in a binary format generated from the .uenv.txt configuration files.
A JFFS2 filesystem containing:
- System configuration files from
user/common/overlay/and any camera- or device-scoped user overlays - Persistent settings that survive firmware updates
- Network configuration, credentials, etc.
Contains the Linux kernel image. Size is calculated based on the actual kernel size, aligned to 32 KB blocks.
A compressed SquashFS filesystem containing:
- All system binaries and libraries
- Web interface files
- Default configuration templates
- Size depends on selected packages and features
New Behavior (Optimized for Smaller Images)
The extras partition is now handled intelligently to reduce firmware image size:
-
For Release Builds: If the
/opt/directory in the build is empty (no custom files), the extras partition is NOT included in the firmware image. The partition will be automatically created and formatted on the camera at first boot when needed. -
For Development Builds with Custom Files: If there are custom files in
/opt/(from local builds or overlays), the extras partition is created, populated with the files, and padded to the full calculated partition size to fill the flash.
This approach provides several benefits:
- Smaller images for standard builds: 8MB images can fit on 16MB/32MB flash chips without wasting space
- Faster downloads and flashing: Less data to transfer
- Efficient use of flash: Empty space isn't pre-allocated
- Custom files supported: Developer builds with local files still work as expected
The partition typically contains:
- Additional packages and tools (installed to
/opt/) - Large optional components
- User-installed applications
Thingino supports various flash chip sizes:
- 8 MB - Minimal installation
- 16 MB - Standard installation
- 32 MB - Extended installation with more features
The build system automatically calculates partition sizes based on:
- Flash chip size (configured per camera model)
- Actual size of compiled kernel and rootfs
- Whether custom files exist in
/opt/
- Fixed partitions: U-Boot (256K), Env (32K), Config (224K) always use the same sizes
- Dynamic partitions: Kernel and RootFS sizes are aligned to 32 KB block boundaries
- Extras partition:
- If empty: Excluded from image, created at first boot
- If has content: Size = (Flash Size - Sum of all other partitions)
The build process:
- Compilation: Buildroot compiles all packages, kernel, and creates the rootfs
- Partition Creation:
u-boot-lzo-with-spl.bin- bootloader binaryu-boot-env.bin- environment binary from uenv.txtconfig.jffs2- config partition fromuser/common/overlay/and layered user overlaysuImage- kernel binaryrootfs.squashfs- compressed root filesystemextras.jffs2- optional extras partition (only if has content)
- Image Assembly:
make packcombines partitions into final images
# Build firmware from scratch
make CAMERA=your_camera
# Rebuild kernel and rootfs, repack image
make CAMERA=your_camera repack
# Clean and rebuild everything
make CAMERA=your_camera cleanbuild# Flash bootloader only (rarely needed)
make CAMERA=your_camera upboot_ota IP=192.168.1.10
# Flash complete firmware including bootloader
make CAMERA=your_camera ota IP=192.168.1.10When installing Thingino for the first time or recovering a bricked camera:
- Connect the flash chip to a programmer (e.g., CH341A)
- Use
snanderor similar tool to write the full firmware image:snander -w thingino-camera.bin
- Set up a TFTP server with the firmware image
- Boot the camera and interrupt U-Boot
- Flash the firmware:
sf probe 0 sf erase 0x0 0x800000 tftpboot 0x80000000 thingino-camera.bin sf write 0x80000000 0x0 ${filesize}
All partitions are aligned to 32 KB (0x8000) boundaries to match the erase block size of most NOR flash chips. This ensures:
- Efficient flash operations
- Proper JFFS2 filesystem function
- Compatibility with various flash chip models
Each firmware image includes a SHA256 checksum file:
thingino-camera.bin.sha256sum- for full imagethingino-camera-update.bin.sha256sum- for update image
Verify before flashing:
sha256sum -c thingino-camera.bin.sha256sum- Firmware Dumping - How to backup existing firmware
- Camera Recovery - Recovering from failed updates
- Building from Sources - Detailed build instructions