Milk

by andy@warmcat.com 


An application that knows how to
drive Milksop, CheapLPC, Filtror,
Jektor, and Cheapi2c

     

 
Back to Latest News

Got Milk?

Scope 

Milk is a command-line application that is needed for several projects on this site.

Overview

    Milk currently controls Milksop, CheapLPC, Filtror and Jektor Jtag Programming.   

Principles

  • Compatible with Linux and Windows, but the devlopment is taking place on Linux

Implementation

2004-02-23  v0.20  Linux Source Distribution - lmilk
2002-10-07  v0.12  Windows binary executable - wmilk.exe

Note - on Windows you also need this DLL in the same directory

v0.12+ has been tested to work with SST49LF020 both -a and non-a LPC flash using CheapLPC
Small update 2002-07-21 to allow milksop to recognize Hynix devices

Usage

NOTE that the linux executable is called lmilk, while the Windows executable is now called wmilk.exe.  They are compiled from the same source code and should act extactly the same.

lmilk / wmilk require a mode switch for most operations.

If you use a linux symlink, you can eliminate the mode switch.  Execute lmilk as milksop to include the -m switch automatically, cheaplpc to include -c automatically, filtror for -f, cheapi2c for -2, and jektor for -j.  If this makes no sense to you, don't worry, just run the app as lmilk or wmilk and use the appropriate mode switch.

Milksop GPL Reflasher - 0.12 - (c)2002 andy@warmcat.com
MILK app: controls Milksop flash programmer

milk [mode] [options]
Mode switches
 -m, --milksop  (or run as 'milksop') Milksop mode
-c, --cheaplpc (or run as 'cheaplpc') CheapLPC mode
-f, --filtror (or run as 'filtror') Filtror mode
-j, --jtag (or run as 'jektor') Jtag mode
-2, --cheapi2c (or run as 'cheapi2c') I2C mode

Options that do not need mode
  -h, --help   print this help
  -v, --version   show version
  -a, --address hhhhh    Perform action starting from this hex address in flash (default 0)
  -d, --defaultfile <file>   incoming binary file for use with -t -b
  -b, --binarypatch <file>   insert binary into binary file, needs --address hhhhh
Milksop Options:(-m)
  -i, --internal   Target internal flash (default is external) used with other options
  -z, --justcheck   Just test that the flash can be communicated with, then exit
  -r, --readback <file>   Read back flash into the binary file given
  -p, --program <file>   Erase/Program flash with the binary file given
  -v, --verify   If given with program, reads back and confirms correct after program
  -e, --erase   Just perform erase
  -o, --ioport hhh   Use parallel port at given hex IO address (default 0x378)
  -a, --address hhhhh    Perform action starting from this hex address in flash (default 0)
  -q, --cyclepower   quick power cycle
CheapLPC Options:(-c)
  -r, --readback <file>   Read back flash into the binary file given
  -p, --program <file>   Erase/Program flash with the binary file given
  -v, --verify   If given with program, reads back and confirms correct after program
  -e, --erase   Just perform erase
  -o, --ioport hhh   Use parallel port at given hex IO address (default 0x378)
  -a, --address hhhhh    Perform action starting from this hex address in flash (default 0)
-S --slow n Slow down all IO by factor n
-T --test enter interactive test mode
Filtror Options:(-m)
  -r, --readback <file>   Read back flash into the binary file given
  -s, --showdata <hexlength>  Display memory at address given with -a
  -p, --program <file>   Erase/Program flash with the binary file given
  -v, --verify   If given with program, reads back and confirms correct after program
-t, --terminal Filtror terminal mode
  -o, --ioport hhh   Use parallel port at given hex IO address (default 0x378)
  -a, --address hhhhh    Perform action starting from this hex address in flash (default 0)
  -q, --cyclepower   quick power cycle

Jtag Options:(-j)
  -p, --program <svffile>   Execute SVF file on jtag
  -o, --ioport hhh   Use parallel port at given hex IO address (default 0x378)

Examples:
  milk -m -i -p myfile.bin
  milk -m -p myfile.bin -v -o 278 -a 80000
  milk -f -r newfile.bin
  milk -d binoriginalfile -t patchfile
  milk -d binoriginalfile -a 1000 -b binpatchfile


Milksop (-m) Common Examples

lmilk -m -i -z
Check that Milksop is able to communicate with the internal milksop flash, just returns the flash manufacturer and device ID and exists.  Use the -i switch to select the internal flash for all other examples
lmilk -m -z
Check that Milksop is able to communicate with the external flash, just returns the flash manufacturer and device ID and exists
lmilk -m -r test.bin
Read back the external flash into the file test.bin
lmilk -m -v -p myfile.bin
Erase, Program and then read back to Verify the external flash with myfile.bin

CheapLPC (-c) Common Examples

lmilk -c -a ffc00000 -r dump.bin
Read back the contents of the flash at LPC address FFC00000 into file dump.bin
lmilk -c -a ffc00000 -v -p myfile.bin
Erase, Program and Verify the flash at LPC address FFC00000 with file myfile.bin
lmilk -c -T
Interactive test mode, helpful in debugging your CheapLPC

Filtror (-f) Common Examples

lmilk -f -r dump.bin
Read back contents of Filtror SRAM into file dump.bin
lmilk -f -v -p myfile.bin
Program and verify Filtror SRAM with file myfile.bin
lmilk -f -p myfile.bin -q
Program Filtror SRAM and perform restart on host

Jtag (-j) Common Examples

lmilk -j -p myfile.svf
Program Jtag scanchain with myfile.svf

Cheapi2c (-2) Example

lmilk -2
Run Cheapi2c snooper