Giter VIP home page Giter VIP logo

rpi-boot's Introduction

rpi-boot bootloader

Rpi-boot is a minimal serial bootloader for loading the initial bare metal code into Raspberry-Pi 2. It supports booting into the normal & secure world as well as the hypervisor mode.

Who should use this?

People who are experimenting with bare metal code and ...

  • Need a simple way to write and run bare metal normal/secure world or hypervisor mode code.
  • Don't have access to a JTAG debugger/programmer and you are getting tired of the SD-card juggling.

Who should not use this?

  1. Practically everybody ;)
  2. If you are running Linux you don't need this
  3. If you are running u-boot you have a much more powerful tool and won't need this either
  4. If your code is too large for serial download you can't use rpi-boot

Usage

The project structure is

  • bootloader/ - this is the minimal bootloader that should be written to your sdcard
  • programmer/ - this is the PC side software for uploading your bare metal code
  • testload/ - this is an example bare metal project (LED blink for RPi2, to be exact)

For a quick start

  1. insert working sdcard with the correct partitions (e.g. Raspbian)
  2. "make copy" (assuming Ubuntu 15.04 or higher)
  3. insert sdcard into RPi2 and switch power on
  4. connect RPi2 UART0 to /dev/ttyUSB0 (or equivalent)
  5. "make upload"
  6. Now if you change the testload project, you only need to power cycles and run "make upload" again to test your new code.

If you want to copy the bootloader manually, this is what you need to do

  1. "make" (build the project)
  2. copy bootloader/build/bootld.img to the boot partition as kernel7.img
  3. rename old kernel7.img to kernel7.img_OLD (repeat for kernel.img)
  4. add "kernel_old=1" to config.txt on the same partition.
  5. comment out any lines starting with "kernel=" in the same file

The programmer

For information about the programmer, see programmer/README.rst

A simple bare metal program for testing is included, see testload/README.rst.

JTAG

On RPi2 JTAG signals are initially turned off and must be enabled by configuring GPIO. Hence to use a JTAG debugger you first need to program the board. The bootloader solves this annoying "chicken and the egg" problem for you by configuring the GPIO pins to JTAG mode.

There are some other issues with JTAG on RPi2, refer to these resources for more information:

Technical details

For the technical details see bootloader/README.rst

rpi-boot's People

Contributors

avahidi 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.