`GSFC/NGIMS-FSW-27 Alternate Boot Method for Contour/NGIMS Mike Paulkovich November 19, 2001 PRELIMINARY 1. INTRODUCTION Depending upon the status of certain flags in EEPROM (which will be explained later), the NGIMS Flight Software (FSW) v3.6.00 burned into ROM has the capability to bootstrap to RAM from either one of two\ sources: 1) From ROM (run v3.6.00) 2) From EEPROM (the "Alt Boot" to load a new version of the software). Some background information: - There are two EEPROM chips, #0 and #1; all references to the term "EEPROM" in this document refer to EEPROM #0. - The term "ECT Boot" (EEPROM Copy-Table) is used in some documentation and source code; this is identical to Alt Boot. - The source code file that performs the Alt Boot is intvec_firmware.asm. Boot Method (1) (ROM) is illustrated in the Figure 1 below: Figure 1 - Boot from ROM In Figure 1, we see the FSW Load Image being loaded to RAM from ROM. The "AMB Transfer" that is indicated represents Adaptive Memory Block data -- calibration parameters, control tables, etc. that are accessed from RAM and IORAM during normal program execution. This AMB transfer can be set to happen automatically via an EEPROM flag, or manually via the TableUpdate command (refer to the FSW Operator's Manual). Figure 2 below shows a bootstrap from EEPROM ("Alt Boot"). The FSW always copies from ROM to RAM first; then, if the EEPROM flags are set properly, it will perform the "Alt Boot" and reads & decodes the (compressed) load image in EEPROM and transfers to RAM. (The AMB parameters are then loaded the same as Figure 1.) Figure 2 - Boot from EEPROM 2. OPERATION Control over whether the FSW will perform the Alt Boot from EEPROM lies in several EEPROM flags shown below. Refer to GSFC/NGIMS-FSW-020, EEPROM, Interface Control Document ("Ref#" indicators come from that document): Ref# EEPROM Address Flag Meaning AMB-35 2F00 Alt Boot Version# AMB-36 2F01 Alt Boot EEPROM Checksum AMB-43 FFFD Alt Boot Load Counter: decrements to zero on each Alt Boot. Requirements for Alt Boot: - The Alt Boot Version# is a sort of "key" -- this must be within the range 3205h to 4919h or the Alt Boot won't occur. - The Alt Boot EEPROM Checksum must be correct or the Alt Boot won't occur (see below). - The Alt Boot Load Counter must have a value in the range 1..15 for the Alt Boot to occur. Each time an Alt Boot is performed the counter is decremented by FSW. These values may be modified by a simple Patch telecommand to EEPROM-0. Once in place, a TgoBoot telecommand (or power cycle by the S/C) causes the Alt Boot to happen. 2.1 Checksum. The Alt Boot EEPROM Checksum is computed by the FSW on the EEPROM-0 address range from 2F02h to E0FFh inclusive. It is a simple sum of data (unsigned 16-bit addition) in that address range. (That address range was originally chosen and thought to be sufficient, but typical Alt Boot images now extend higher than E0FF, and hence the boot software does not perform the checksum on all of the image data, but this does not invalidate the method.) 3. ALT BOOT IMAGE FORMAT The Alt Boot image may be uploaded to EEPROM via Patch telecommands to EEPROM-0. The FSW expects that the Alt Boot image consist of two data blocks in EEPROM, the "FAT" (File Allocation Table) and the Data segment: Ref# EEPROM Address (h) Flag Meaning AMB-37 2F02..XXXX Alt Boot "FAT", 5 words for each block. <256 required for load image; 5*256 added for up to 256 patches. n/a XXXX..3501 Spare area above FAT. Typically "XXXX" = ~3000h. Note that the Alt Boot checksum computed includes this "unused" area. AMB-38 3502+ Data Segment: FSW Alt Boot Load Image (typically to ~E500 but can go as high as FFFC). Note that after an Alt Boot image is generated and uploaded, additional patches can be added by specifying the address range in the FAT segment (and, of course, loading the data to the data segment). This two-part Alt Boot image incorporates simple zero-run compression. The general format comes from the MAP spacecraft. The Alt Boot copy table FAT consists Groups of 5 words each describing each Data segment: word 0 descriptor code word 1 not used word 2 EEPROM address (ignored by FSW if descriptor code not =1) word 3 RAM address word 4 word count The FAT segment must be uploaded to EEPROM starting at address 2F02h. The start of the Alt Boot data segment is "pointed to" by the FAT, so technically, it can be variable. It is currently set to 3502h (thus allowing for new patches), and the end of data could theoretically extend as high as FFFC. Since the load image is a zero-run compressed version of a 64KW program, the required amount of EEPROM to hold a "random" program image can't be determined, but this allocated space has been more than sufficient to date. Descriptor Codes: 0 = End the copy table. 1 = Copy from EEPROM to code RAM. 3 = Fill code RAM with a fill word. EEPROM page and address are ignored. Fill data =0. 4. MAKING AN ALT BOOT LOAD IMAGE Two tools exist to create an Alt Boot image. Only one has been used to date. The detailed process is provided in file process.text on the FSW development computer and will be transferred to this document once a final procedure has been determined. This is a work in progress. 5. LESSONS LEARNED AND WORKAROUNDS 5.1 Alt Boot Failure Not long after the FSW was burned into ROM, it was realized that if the bootstrap does not perform an Alt Boot, the "reason" for not doing so basically can not be determined. The lesson learned was that a simple log should be maintained, giving the "history" of steps taken in the Alt Boot attempt, and stored in RAM so that it can be dumped and analyzed post-hoc: Version Number assessment Load Counter check Checksum computation and comparison. A better implementation would have stored into RAM the highest "step number" that was performed, along with the computed checksum. Workarounds exist: a. Alter the Alt Boot segment of code in RAM via patch to not execute the switch to ROM mode; change code as desired, and jump to the Alt Boot code. The Alt Boot is thus performed in RAM mode using the altered bootstrap. (Implementation Note: the jump to Alt Boot code in intvec_firmware.asm would be to either label Altboot_CopyTable, or after the XIO/ESUR instruction just after R8LOOP.) b. Dump EEPROM to telemetry, and compute the checksum on the Alt Boot range. Then upload the correct checksum to EEPROM. 2. Alt Boot Checksum Range The range 2F02h to E0FFh (see 2.1 above) doesn't cover the full range in EEPROM where a typical enhanced NGIMS FSW image would reside. There is a possible trick to try. Default PROM values for AMB parameters are "meaningless" in an Alt Boot load, because if EEPROM-0 is valid, then the AMB Table Load would most certainly be used (as opposed to the default values) because EEPROM-0 contains both AMB parameters and the Alt Boot load image. Thus, instead of building the Alt Boot image by including the default PROM AMB overlays, Implementation note: This means simply removing (remark-out) one line in intvec_firmware.asm: include "amb_prom_defaults_firmware.asm" In this way, the AMB defaults would be all zeroes, which represents some ~4200 or so words (which thus become, instead, one block of 5 "fill" words in the resultant zero-run "compressed" image). This ~4200 word reduction may bring the compressed load image for future enhanced FSW versions down to a size within the 2F02h to E0FFh range that is check-summed. The benefits, while somewhat minor, are that: (1) the load image is smaller, and (2) there is improved error detection. Page 1