EIR-OPS-017: Rewrite Payload Firmware
Objective
To write firmware to the GMOD/EMOD MSP.
Introduction
Using this procedure, the Operator will write a new firmware image to the GMOD/EMOD MSP.
Tip
This procedure is written using GMOD as the example. For all steps where GMOD is mentioned, identical steps can be carried out for the EMOD MSP (e.g. for the SCDB Action/Param path payload.GMOD.FirmwareVersion, simply use payload.EMOD.FirmwareVersion to access the EMOD MSP firmware version.
Procedure
This procedure has the following subsections:
Note
A communication window is required for Sections B - D of this procedure.
A. Pre-pass Preparations
A.1.
Prior to the first pass in which Section B is followed, the Operators must ensure they have access to:
The length of the image in rows (needed for Steps B.15, B.16 and C.5), and
The CRC of the image (Step B.17).
Note
As this image is already stored in the OBC’s flash memory at this time, no image file or image uplink is required for this procedure.
A.2.
If not already known, the Operators should now consult with the Software Engineer to determine:
The version of the current firmware programmed onto the MSP (needed for Step B.4),
Whether this firmware is expected to respond to I2C commands (Step B.4),
The ID of the OBC flash storage channel that holds the new firmware to be programmed onto the MSP (Step B.11), and
The version of the new firmware to be programmed onto the MSP (Step D.1).
B. Rewrite Preparations
Important
You are about to send the first TC of this procedure - Have you completed the EIR-OPS-003: Start a Communication Pass procedure? A Communication Pass must be started prior to carrying out the operations planned for the pass. Don’t forget to open and set-up the parameters/actions that will be required before the pass starts!
B.1.
Gettheplatform.EPS.actualSwitchStatesparameter, withFirst row= 0 andLast row= 9.If reprogramming GMOD, assess the status of rows 2, 5 and 8 of this parameter (i.e. PDMs 3, 6 and 9). If reprogramming EMOD, assess row 9 (i.e. PDM 10).
If 1 is returned for these rows/PDMs, the MSP is on.
Warning
PDM 8 (i.e. row 7 of this parameter) is drawing parasitic power. Therefore, when you Get the platform.EPS.actualSwitchStates parameter it will always read as on/1 even when it is powered off.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
Yes |
Data Size |
2 bytes, 2 bytes |
Data Info |
|
Allowed Value(s) |
0-9, 0-9 |
Expected Value(s) |
0, 9 |
TM Details |
|
Data Expected from TC |
|
Data Size |
List[0:9] of Booleans |
Data Info |
SwitchState = 0 (Off), SwitchState = 1 (On) |
Allowed Value(s) |
0 or 1 for each switch |
B.2.
If the above step shows that the MSP is on, proceed to Step B.4.
Else, if one or more of the MSP’s PDMs are powered off,
Invoketheplatform.EPS.TurnOnGMODaction. If reprogramming EMOD, instead use theplatform.EPS.TurnOnEMODaction.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
B.3.
To confirm that the MSP is now powered on,
Gettheplatform.EPS.actualSwitchStatesparameter, withFirst row= 0 andLast row= 9.If reprogramming GMOD, ensure that rows 2, 5 and 8 of this parameter (i.e. PDMs 3, 6 and 9) now equal 1. If reprogramming EMOD, instead confirm row 9 (i.e. PDM 10) equals 1.
Warning
PDM 8 (i.e. row 7 of this parameter) is drawing parasitic power. Therefore, when you Get the platform.EPS.actualSwitchStates parameter it will always read as on/1 even when it is powered off.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
Yes |
Data Size |
2 bytes, 2 bytes |
Data Info |
|
Allowed Value(s) |
0-9, 0-9 |
Expected Value(s) |
0, 9 |
TM Details |
|
Data Expected from TC |
|
Data Size |
List[0:9] of Booleans |
Data Info |
SwitchState = 0 (Off), SwitchState = 1 (On) |
Allowed Value(s) |
0 or 1 for each switch |
Expected Value(s) |
GMOD on: XX1XX1XX1X, EMOD on: XXXXXXXX1 |
B.4.
If it was determined in Section A that the firmware currently running on the MSP is non-responsive, skip ahead to Step B.8.
Else,
Getthepayload.GMOD.FirmwareVersionparameter.Ensure the firmware version returned matches what was expected from Section A.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
2 bytes (3 bytes for |
Data Info |
The version of the firmware currently on the MSP |
Allowed Value(s) |
0000 - FFFF (000000 - FFFFFF for |
Expected Value(s) |
Firmware version from Section A |
B.5.
Getthepayload.GMOD.GMODModeparameter to assess which mode the firmware currently running on the MSP is operating in.
Warning
The ADM firmware does not have modes. Therefore, if you are intending to overwrite ADM firmware on the EMOD MSP with EMOD experiment firmware skip ahead to Step B.8.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
1 byte |
Data Info |
Payload operational mode |
Allowed Value(s) |
See table below |
Where…
Firmware |
|
Mode |
|---|---|---|
GMOD |
1 |
Idle |
GMOD |
2 |
Experiment |
GMOD |
3 |
CPLD |
GMOD |
4 |
Safe |
EMOD |
0 |
Idle |
EMOD |
1 |
Experiment |
B.6.
If the
payload.GMOD.GMODModeparameter indicates that Idle Mode is on-going, skip ahead to Step B.8.Else, now
SettheGMODModeparameter to Idle Mode (i.e. ‘1’ for GMOD. ‘0’ for EMOD)
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
Yes |
Data Size |
1 byte |
Data Info |
The mode to set EMOD to |
Allowed Value(s) |
0-1 |
Expected Value(s) |
1 (0 for |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
B.7.
Confirm the
Setin the previous step with aGet(i.e. confirm the value was set successfully).
B.8.
Gettheplatform.obc.GMODSerial.baudRateParamparameter.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
4 bytes |
Data Info |
The baud rate used for GMOD serial communications |
Allowed Value(s) |
00000000 - FFFFFFFF (hex) |
B.9.
Note
When the firmware on the MSP is operating in an experiment mode, the serial port is used for science data transfer and does this at a high baud rate (i.e. 128000 baud for GMOD and 125000 baud for EMOD). However, a lower baud rate of 9600 Baud is required for reprogramming the MSP.
Settheplatform.obc.GMODSerial.baudRateParamparameter to 9600 (decimal).
Warning
The Operator should be aware of the fact that multiple different SCDB paths are used for this procedure (i.e. payload.GMOD, platform.obc.GMODSerial and payload.FirmwareImageAccess). However, this is not a major concern as it will become obvious if an SCDB is mistaken as the parameter/action will only exist in the correct SCDB path.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
Yes |
Data Size |
4 bytes |
Data Info |
The desired baud rate for GMOD serial communications |
Allowed Value(s) |
00000000 - FFFFFFFF (hex) |
Expected Value(s) |
9600 (dec) / 0x2580 (hex) |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
B.10.
Confirm the
Setin the previous step with aGet(i.e. confirm the value was set successfully).
B.11.
To programme an image from the OBC onto the MSP, the desired image must first be loaded from an OBC flash storage channel to a buffer. To start this process, first
Setthepayload.FirmwareImageAccess.ImageStorageChIDparameter to match the storage channel ID identified in Section A.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
Yes |
Data Size |
2 bytes |
Data Info |
ID of the storage channel from where the firmware is to be loaded |
Allowed Value(s) |
0000 - FFFF (hex) |
Expected Value(s) |
Flash channel ID from Section A |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
B.12.
Confirm the
Setin the previous step with aGet(i.e. confirm the value was set successfully).
B.13.
Next
Invokethepayload.FirmwareImageAccess.ClearImageBufferaction to clear any previous data being held in the buffer.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
B.14.
To verify that the buffer is now cleared/empty,
Querythepayload.FirmwareImageAccess.ImageBufferparameter.Ensure that 0 (rows) is returned.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
Rows ( + ACK ) |
Data Size |
2 bytes |
Data Info |
The number of rows of data in the buffer |
Allowed Value(s) |
0000 - FFFF (Hex) |
Expected Value |
0 |
B.15.
Warning
MCS does not allow the Operator to provide a decimal action argument for the action in this step. Operators will need to input the action argument in hexadecimal format.
Invokethepayload.FirmwareImageAccess.LoadImageFromStorageaction with the input argument,Last row= the size of the image in rows - 1 (refer to Section A for the size of the image in rows).
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
Yes |
Data Size |
2 bytes |
Data Info |
|
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
B.16.
Again
Querythepayload.FirmwareImageAccess.ImageBufferparameter.This time, ensure that the data returned = the size of the image in rows (refer to Section A for the size of the image in rows).
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
Rows ( + ACK ) |
Data Size |
2 bytes |
Data Info |
The number of rows of data in the buffer |
Allowed Value(s) |
0000 - FFFF (Hex) |
Expected Value |
The size of the image in rows from Section A |
B.17.
To further verify the image is now correctly loaded into the buffer,
Getthepayload.FirmwareImageAccess.ImageCRCparameter.Ensure that the data returned is equal to the CRC from Section A.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
4 bytes |
Data Info |
CRC for the data currently being held in the |
Allowed Value(s) |
00000000 - FFFFFFFF (hex) |
Expected Value(s) |
Image CRC from Section A |
C. Reprogramming the MSP
C.1.
Getthepayload.GMOD.LineNoLastProgrammedparameter.Ensure that 0 is returned.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
2 bytes |
Data Info |
Line number last programmed from the OBC to the MSP |
Allowed Value(s) |
0000 - FFFF (hex) |
Expected Value(s) |
0 |
C.2.
Invokethepayload.GMOD.FirmwareReprogrammeaction to first erase the firmware currently on the MSP.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
C.3.
Wait ~10 seconds to allow the firmware on the MSP to be erased.
C.4.
Invokethepayload.GMOD.FirmwareReprogrammeaction again to now programme the data in thepayload.FirmwareImageAccess.ImageBufferto the MSP.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
C.5.
Getand continue toGetthepayload.GMOD.LineNoLastProgrammedparameter until the data returned = the size of the image in rows (determined in Section A).
Note
The reprogramming will take ~minutes. At the end of the reprogramming process, the MSP will automatically be reset and will be ready for Image Verification (Section D).
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
2 bytes |
Data Info |
Line number last programmed from the OBC to the MSP |
Allowed Value(s) |
0000 - FFFF (hex) |
Expected Value(s) |
Increasing until equal to the size of the image in rows from Section A |
D. Image Verification
D.1.
Getthepayload.GMOD.FirmwareVersionparameter.Ensure that:
The firmware version has updated from Step B.4, and
The firmware version matches that determined in Section A.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Data Expected with TC |
No |
TM Details |
|
Data Expected from TC |
|
Data Size |
2 bytes (3 bytes for |
Data Info |
The version of the firmware currently on the MSP |
Allowed Value(s) |
0000 - FFFF (000000 - FFFFFF for |
Expected Value(s) |
NEW firmware version from Section A |
E. Post-Programming
E.1.
Note
When the firmware on the MSP is operating in an experiment mode, the serial port is used for science data transfer and does this at a high baud rate (i.e. 128000 baud for GMOD and 125000 baud for EMOD). However, a lower baud rate of 9600 Baud is required for reprogramming the MSP.
Settheplatform.obc.GMODSerial.baudRateParamparameter to 128 KBaud (decimal). For the EMOD experiment, data transfer over serial occurs at 125 Kbaud (decimal).
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Action/Param ID |
1222 |
Data Expected with TC |
Yes |
Data Size |
4 bytes |
Data Info |
the desired baud rate |
Allowed Value(s) |
00000000 - FFFFFFFF (hex) |
Expected Value(s) |
128000 (dec) |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
E.2.
Confirm the
Setin the previous step with aGet(i.e. confirm the value was set successfully).
E.3.
In preparation for the next reprogramming,
Setthepayload.GMOD.LineNoLastProgrammedparameter to 0.
TC Details |
|
MCS Operation |
|
Action/Param Name |
|
Action/Param ID |
1222 |
Data Expected with TC |
Yes |
Data Size |
2 bytes |
Data Info |
Line number last programmed from the OBC to the MSP |
Allowed Value(s) |
0000 - FFFF (hex) |
Expected Value(s) |
0 |
TM Details |
|
Data Expected from TC |
No ( + ACK ) |
E.4.
Confirm the
Setin the previous step with aGet(i.e. confirm the value was set successfully).
END OF PROCEDURE