-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.txt
114 lines (73 loc) · 3.01 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
'mphidflash' is a simple command-line tool for communicating with Microchips
USB HID-Bootloader and downloading new firmware. mphidflash supports Linux,
Mac OS X (Leopard and later), and Windows.
The 'mphidflash' project is hosted on
http://code.google.com/p/mphidflash/
Building and Installing
=======================
Linux
-----
For Linux, you'll need the 'libhid' development library (and associated
dependencies) installed, which can be handled by most package managers or
from the command line:
sudo apt-get install libhid-dev
Assuming you're reading this as the README.txt alongside the source code,
to compile mphidflash for a 32 or 64 bit x86 system, in the Terminal window type:
make mphidflash32
or
make mphidflash64
To compile for arm, run
make mphidflasharm
Then install with the command:
sudo make install32
or
sudo make install64
This will copy the appropriate executable to /usr/local/bin/mphidflash so you
don't need to specify a complete path to the program each time.
Mac OS X
--------
To build mphidflash for Mac, you'll need to have Xcode (Apple's
developer tools) already installed. The IDE portion is not used here, just
the command line interface.
Assuming you're reading this as the README.txt alongside the source code,
to compile mphidflash for a 32 or 64 bit system, in the Terminal window type:
make mphidflash32
or
make mphidflash64
Then install with the command:
sudo make install32
or
sudo make install64
This will copy the appropriate executable to /usr/local/bin/mphidflash so you
don't need to specify a complete path to the program each time.
Windows
-------
To build mphidflash for Windows, you can use mingw32 (cross) compiler. For
cross compiling on Linux, you'll need the 'mingw32' toolchain (and associated
dependencies) installed, which can be handled by most package mangager or
from the command line:
sudo apt-get install mingw32
Assuming you're reading this as the README.txt alongside the source code,
to compile mphidflash, in the Terminal window type:
make -f Makefile.win
This will create a .exe in the binaries sub-directory, which can be called
from the Windows commmand line - e.g. 'mphidflash-1.6-win-32.exe'. You should
copy this file somewhere on your executable path and rename it to 'mphidflash.exe'.
Usage
=====
To upload a new program to your PIC, it must be connected to your computer and
set into bootloader mode. mphidflash can then be used with the following
options:
-help Display help screen (alternately: -?)
-write <file> Upload given file to PIC
-reset Reset PIC
-noverify Skip verification step
-erase Erase PIC memory
-vendor <hex> Use given USB vendor id instead of default id
-product <hex> Use given USB product id instead of default id
Note that you likley will need to use 'sudo' with mphidflahs on Linux.
Example: To upload the program test.hex to the PIC and to reset the PIC thereafter
the following command line can be used:
mphidflash -write test.hex -reset
Or for Linux:
sudo mphidflash -write test.hex -reset