Flash programming utility for Microchip PIC32 microcontrollers
Switch branches/tags
Nothing to show
Clone or download
sergev Merge pull request #50 from sergev/revert-45-libusb_static_fix
Revert "Fix libusb linking: static libusb may not always be available"
Latest commit e5258f4 Sep 29, 2018
Permalink
Failed to load latest commit information.
bitbang Update binaries. Sep 27, 2015
hidapi @ b5b2e17 Fix build with hidapi on MacOSX. Jun 2, 2016
libusb-win32 Use libusb-1.0 library for Windows. Jun 2, 2016
linux32 Update Windows and Linux32 binaries. Jun 1, 2016
linux64 Update Linux64 binary. Jun 1, 2016
linuxarmhf Added linux ARM (hard float) binary Apr 12, 2015
macosx Update MacOSX binary. Jun 2, 2016
.gitignore Makefiles modified for git. Mar 4, 2015
.gitmodules Replace embedded hidapi with real hidapi library. Jun 2, 2016
.le.ini Initial revision. Jun 27, 2011
COPYING.txt Initial revision. Jun 27, 2011
README.txt Linux64 binary updated. Mar 7, 2015
adapter-an1388-uart.c Some cleanup after latest changes. Jun 1, 2016
adapter-an1388.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
adapter-bitbang.c Some cleanup after latest changes. Jun 1, 2016
adapter-hidboot.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
adapter-mpsse.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
adapter-pickit2.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
adapter-stk500v2.c Some cleanup after latest changes. Jun 1, 2016
adapter-uhb.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
adapter.h Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
clean.bat Initial revision. Jun 27, 2011
compile.bat Initial revision. Jun 27, 2011
configure.c Load a list of pic32 variants from pic32prog.conf file. Oct 21, 2015
executive.c Added programming executive for MZ family. Nov 21, 2013
family-mx1.c Some cleanup after latest changes. Jun 1, 2016
family-mx3.c Some cleanup after latest changes. Jun 1, 2016
family-mz.c Some cleanup after latest changes. Jun 1, 2016
hex-to-c.py Fixed length of PE, now mx1/mx2 with small memory work fine (thanks D… Jun 14, 2012
libintl.dll Initial revision. Jun 27, 2011
localize.h Some cleanup after latest changes. Jun 1, 2016
make-cygwin Replace embedded hidapi with real hidapi library. Jun 2, 2016
make-mingw Replace embedded hidapi with real hidapi library. Jun 2, 2016
makefile Revert "Fix libusb linking: static libusb may not always be available" Sep 28, 2018
pic32.h Added adapter flags and moved structs and typedefs to headers. Also a… Jun 6, 2015
pic32prog.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
pic32prog.conf Load a list of pic32 variants from pic32prog.conf file. Oct 21, 2015
pic32prog.exe Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
pickit2.h Added adapter flags and moved structs and typedefs to headers. Also a… Jun 6, 2015
serial.c Some cleanup after latest changes. Jun 1, 2016
serial.h Some cleanup after latest changes. Jun 1, 2016
target.c Enhance -d option to specify the USB target, like -d proto:vid:pid[:s… Jun 2, 2016
target.h Some cleanup after latest changes. Jun 1, 2016

README.txt

Pic32prog is a utility for loading data into a flash memory of Microchip PIC32
microcontrollers.  Supported adapters and bootloaders:
 * Microchip PICkit2
 * Microchip PICkit3 with scripting firmware
 * Olimex ARM-USB-Tiny (not finished yet)
 * Olimex ARM-USB-Tiny, ARM-USB-Tiny-H and ARM-USB-OCH-H JTAG adapters
 * Olimex MIPS-USB-OCH-H JTAG adapter
 * Bus Blaster v2 JTAG adapter from Dangerous Prototypes
 * Flyswatter JTAG adapter from TinCanTools
 * AN1388 HID bootloader
 * Legacy FS_USB HID bootloader


=== Usage ===

When called without parameters, pic32prog utility detects a type of microcontroller
and device configuration.  For example:

    % pic32prog
    Programmer for Microchip PIC32 microcontrollers, Version 1.0
        Copyright: (C) 2011 Serge Vakulenko
          Adapter: PICkit2 Version 2.32.0
        Processor: 795F512L (id 04307053)
     Flash memory: 512 kbytes
    Configuration:
        DEVCFG0 = 7ffffffd
                         1 Debugger enabled
                         8 Use PGC2/PGD2
        DEVCFG1 = ff6afd5b
                         3 Primary oscillator with PLL
                       1   Primary oscillator: XT
                       4   CLKO output active
                      3    Peripheral bus clock: SYSCLK / 8
                      4    Fail-safe clock monitor disable
                      8    Clock switching disable
                     a     Watchdog postscale: 1/1024
        DEVCFG2 = fff8f9d9
                         1 PLL divider: 1/2
                        5  PLL multiplier: 20x
                       1   USB PLL divider: 1/2
                      8    Disable USB PLL
                           Enable USB PLL
                     0     PLL postscaler: 1/1
        DEVCFG3 = 3affffff
                     7     Assign irq priority 7 to shadow set
                           Ethernet RMII enabled
                   2       Default Ethernet i/o pins
                           Alternate CAN i/o pins
                           USBID pin: controlled by port
                           VBuson pin: controlled by port

Writing to flash memory:

    pic32prog [-v] file.srec
    pic32prog [-v] file.hex

Reading memory to file:

    pic32prog -r file.bin address length

Parameters:

    file.srec   - file with firmware in SREC format
    file.srec   - file with firmware in Intel HEX format
    file.bin    - binary file
    address     - address in memory
    -v          - verify only (no write)
    -r          - read mode

Input file should have format SREC or Intel HEX.
You can convert ELF format (also COFF or A.OUT) to SREC using objcopy utility,
for example:

    objcopy -O srec firmware.elf firmware.srec


=== Sources ===

Sources are distributed under the terms of GPL.
You can download sources using Git:

    git clone https://github.com/sergev/pic32prog.git

To build it on Ubuntu, a few additional packages need
to be installed:

    sudo apt-get install libusb-dev libusb-1.0-0-dev libudev-dev

___
Regards,
Serge Vakulenko