Update urclock's -x parameters

This commit is contained in:
Stefan Rueger 2022-11-07 18:01:23 +00:00
parent 715db4c690
commit cf3c81f714
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
2 changed files with 39 additions and 31 deletions

View File

@ -1152,9 +1152,12 @@ Defaults to 10 if not specified.
.It Ar Urclock .It Ar Urclock
.Bl -tag -offset indent -width indent .Bl -tag -offset indent -width indent
.It Ar showall .It Ar showall
Show all info for the connected part and exit. Show all info for the connected part, then exit. The -xshow... options
below can be used to assemble a bespoke response consisting of a subset
(or only one item) of all available relevant information about the
connected part and bootloader.
.It Ar showid .It Ar showid
Show a unique Urclock ID stored in either flash or EEPROM of the MCU and exit. Show a unique Urclock ID stored in either flash or EEPROM of the MCU, then exit.
.It Ar id=<E|F>.<addr>.<len> .It Ar id=<E|F>.<addr>.<len>
Historically, the Urclock ID was a six-byte unique little-endian number Historically, the Urclock ID was a six-byte unique little-endian number
stored in Urclock boards at EEPROM address 257. The location of this stored in Urclock boards at EEPROM address 257. The location of this
@ -1162,28 +1165,34 @@ number can be set by the -xid=<E|F>.<addr>.<len> extended parameter. E
stands for EEPROM and F stands for flash. A negative address addr counts stands for EEPROM and F stands for flash. A negative address addr counts
from the end of EEPROM and flash, respectively. The length len of the from the end of EEPROM and flash, respectively. The length len of the
Urclock ID can be between 1 and 8 bytes. Urclock ID can be between 1 and 8 bytes.
.It Ar showdate
Show the last-modified date of the input file for the flash application,
then exit. If the input file was stdin, the date will be that of the
programming.
.It Ar showfilename
Show the input filename (or title) of the last flash writing session, then exit.
.It Ar title=<string>
When set, <string> will be used in lieu of the input filename. The maximum
string length for the title/filename field is 254 bytes including
terminating nul.
.It Ar showapp .It Ar showapp
Show the size of the programmed application and exit. Show the size of the programmed application, then exit.
.It Ar showstore .It Ar showstore
Show the size of the unused flash between the application and metadata and exit. Show the size of the unused flash between the application and metadata, then exit.
.It Ar showmeta .It Ar showmeta
Show the size of the metadata just below the bootloader and exit. Show the size of the metadata just below the bootloader, then exit.
.It Ar showboot .It Ar showboot
Show the size of the bootloader and exit. Show the size of the bootloader, then exit.
.It Ar showversion .It Ar showversion
Show bootloader version and capabilities, and exit. Show bootloader version and capabilities, then exit.
.It Ar showvbl .It Ar showvbl
Show the vector number and name of the interrupt table vector used by the Show the vector number and name of the interrupt table vector used by the
bootloader for starting the application, and exit. For hardware-supported bootloader for starting the application, then exit. For hardware-supported
bootloaders this will be vector 0 (Reset), and for vector bootloaders this bootloaders this will be vector 0 (Reset), and for vector bootloaders this
will be any other vector number of the interrupt vector table or the slot will be any other vector number of the interrupt vector table or the slot
just behind the vector table with the name VBL_ADDITIONAL_VECTOR. just behind the vector table with the name VBL_ADDITIONAL_VECTOR.
.It Ar showdate .It Ar showpart
Show the last-modified date of the input file for the flash application Show the part for which the bootloader was compiled, then exit.
and exit. If the input file was stdin, the date will be that of the
programming.
.It Ar showfilename
Show the input filename (or title) of the last flash writing session, and exit.
.It Ar bootsize=<size> .It Ar bootsize=<size>
Manual override for bootloader size. Urboot bootloaders put the number of used Manual override for bootloader size. Urboot bootloaders put the number of used
bootloader pages into a table at the top of flash, so the urclock programmer can bootloader pages into a table at the top of flash, so the urclock programmer can
@ -1223,10 +1232,6 @@ not be reached after reset.
.It Ar initstore .It Ar initstore
On writing to flash fill the store space between the flash application and On writing to flash fill the store space between the flash application and
the metadata section with 0xff. the metadata section with 0xff.
.It Ar title=<string>
When set, <string> will be used in lieu of the input filename. The maximum
string length for the title/filename field is 254 bytes including
terminating nul.
.It Ar nofilename .It Ar nofilename
On writing to flash do not store the application input filename (nor a title). On writing to flash do not store the application input filename (nor a title).
.It Ar nodate .It Ar nodate

View File

@ -282,14 +282,15 @@ typedef struct {
// Extended parameters for Urclock // Extended parameters for Urclock
int showall, // Show all pieces of info for connected part and exit int showall, // Show all pieces of info for connected part and exit
showid, // ... Urclock ID showid, // ... Urclock ID
showdate, // ... last-modified date of last uploaded application
showfilename, // ... filename of last uploaded application
showapp, // ... application size showapp, // ... application size
showstore, // ... store size showstore, // ... store size
showmeta, // ... metadata size showmeta, // ... metadata size
showboot, // ... bootloader size showboot, // ... bootloader size
showversion, // ... bootloader version and capabilities showversion, // ... bootloader version and capabilities
showvbl, // ... vector bootloader level, vector number and name showvbl, // ... vector bootloader level, vector number and name
showdate, // ... last-modified date of last uploaded application showpart, // ... part for which bootloader was compiled
showfilename, // ... filename of last uploaded application
xbootsize, // Manual override for size of bootloader section xbootsize, // Manual override for size of bootloader section
xvectornum, // ... for vector number (implies vbllevel = 1) xvectornum, // ... for vector number (implies vbllevel = 1)
xeepromrw, // ... for EEPROM r/w capability xeepromrw, // ... for EEPROM r/w capability
@ -812,14 +813,15 @@ nopatch_nometa:
set++; set++;
if(set && set != vecsz) if(set && set != vecsz)
Return("input overwrites the reset vector partially rendering vector bootloader moot, exiting"); Return("input overwrites reset vector, which would render the vector bootloader inoperable");
if(set) { if(set) {
int resetdest; int resetdest;
if(reset2addr(flm->buf, vecsz, flm->size, &resetdest) < 0) if(reset2addr(flm->buf, vecsz, flm->size, &resetdest) < 0)
Return("input does not hold an r/jmp at reset vector rendering vector bootloader moot, exiting"); Return("input would overwrite the reset vector making the vector bootloader unreachable");
if(resetdest != ur.blstart) if(resetdest != ur.blstart)
Return("input file points reset to 0x%04x instead of vector bootloader at 0x%04x, exiting", resetdest, ur.blstart); Return("input file points reset to 0x%04x instead of vector bootloader at 0x%04x, exiting",
resetdest, ur.blstart);
} }
} }
return size; return size;
@ -1260,7 +1262,7 @@ vblvecfound:
// Showing properties mostly requires examining the bytes below bootloader for metadata // Showing properties mostly requires examining the bytes below bootloader for metadata
if(ur.showall || (ur.showid && *ur.iddesc && *ur.iddesc != 'E') || ur.showapp || if(ur.showall || (ur.showid && *ur.iddesc && *ur.iddesc != 'E') || ur.showapp ||
ur.showstore || ur.showmeta || ur.showboot || ur.showversion || ur.showvbl || ur.showstore || ur.showmeta || ur.showboot || ur.showversion || ur.showvbl ||
ur.showdate || ur.showfilename) { ur.showpart || ur.showdate || ur.showfilename) {
if((rc = ur_readEF(pgm, p, spc, ur.blstart-nm, nm, 'F'))) if((rc = ur_readEF(pgm, p, spc, ur.blstart-nm, nm, 'F')))
return rc; return rc;
@ -1313,7 +1315,8 @@ vblvecfound:
// Print and exit when option show... was given // Print and exit when option show... was given
int first=1; int first=1;
int single = !ur.showall && (!!ur.showid + !!ur.showapp + !!ur.showstore + !!ur.showmeta + int single = !ur.showall && (!!ur.showid + !!ur.showapp + !!ur.showstore + !!ur.showmeta +
!!ur.showboot + !!ur.showversion + !!ur.showvbl + !!ur.showdate + !!ur.showfilename) == 1; !!ur.showboot + !!ur.showversion + !!ur.showvbl + !!ur.showpart + !!ur.showdate +
!!ur.showfilename) == 1;
if(ur.showid || ur.showall) { if(ur.showid || ur.showall) {
uint64_t urclockID; uint64_t urclockID;
@ -1339,7 +1342,7 @@ vblvecfound:
int vnum = ur.vbllevel? ur.vblvectornum & 0x7f: 0; int vnum = ur.vbllevel? ur.vblvectornum & 0x7f: 0;
term_out(" vector %d (%s)"+first, vnum, vblvecname(pgm, vnum)), first=0; term_out(" vector %d (%s)"+first, vnum, vblvecname(pgm, vnum)), first=0;
} }
if(ur.showall) if(ur.showall || ur.showpart)
term_out(" %s"+first, ur.uP.name); term_out(" %s"+first, ur.uP.name);
if(!first) { if(!first) {
term_out("\n"); term_out("\n");
@ -1986,14 +1989,16 @@ static int urclock_parseextparms(const PROGRAMMER *pgm, LISTID extparms) {
} options[] = { } options[] = {
{"showall", &ur.showall, 0, NULL, 0, "Show all info for connected part and exit"}, {"showall", &ur.showall, 0, NULL, 0, "Show all info for connected part and exit"},
{"showid", &ur.showid, 0, NULL, 0, " ... unique Urclock ID"}, {"showid", &ur.showid, 0, NULL, 0, " ... unique Urclock ID"},
{"showdate", &ur.showdate, 0, NULL, 0, " ... last-modified date of flash application"},
{"showfilename", &ur.showfilename, 0, NULL, 0, " ... filename of last uploaded application"},
{"showapp", &ur.showapp, 0, NULL, 0, " ... application size"}, {"showapp", &ur.showapp, 0, NULL, 0, " ... application size"},
{"showstore", &ur.showstore, 0, NULL, 0, " ... store size"}, {"showstore", &ur.showstore, 0, NULL, 0, " ... store size"},
{"showmeta", &ur.showmeta, 0, NULL, 0, " ... metadata size"}, {"showmeta", &ur.showmeta, 0, NULL, 0, " ... metadata size"},
{"showboot", &ur.showboot, 0, NULL, 0, " ... bootloader size"}, {"showboot", &ur.showboot, 0, NULL, 0, " ... bootloader size"},
{"showversion", &ur.showversion, 0, NULL, 0, " ... bootloader version and capabilities"}, {"showversion", &ur.showversion, 0, NULL, 0, " ... bootloader version and capabilities"},
{"showvbl", &ur.showvbl, 0, NULL, 0, " ... vector bootloader level, vec # and name"}, {"showvbl", &ur.showvbl, 0, NULL, 0, " ... vector bootloader level, vec # and name"},
{"showdate", &ur.showdate, 0, NULL, 0, " ... last-modified date of flash application"}, {"id", NULL, sizeof ur.iddesc, ur.iddesc, 1, "Location of Urclock ID, eg, F.12345.6"},
{"showfilename", &ur.showfilename, 0, NULL, 0, " ... filename of last uploaded application"}, {"title", NULL, sizeof ur.title, ur.title, 1, "Title stored and shown in lieu of a filename"},
{"bootsize", &ur.xbootsize, 0, NULL, 1, "Manual override for bootloader size"}, {"bootsize", &ur.xbootsize, 0, NULL, 1, "Manual override for bootloader size"},
{"vectornum", &ur.xvectornum, 0, NULL, 1, " ... for vector number"}, // implies vbllevel=1 {"vectornum", &ur.xvectornum, 0, NULL, 1, " ... for vector number"}, // implies vbllevel=1
{"eepromrw", &ur.xeepromrw, 0, NULL, 0, " ... for EEPROM read/write capability"}, {"eepromrw", &ur.xeepromrw, 0, NULL, 0, " ... for EEPROM read/write capability"},
@ -2005,8 +2010,6 @@ static int urclock_parseextparms(const PROGRAMMER *pgm, LISTID extparms) {
{"nodate", &ur.nodate, 0, NULL, 0, " ... application filename and no date either"}, {"nodate", &ur.nodate, 0, NULL, 0, " ... application filename and no date either"},
{"nometadata", &ur.nometadata, 0, NULL, 0, " ... metadata at all (ie, no store support)"}, {"nometadata", &ur.nometadata, 0, NULL, 0, " ... metadata at all (ie, no store support)"},
{"delay", &ur.delay, 0, NULL, 1, "Add delay [ms] after reset, can be negative"}, {"delay", &ur.delay, 0, NULL, 1, "Add delay [ms] after reset, can be negative"},
{"id", NULL, sizeof ur.iddesc, ur.iddesc, 1, "Location of Urclock ID, eg F.12324.6"},
{"title", NULL, sizeof ur.title, ur.title, 1, "Title used in lieu of a filename when set"},
{"help", &help, 0, NULL, 0, "Show this help menu and exit"}, {"help", &help, 0, NULL, 0, "Show this help menu and exit"},
}; };