Giter Club home page Giter Club logo

pslab-bootloader's Introduction

PSLab Bootloader

This repository contains the bootloader of the Pocket Science Lab (PSLab) open hardware platform.

Build Status Gitter Mailing List Twitter Follow

The bootloader makes it possible to flash new firmware to the device over a USB connection, whereas without it a special programming tool is required.

Pocket Science Lab

The PSLab provides an array of test and measurement instruments for doing science and engineering experiments. Its built-in instruments include an oscilloscope, a waveform generator, a frequency counter, programmable voltage and current sources, and a logic analyzer. The PSLab also has UART, I2C, and SPI buses, via which external devices can be connected and controlled.

The PSLab is a fully open device, and FOSSASIA provides a complete hardware and software stack under open source licenses:

Buy

Get in touch

Dependencies

The following tools are required to build the bootloader:

  • xc16 compiler
  • cmake

Building

This project is built with CMake. After cloning this repository, you must first initialize and update the toolchain submodule:

git submodule init
git submodule update

This will populate the external/cmake-microchip directory, after which the bootloader can be built:

mkdir build
cd build
cmake ..
make

This will create a build artifact in the build directory: pslab-bootloader.hex.

Creating a combined HEX file

It is possible to create a HEX file containing both the bootloader and the firmware. To do this, follow these steps:

  1. Build the bootloader

  2. Build the firmware

  3. Move firmware.hex into the build/ directory of the bootloader repository

  4. Run combine_hex.sh. The hexmate program, distributed as part of MPLAB-X, needs to be in your $PATH. Alternatively, modify combine_hex.sh to include the full pathname to hexmate.

Flashing

Flashing the bootloader requires a programmer such as the PICkit3.

Flashing with a programmer requires the mdb.sh script, which is distributed as part of Microchip's MPLAB-X software suite. On Linux, the default installation path for mdb.sh is /opt/microchip/mplabx/<version>/mplab_platform/bin/mdb.sh. This script is used to run the file flash.mdbscript, located in the repository root. Before following the below steps, you may need to modify flash.mdbscript depending on which programmer you are using and the location of the firmware HEX.

  1. Disconnect the device from any power source
  2. Connect the programmer to the device's ICSP header
  3. Power on the device via USB
  4. Run mdb.sh flash.mdbscript
  5. Disconnect the programmer

Repository structure

📦pslab-bootloader
 ┣ 📂src                        # PSLab bootloader source code
 ┃ ┣ 📂mcc_generated_files      # Source C files
 ┃ ┣ 📜 ...
 ┃ ┣ 📜main.c                   # Entry point to PSLab Bootloader
 ┣ 📂external
 ┃ ┣ 📂cmake-microchip          # Toolchain submodule
 ┣ 📜CMakeLists.txt
 ┣ 📜flash.mdbscript
 ┣ 📜LICENSE
 ┗ 📜README.md

pslab-bootloader's People

Contributors

bessman avatar cloudypadmal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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