A Docker-based build system for compiling and uploading Arduino sketches for ChipKIT boards. This project provides a containerized environment for building Arduino sketches, ensuring consistent compilation across different development machines. This gets around the issue that the pic32 compiler is only 32 bits and is not available on modern OSes. If Microchip would update the compiler this project would work in the standard way.
- Linux: Working for both compilation and uploading
- Windows: Needs testing
- macOS: Needs testing
- Docker
- Docker Compose
- Git
- USB access for board programming (Linux users may need to add themselves to the
dialout
group)
-
Clone the repository:
git clone https://github.com/chipKIT32/chipKIT-docker.git cd chipKIT-docker
-
Build the Docker images:
docker compose build
-
Build the ChipKIT core (required first time):
./scripts/build-core.sh
-
If you encounter permission issues, run:
./scripts/fix-permissions.sh
-
List available boards:
./scripts/list-boards.sh
-
Build a sketch:
BOARD="chipKIT:pic32:fubarino_mini" ./scripts/build-sketch.sh path/to/sketch/sketch.ino
-
Upload a sketch (make sure your board is connected via USB):
BOARD="chipKIT:pic32:fubarino_mini" ./scripts/upload-sketch.sh -p /dev/ttyACM0 path/to/sketch/sketch.ino
-
Clean build artifacts:
./scripts/clean.sh
The build-sketch.sh
script is your main tool for building sketches. The default board is the Fubarino Mini.
Basic usage:
./scripts/build-sketch.sh path/to/sketch/sketch.ino
With specific board:
BOARD="chipKIT:pic32:chipkit_uc32" ./scripts/build-sketch.sh path/to/sketch/sketch.ino
Using separate build directory:
./scripts/build-sketch.sh --build-dir path/to/sketch/sketch.ino
The upload-sketch.sh
script handles uploading compiled sketches to your board:
BOARD="chipKIT:pic32:fubarino_mini" ./scripts/upload-sketch.sh -p /dev/ttyACM0 path/to/sketch/sketch.ino
The script will:
- Automatically detect available USB ports if none specified
- Build the sketch before uploading
- Verify successful upload
Options:
-p, --port <port> Specify the upload port (e.g., /dev/ttyACM0)
-h, --help Display help message
Use ./scripts/list-boards.sh
to see all available boards. Common boards include:
Board Name | FQBN |
---|---|
Fubarino Mini | chipKIT:pic32:fubarino_mini |
Fubarino SD | chipKIT:pic32:fubarino_sd |
chipKIT DP32 | chipKIT:pic32:chipkit_DP32 |
chipKIT uC32 | chipKIT:pic32:chipkit_uc32 |
chipKIT WF32 | chipKIT:pic32:chipkit_WF32 |
chipKIT WiFire | chipKIT:pic32:chipkit_WiFire |
chipKIT MAX32 | chipKIT:pic32:mega_pic32 |
chipKIT UNO32 | chipKIT:pic32:uno_pic32 |
.
├── README.md
├── compose.yaml # Docker Compose configuration
├── compose.upload.yaml # Upload-specific Docker configuration
├── dist/ # Build outputs directory
├── docker/ # Docker configuration files
│ ├── arduino-cli/ # Arduino CLI container configuration
│ └── core-builder/ # Core builder container configuration
├── scripts/ # Build and utility scripts
│ ├── build-core.sh # Builds the ChipKIT core
│ ├── build-sketch.sh # Compiles Arduino sketches
│ ├── clean.sh # Cleans build artifacts
│ ├── fix-permissions.sh # Fixes directory permissions
│ ├── fix-platform.sh # Platform configuration utility
│ ├── list-boards.sh # Lists available ChipKIT boards
│ └── upload-sketch.sh # Uploads compiled sketches
├── sketches/ # Arduino sketch files
└── tmp/ # Temporary build files
-
USB Access on Linux:
- Add your user to the dialout group:
sudo usermod -a -G dialout $USER
- Log out and back in for changes to take effect
- Add your user to the dialout group:
-
Windows/macOS Testing:
- USB device mapping may need adjustment
- Path handling might need fixes
- Please report issues on GitHub
-
Permission Issues:
./scripts/fix-permissions.sh
-
Build Failures: Check:
- Correct board FQBN is specified
- Core is built (
./scripts/build-core.sh
) - All required libraries are available
-
Upload Issues:
- Check USB connection
- Verify correct port permissions
- Ensure correct BOARD is specified
-
Docker Issues: Try:
./scripts/clean.sh docker compose build --no-cache ./scripts/build-core.sh
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
If you're using Windows or macOS, we'd appreciate help testing and reporting issues:
- Document your OS version and setup
- Try the basic workflow
- Note any issues with:
- USB device detection
- File permissions
- Path handling
- Build or upload processes
- Submit issues or pull requests with fixes
[Apache 2.0]