GithubHelp home page GithubHelp logo

oyama / pico-sdcard-boot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 14 KB

Raspberry Pi Pico SD card bootloader

License: BSD 3-Clause "New" or "Revised" License

CMake 16.16% C 83.84%
raspberry-pi-pico sdcard

pico-sdcard-boot's Introduction

Raspberry Pi SD Card Bootloader

pico-sdcard-boot is a custom bootloader for the Raspberry Pi Pico. This bootloader provides the functionality to load and execute applications from an SD card, designed to enable developers to deploy programs to the Pico using an SD card easily.

Bootloader Build and Installation

Clone the source code and initialize the submodules.

git clone https://github.com/oyama/pico-sdcard-boot.git
cd pico-sdcard-boot
git submodule update --init --recursive

Build the bootloader.

mkdir build; cd build
PICO_SDK_PATH=/path/to/pico-sdk cmake ..
make

Once the build is complete, drop the generated sdboot.uf2 firmware onto the Pico mounted in BOOTSEL mode to write it.

SD Card Application Build and Deployment

This section explains how to build and deploy applications on an SD card. Below is a simple example of a CMakeLists.txt for an application.

cmake_minimum_required(VERSION 3.13...3.27)
include(vendor/pico_sdk_import.cmake)
add_subdirectory(pico-sdcard-boot)

project(hello)
set(FAMILY rp2040)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()

add_executable(hello main.c)
target_link_libraries(hello PRIVATE pico_stdlib)
pico_enable_stdio_usb(hello 1)
pico_add_extra_outputs(hello)

enable_sdcard_app(hello)

The enable_sdcard_app() function sets the necessary linker script for projects that boot from an SD card.

Build and Deployment Process

  1. Build the project using the above CMakeLists.txt.
mkdir build; cd build
PICO_SDK_PATH=/path/to/pico-sdk cmake ..
make
  1. Once the build is complete, copy the generated hello.bin file to the root directory of the SD card as firmware.bin.
  2. Insert the SD card into the Pico and reset the device; the new application will automatically load and run.

License

This project is licensed under the 3-Clause BSD License. For details, see the LICENSE file.

pico-sdcard-boot's People

Contributors

oyama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.