Skip to content

Supercharged USB bootloader for various PIC24/dsPIC33 MCUs.

License

Notifications You must be signed in to change notification settings

SudoMaker/PICoBoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.