Code Monkey home page Code Monkey logo

picoboot's Introduction

PICoBoot

Supercharged USB bootloader for various PIC24/dsPIC33 MCUs.

Features

Community version

  • Supports all PIC24/dsPIC33 MCUs with USB module
  • No driver installation needed on modern host OS (Linux/macOS/Windows)
  • fastboot like command line tool, for quick integration into development workflows
  • Versatile protocol with strong integrity check
  • Non-volatile environment variable (like U-Boot)
  • Serial number support
  • Read/Write inhibit, to prevent the firmware from being read out or overwritten
  • No interrupt proxying, keeps you fast in reacting to interrupts

Commercial version

  • All community version features
  • Software based voltage glitch protection
  • Firmware checksum & signing support
  • Customizable OEM commands

Usage

Installation

  • Flash the .hex file to your board using the MPLAB X IPE. (This is the only one we can use at this moment. One day we will get openocd to support PIC24!)
  • Usually you just need to hold the user button and push the MCLR button to enter bootloader. However, depending on the board definition, some boards may have different ways for this.
  • Connect the board to your computer.
  • Use the picoboot utility to manipulate the device.

Screenshot_20210519_203901

Supported boards / products

The units are the weird 3-byte word as mentioned in MCHP's datasheets.

Board MCU BL Addr BL Region Size App Addr App Region Size Enter Bootloader
PotatoPi PICo24 PIC24FJ256GB206 0x0400 0x3600 0x4000 0x26000 Hold RD7 + MCLR
PotatoChip PICo24 PIC24FJ64GB002 0x0400 0x2000 0x2400 0x8400 Hold RB7 + MCLR
CartBoy RW v2 PIC24FJ256GB108 0x0400 0x3600 0x4000 0x26000 Software only

If you use PICoBoot in your project, feel free to expand this list!

Development

Hey! It's 2021! Use CMake!

Build requirements

  • XC16 1.70+
  • CMake 3.13+

Screenshot_20210519_204243

Screenshot_20210519_204324

IDE

  • Any IDE with proper CMake support would be good. Personally I recommend CLion.
  • Using MPLAB X IDE is a sin and totally unforgivable!

Screenshot_20210519_204636

Adding new boards

  • Duplicate an existing directory in Boards directory
  • Change it to the board's name
  • Modify PICoBoot_Board.* source code files and PICoBoot.ld linker script, edit the board info, boot mode logic, button handling, flash offsets, init routines as you like. Ensure the bootloader is installed to the second page of flash.
  • Add the board info to CMakeLists.txt. The syntax is picoboot_add_board(board_name chip_name heap_size).
  • You can use existing ones as examples.

User application (firmware) modification

Only the linker script needs to be modified.

  • Change the start position of program data to the address of the next page after last page used by bootloader
  • Decrease the program data length by minus it with the size of pages used by bootloader
  • That's all!

How to help this project

  • Code improvements, of cource
  • Urge Microchip to be more opensource friendly:
    • Stop selling their outdated compiler
    • Add PIC18/24/33 support to mainline GCC & GDB
  • Buy a commercial version of PICoBoot, if you need the extra features
  • Have a look at our store on Tindie

Licensing

Community version

AGPLv3. Also read this FAQ.

Commercial version

Please contact us.

picoboot's People

Contributors

reimunotmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.