diff options
author | Roland Lutz <rlutz@hedmen.org> | 2017-06-07 17:33:59 +0200 |
---|---|---|
committer | Roland Lutz <rlutz@hedmen.org> | 2017-07-02 14:49:37 +0200 |
commit | 6741d93245c3e080ef43d2c4c2ac525749c2eb76 (patch) | |
tree | 1cc53a72cd1d7f8fdc76c7f7d35c1e642f07a4c7 | |
parent | 703a913bd188f1338d3f2cb27428227006e916aa (diff) | |
download | icestorm-6741d93245c3e080ef43d2c4c2ac525749c2eb76.tar.gz icestorm-6741d93245c3e080ef43d2c4c2ac525749c2eb76.tar.bz2 icestorm-6741d93245c3e080ef43d2c4c2ac525749c2eb76.zip |
iceprog: Overhaul `--help' text
-rw-r--r-- | iceprog/iceprog.c | 93 |
1 files changed, 41 insertions, 52 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index 7f0830c..a38e113 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -278,71 +278,60 @@ void flash_wait() void help(const char *progname) { + fprintf(stderr, "Simple programming tool for FTDI-based Lattice iCE programmers.\n"); + fprintf(stderr, "Usage: %s [-b|-n|-c] <input file>\n", progname); + fprintf(stderr, " %s -r|-R<bytes> <output file>\n", progname); + fprintf(stderr, " %s -S <input file>\n", progname); + fprintf(stderr, " %s -t\n", progname); fprintf(stderr, "\n"); - fprintf(stderr, "iceprog -- simple programming tool for FTDI-based Lattice iCE programmers\n"); + fprintf(stderr, "General options:\n"); + fprintf(stderr, " -d <device string> use the specified USB device [default: i:0x0403:0x6010]\n"); + fprintf(stderr, " d:<devicenode> (e.g. d:002/005)\n"); + fprintf(stderr, " i:<vendor>:<product> (e.g. i:0x0403:0x6010)\n"); + fprintf(stderr, " i:<vendor>:<product>:<index> (e.g. i:0x0403:0x6010:0)\n"); + fprintf(stderr, " s:<vendor>:<product>:<serial-string>\n"); + fprintf(stderr, " -I [ABCD] connect to the specified interface on the FTDI chip\n"); + fprintf(stderr, " [default: A]\n"); + fprintf(stderr, " -o <offset in bytes> start address for read/write [default: 0]\n"); + fprintf(stderr, " (append 'k' to the argument for size in kilobytes,\n"); + fprintf(stderr, " or 'M' for size in megabytes)\n"); + fprintf(stderr, " -v verbose output\n"); fprintf(stderr, "\n"); + fprintf(stderr, "Mode of operation:\n"); + fprintf(stderr, " [default] write file contents to flash, then verify\n"); + fprintf(stderr, " -r read first 256 kB from flash and write to file\n"); + fprintf(stderr, " -R <size in bytes> read the specified number of bytes from flash\n"); + fprintf(stderr, " (append 'k' to the argument for size in kilobytes,\n"); + fprintf(stderr, " or 'M' for size in megabytes)\n"); + fprintf(stderr, " -c do not write flash, only verify (`check')\n"); + fprintf(stderr, " -S perform SRAM programming\n"); + fprintf(stderr, " -t just read the flash ID sequence\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "Erase mode (only meaningful in default mode):\n"); + fprintf(stderr, " [default] erase aligned chunks of 64kB in write mode\n"); + fprintf(stderr, " This means that some data after the written data (or\n"); + fprintf(stderr, " even before when -o is used) may be erased as well.\n"); + fprintf(stderr, " -b bulk erase entire flash before writing\n"); + fprintf(stderr, " -n do not erase flash before writing\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "Miscellaneous options:\n"); + fprintf(stderr, " --help display this help and exit\n"); + fprintf(stderr, " -- treat all remaining arguments as filenames\n"); fprintf(stderr, "\n"); fprintf(stderr, "Notes for iCEstick (iCE40HX-1k devel board):\n"); fprintf(stderr, " An unmodified iCEstick can only be programmed via the serial flash.\n"); fprintf(stderr, " Direct programming of the SRAM is not supported. For direct SRAM\n"); fprintf(stderr, " programming the flash chip and one zero ohm resistor must be desoldered\n"); fprintf(stderr, " and the FT2232H SI pin must be connected to the iCE SPI_SI pin, as shown\n"); - fprintf(stderr, " in this picture: http://www.clifford.at/gallery/2014-elektronik/IMG_20141115_183838\n"); - fprintf(stderr, "\n"); + fprintf(stderr, " in this picture:\n"); + fprintf(stderr, " http://www.clifford.at/gallery/2014-elektronik/IMG_20141115_183838\n"); fprintf(stderr, "\n"); fprintf(stderr, "Notes for the iCE40-HX8K Breakout Board:\n"); fprintf(stderr, " Make sure that the jumper settings on the board match the selected\n"); fprintf(stderr, " mode (SRAM or FLASH). See the iCE40-HX8K user manual for details.\n"); fprintf(stderr, "\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "Usage: %s [options] <filename>\n", progname); - fprintf(stderr, "\n"); - fprintf(stderr, " -d <device-string>\n"); - fprintf(stderr, " use the specified USB device:\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " d:<devicenode> (e.g. d:002/005)\n"); - fprintf(stderr, " i:<vendor>:<product> (e.g. i:0x0403:0x6010)\n"); - fprintf(stderr, " i:<vendor>:<product>:<index> (e.g. i:0x0403:0x6010:0)\n"); - fprintf(stderr, " s:<vendor>:<product>:<serial-string>\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -I [ABCD]\n"); - fprintf(stderr, " connect to the specified interface on the FTDI chip\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -r\n"); - fprintf(stderr, " read first 256 kB from flash and write to file\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -R <size_in_bytes>\n"); - fprintf(stderr, " read the specified number of bytes from flash\n"); - fprintf(stderr, " (append 'k' to the argument for size in kilobytes, or\n"); - fprintf(stderr, " 'M' for size in megabytes)\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -o <offset_in_bytes>\n"); - fprintf(stderr, " start address for read/write (instead of zero)\n"); - fprintf(stderr, " (append 'k' to the argument for size in kilobytes, or\n"); - fprintf(stderr, " 'M' for size in megabytes)\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -c\n"); - fprintf(stderr, " do not write flash, only verify (check)\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -b\n"); - fprintf(stderr, " bulk erase entire flash before writing\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -n\n"); - fprintf(stderr, " do not erase flash before writing\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -S\n"); - fprintf(stderr, " perform SRAM programming\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -t\n"); - fprintf(stderr, " just read the flash ID sequence\n"); - fprintf(stderr, "\n"); - fprintf(stderr, " -v\n"); - fprintf(stderr, " verbose output\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "Without -b or -n, iceprog will erase aligned chunks of 64kB in write mode.\n"); - fprintf(stderr, "This means that some data after the written data (or even before when -o is\n"); - fprintf(stderr, "used) may be erased as well.\n"); - fprintf(stderr, "\n"); + fprintf(stderr, "If you have a bug report, please file an issue on github:\n"); + fprintf(stderr, " https://github.com/cliffordwolf/icestorm/issues\n"); } int main(int argc, char **argv) |