A simple "Hello World" program for the Raspberry Pi Pico that prints a message every 0.5 seconds over USB serial.
- Prints "Hello, World!" every 0.5 seconds over USB serial
- Uses the Pico SDK's standard I/O functions
- Demonstrates basic timing with
sleep_ms() - Docker-based build system for cross-platform compatibility
- Docker - The only requirement for building!
The project uses Docker to handle all build dependencies, making it easy to build on any system.
-
Clone this repository:
git clone https://github.com/YOUR_USERNAME/pico-helloworld.git cd pico-helloworld -
Run the build script:
./build.sh
This will:
- Build the Docker image (first time only)
- Set up the build environment
- Compile the project
- Generate the output files in the
builddirectory
The build process will create several files in the build directory:
hello_world.uf2- The main file for flashing to the Picohello_world.bin- Raw binary formathello_world.hex- Intel HEX formathello_world.elf- ELF format executable (for debugging)
- Hold the BOOTSEL button while plugging in the Pico
- The Pico will appear as a USB mass storage device
- Copy the
build/hello_world.uf2file to the Pico - The Pico will automatically restart and run the program
- After flashing, the Pico will enumerate as a USB serial device
- Use your favorite serial monitor (e.g.,
minicom,screen, or PuTTY) to connect - You should see "Hello, World!" being printed every 0.5 seconds
If you prefer to run the Docker commands manually:
# Build the Docker image
docker build -t pico-build .
# Run the build process
docker run --rm -v "$(pwd):/pico/project" pico-build build-
If you see permission errors when running Docker:
- On Linux, make sure you're in the
dockergroup - On Windows, ensure Docker Desktop is running
- On macOS, ensure Docker Desktop has the necessary permissions
- On Linux, make sure you're in the
-
If the build fails:
- Ensure Docker is running
- Try removing the build directory:
rm -rf build - Check that all files are present:
ls -la
This project is open source and available under the MIT License.