-
Notifications
You must be signed in to change notification settings - Fork 0
Development Workflows Board Programming With Foundries Builds
This guide shows how to program Dynamic Devices boards using builds downloaded directly from Foundries.io using the fio-program-board.sh script.
The fio-program-board.sh script provides a comprehensive solution for:
- 🎯 Auto-Latest Target Selection - Automatically finds and uses the latest successful build
- 🏭 Default Factory Support - Uses fioctl's default factory configuration
-
⚡ One-Command Programming - Download and program with
--programflag (no interactive wait) -
🔄 Continuous Programming - Program multiple boards in sequence with
--continuousflag - 💾 Intelligent Caching - Skips re-downloading existing files for instant re-runs
- ⏱️ Performance Timing - Real-time download and programming time tracking per board
- 🔧 i.MX93 Optimization - Uses correct bootloader to prevent "image too large" errors
-
📁 Auto-Organization - Creates clean
downloads/target-X-machine/structure - 🔒 Authentication Management - Comprehensive fioctl authentication checking
- 📋 Complete Artifact Management - Downloads MFGTools, UUU executables, bootloaders, system images
# Configure factory and default machine
./scripts/fio-program-board.sh --configureThis interactive setup will:
- Prompt for your Foundries.io factory name
- Let you select your default board type
- Test factory access and save configuration
- Create persistent settings for future use
# Download latest build for configured machine
./scripts/fio-program-board.sh
# Or specify target and machine explicitly
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx93-jaguar-eink 1975# Navigate to download directory
cd downloads/target-1975-imx93-jaguar-eink/
# Put board in download mode, connect USB, then program
sudo ./program-imx93-jaguar-eink.sh --flashFor production scenarios where you need to program multiple boards:
# Start continuous programming mode
./scripts/fio-program-board.sh --machine imx93-jaguar-eink --continuous
# The script will:
# 1. Download the build once (cached for subsequent boards)
# 2. Program boards in sequence: Board #1, #2, #3...
# 3. Show individual timing for each board
# 4. Prompt between boards: "Program another board? (y/N)"
# 5. Track total boards programmedContinuous Mode Benefits:
- 🔄 Batch Processing: Program multiple boards without re-downloading
- 📊 Individual Tracking: Shows timing and status for each board
- 🛡️ Error Recovery: Continue with next board if one fails
- 📈 Production Ready: Ideal for manufacturing and testing workflows
| Board | Machine Name | Platform | Description |
|---|---|---|---|
| Edge AI | imx8mm-jaguar-sentai |
i.MX8MM | AI audio STT/TTS platform |
| Edge EInk | imx93-jaguar-eink |
i.MX93 | Low-power e-ink controller |
| Edge EV | imx8mm-jaguar-phasora |
i.MX8MM | Energy management |
| Edge GW | imx8mm-jaguar-inst |
i.MX8MM | Communications gateway |
./scripts/fio-program-board.sh [OPTIONS] [target-number] [machine] [output-dir]Options:
-
-f, --factory FACTORY- Foundries.io factory name (required) -
-m, --machine MACHINE- Machine/hardware type to download -
-o, --output DIR- Output directory -
-l, --list-targets- List available targets and exit -
-c, --configure- Interactive configuration setup -
--program- Automatically program board after download -
--continuous- Continuous programming mode for multiple boards -
--mfgfolder DIR- Custom folder containing boot firmware files -
--force- Force re-download even if files exist locally -
-h, --help- Show help message
Examples:
# List available targets
./scripts/fio-program-board.sh --factory dynamic-devices --list-targets
# Download specific target
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx8mm-jaguar-sentai 1451
# Use configured defaults
./scripts/fio-program-board.sh 1975
# Download and program automatically
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx8mm-jaguar-sentai 1451 --program
# Use custom boot firmware files
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx8mm-jaguar-sentai 1451 --program --mfgfolder ./custom-boot-files
# Continuous programming mode with custom boot files
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx8mm-jaguar-sentai --continuous --mfgfolder ./custom-boot-filesThe generated programming script supports two modes:
# Full image programming (default) - bootloader + filesystem
sudo ./program-<machine>.sh --flash
# Bootloader only programming
sudo ./program-<machine>.sh --bootloader-only
# Show help
./program-<machine>.sh --helpEach download includes a complete programming package:
-
Main System Image:
lmp-factory-image-<machine>.wic.gz(400-500MB) -
Production Bootloader:
imx-boot-<machine>(~1.6MB) -
Production U-Boot:
u-boot-<machine>.itb(~1.3MB) -
Device Tree:
<machine>.dtb(~50KB) -
Build Manifest:
manifest.xml(build information)
- UUU Executables: Linux, Windows, macOS (ARM & x86)
-
Programming Scripts:
full_image.uuu,bootloader.uuu -
Manufacturing Images:
imx-boot-mfgtool,u-boot-mfgtool.itb -
Manufacturing Kernel:
fitImage-<machine>-mfgtool
-
Programming Script:
program-<machine>.sh(auto-generated) - Cache Info: Metadata for future caching (planned feature)
-
Software Requirements:
-
fioctlinstalled and authenticated (fioctl login) - Access to Foundries.io factory
-
sudoaccess for USB device programming
-
-
Hardware Setup:
- Board powered OFF
- DIP switches set to download/recovery mode
- USB cable connected between board and computer
-
Download Build:
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx93-jaguar-eink
-
Prepare Board:
- Set board to download/recovery mode (see board-specific instructions below)
- Connect USB-C cable to programming port
- Power ON the board
-
Program Board:
cd downloads/target-<number>-<machine>/ sudo ./program-<machine>.sh --flash
-
Complete Setup:
- Wait for programming to complete (~3-5 minutes)
- Set board back to normal boot mode
- Power cycle the board
- Board should boot to login prompt
- Set DIP switch SW1 to download mode position
- Connect USB-C cable to J7 (programming port)
- Power on via J6 or J8
- Set boot mode switches to download position
- Connect USB-C cable to programming port
- Power on the board
- Set DIP switches to download mode
- Connect USB-C programming cable
- Apply power
- Configure boot mode for download
- Connect USB programming interface
- Power cycle the board
"Failure open usb device"
- Ensure board is in download mode
- Check USB cable connection
- Try running with
sudo - Verify USB drivers are installed
"fioctl authentication failed"
- Run
fioctl loginto re-authenticate - Check factory name spelling
- Verify factory access permissions
"Target not found"
- Use
--list-targetsto see available targets - Check target number is correct
- Ensure target exists for specified machine
Programming hangs or fails
- Verify board is in correct download mode
- Try different USB cable or port
- Check board power supply
- Ensure no other UUU processes are running
Check UUU tool detection:
./program-<machine>.sh --help
# Should show "Using extracted MFGTools UUU tool"Verify downloaded files:
ls -la downloads/target-<number>-<machine>/
# Should show all required files including mfgtool-files directoryTest UUU manually:
cd downloads/target-<number>-<machine>/mfgtool-files-<machine>/
sudo ./uuu full_image.uuuThe --mfgfolder option allows you to use custom boot firmware files instead of the default ones from Foundries.io. This is useful for:
- Board-specific optimizations: Custom bootloader configurations
- Development testing: Testing new bootloader versions
- Recovery scenarios: Using known-good bootloader files
- Hardware bring-up: Custom firmware for new board revisions
Required files in custom folder:
-
imx-boot-mfgtool- Manufacturing/recovery bootloader -
u-boot-mfgtool.itb- Manufacturing U-Boot image
Example usage:
# Create custom boot files directory
mkdir -p custom-boot-files
# Copy your custom files (replace with actual custom files)
cp /path/to/your/imx-boot-mfgtool custom-boot-files/
cp /path/to/your/u-boot-mfgtool.itb custom-boot-files/
# Download and program with custom boot files
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx8mm-jaguar-sentai 1451 --program --mfgfolder custom-boot-filesHow it works:
- Downloads the standard Foundries.io build artifacts
- Extracts the mfgtool-files package
- Copies your custom boot files to override the defaults
- Programs using the original UUU scripts with your custom boot firmware
- Preserves all other artifacts (system image, device tree, etc.)
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx93-jaguar-eink 1975 --output /tmp/my-buildsudo ./program-<machine>.sh --bootloader-onlyUse this when you only need to update the bootloader without touching the filesystem.
The downloaded artifacts can be used to program multiple boards of the same type:
# Download once
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx93-jaguar-eink 1975
# Program multiple boards
cd downloads/target-1975-imx93-jaguar-eink/
sudo ./program-imx93-jaguar-eink.sh --flash # Board 1
# (swap boards)
sudo ./program-imx93-jaguar-eink.sh --flash # Board 2
# etc.The script can be integrated into automated testing workflows:
# Download latest successful build
LATEST_TARGET=$(./scripts/fio-program-board.sh --factory dynamic-devices --list-targets | grep imx93-jaguar-eink | tail -1 | awk '{print $1}')
./scripts/fio-program-board.sh --factory dynamic-devices --machine imx93-jaguar-eink $LATEST_TARGETFor production programming:
- Always verify target number matches expected release
- Check manifest.xml for build information
- Test boot on at least one board before batch programming
- Keep programming logs for traceability
| Aspect | Foundries.io Download | Local Build |
|---|---|---|
| Speed | ~5 minutes download | 30-60 minutes build |
| Consistency | Identical to CI builds | May vary by environment |
| Dependencies | Only fioctl required | Full Yocto environment |
| Storage | ~500MB per target | ~50GB build environment |
| Reliability | Tested in CI | Depends on local setup |
| Artifacts | Complete MFGTools package | Manual artifact collection |
- Factory Access: Ensure proper access controls on Foundries.io factory
- Build Verification: Verify target numbers and manifest information
- USB Security: Be cautious when using sudo for USB access
- Network Security: Downloads occur over HTTPS with authentication
After successful board programming:
- Verify Boot: Ensure board boots to login prompt
- Network Setup: Configure WiFi or Ethernet connectivity
- Application Deployment: Use Foundries.io for OTA app deployment
- Monitoring: Set up device monitoring and management
For ongoing development, consider:
- Setting up automated target notifications
- Implementing caching for frequently used builds
- Creating custom programming workflows for your specific needs