Robostix args
From GumstixDocsWiki
This page describes one technique that arguments can be passed into a program running on the robostix.
Contents |
Storing the arguments
This technique uses the non-volatile EEPROM to store command line arguments. The files Args.h and Args.c implement the robostix side of things (found in the robostix/Common directory. Args.c expects the symbol CFG_ARGS_EEPROM_ADDR to defined in Config.h. 0x0c00 is a typical value which would work with the robostix (There is 4k bytes of EEPROM and the i2c Bootloader uses bytes at the high end of the 4k.
Generating the arguments
The roboargs program runs on the gumstix and creates a .hex file which can be programed into the EEPROM.
roboargs usage
A typical invocation of roboargs would look like this:
roboargs --addr=0xc00 This is a test > args.hex
If the first argument starts with a '-', then you need to use the following syntax:
roboargs --addr=0x0c00 -- -a foo > args.hex
The -- causes the parsing of arguments for roboargs to terminate, and considers the rest of the command line to be arguments to be generated for the robostix.
Uploading arguments to the robostix
You can upload the .hex file to the robostix using the following uisp line:
uisp --segment=eeprom --upload if=args.hex
Test program
There is also a test program called ArgTest which flashes some LEDs and prints out the arguments to the UART-0 port once every 5 seconds.

