Logic Sniffer: OLS-loader utility
From DP
This utility is used to load new bitstreams for the FPGA. A bitstream update changes the logic that captures and stores samples.
There are presently 2 versions of this program, supporting different option syntax.
Contents |
Latest Version for this Document
New option syntax:
Logic Sniffer ROM loader v0.3 (September 30, 2010)
Old option syntax:
Logic Sniffer ROM loader v0.3 (November 9, 2010)
Source Code
Download the latest version of this tool from https://github.com/GadgetFactory/OpenBench-Logic-Sniffer
The old option syntax version is in directory tools/ols-loader.
The new option syntax version is in tools/ols-loader/new-command-parser-version.
Options - old option syntax
parameters: -p:PORT - port of Logic Sniffer, needs to be specified -t:SPEED - sets speed of the serial port -wH:FILE - HEX file to be uploaded to OLS -wB:FILE - BIN file to be uploaded to OLS -rH:FILE - HEX file to be downloaded from OLS -rB:FILE - BIN file to be downloaded from OLS -l:X - send only first X paged commands: -erase - erases Flash -write - writes data to Flash -read - reads data from Flash -ignore_jedec - ignore jedec id -run - enter run mode after finished -status - get OLS stauts -boot - enter bootloader mode - ignore other commands -selftest - run self-test - ignore other commands
Options - new option syntax
parameters: --port PORT - port of Logic Sniffer, needs to be specified. Same as -p Port --speed SPEED - sets speed of the serial port. Same as -s Speed --wH FILE - HEX file to be uploaded to OLS --wB FILE - BIN file to be uploaded to OLS --rH FILE - HEX file to be downloaded from OLS --rB FILE - BIN file to be downloaded from OLS --l X or -l X - send only first X paged commands: --erase - erases Flash, also same as using -e --write - writes data to Flash, as -w --read - reads data from Flash, same as -r --ignore_jedec - ignore jedec id, same as -i --run - enter run mode after finished, same as -r --status - get OLS status, same as -s --boot - enter bootloader mode - ignore other commands, same as -b --selftest - run self-test - ignore other commands
When no command specified, program will check FW version, and Flash ID
Usage examples
Query OLS for current versions and flash identity
ols-loader -p:/dev/ttyACM0 -status
ols-loader --port /dev/ttyACM0 --status
Save current flash to a file
ols-loader -p:/dev/ttyACM0 -rH:current-flash.hex -read
ols-loader --port /dev/ttyACM0 --rH current-flash.hex --read
Notes on command parameters
The new syntax version supports the standard long and short option commandline parameters: the short option uses a single dash ('-') followed by a single character parameter, e.g -p while a long option uses double dash ('--') followed by single word or string e.g. --port the parameters 'wH', 'wR' uses only the long option parameter e.g. --wH filename
Windows
to Get help on parameters:
ols-loader ols-loader -h ols-loader --help ols-loader error-in-cmdline-parameters
to read the ols.hex file, OLS on COM3:
ols-loader --port COM3 --rH OLS.hex --read
its the same as
ols-loader -p COM3 --rH OLS.hex -r
To erase and write flash, data in BIN file 'OLS.bin', OLS on COM2:
ols-loader --port COM2 --wB OLS.hex --write --erase
or for the short options parameters:
ols-loader -p COM2 --wB OLS.hex -w -e
To get status, and jump to run mode, OLS on COM2:
ols-loader --port COM2 --run --status
or for the short option parameters:
ols-loader -p COM2 -r -s
Jump to bootloader
ols-loader --boot ols-loader -b
Run selftest (long commandline option parameter only)
ols-loader --selftest
Linux
The ols-loader code compiles without complaint on debian squeeze.
Commands and syntax are same as windows except for the port option which uses /dev/ttyACM* or /dev/ttyS*
To read Flash to HEX file 'OLS.hex' from OLS on /dev/ttyS1:
./ols-loader --port /dev/ttyS1 --rH OLS.hex --read or ./ols-loader -p /dev/ttyS1 --rH OLS.hex -r
OSx
Not tested
Update Notes
This utility has the same functionality as the previous version (September 3, 2010) except that the commandline parameters are modified to follow the standard syntax.
1. The code now uses getopt_long, which allows the '--' (double dash) and also use the '-' (single dash) to specify command parameters.
2. The command line no longer use the colon ':' because of the use of getopt_long function. eg. -port:com3 should now be --port com3 or -p com3.
3. Single dash use is always followed by a single character, as opposed to double dash which uses a word.
4. #define DPwrite write etc when not on _WIN32 os, instead of copy/pasting same functions as 'write' etc.
The code compiles without complaint in both debian and Windows, under Code::Blocks 10.05
