30 #if !defined(__COMMAND_PACKET_H__) 31 #define __COMMAND_PACKET_H__ 33 #include "bootloader_common.h" 45 kMinPacketBufferSize = 32,
46 kDefaultMaxPacketSize = kMinPacketBufferSize,
48 (kMinPacketBufferSize /
sizeof(uint32_t)) - 2,
52 (kMinPacketBufferSize /
sizeof(uint32_t)) - 3,
60 kCommandTag_GenericResponse = 0xa0,
61 kCommandTag_FlashEraseAll = 0x01,
62 kCommandTag_FlashEraseRegion = 0x02,
63 kCommandTag_ReadMemory = 0x03,
64 kCommandTag_ReadMemoryResponse = 0xa3,
65 kCommandTag_WriteMemory = 0x04,
66 kCommandTag_FillMemory = 0x05,
67 kCommandTag_FlashSecurityDisable = 0x06,
68 kCommandTag_GetProperty = 0x07,
69 kCommandTag_GetPropertyResponse = 0xa7,
70 kCommandTag_ReceiveSbFile = 0x08,
71 kCommandTag_Execute = 0x09,
72 kCommandTag_Call = 0x0a,
73 kCommandTag_Reset = 0x0b,
74 kCommandTag_SetProperty = 0x0c,
75 kCommandTag_FlashEraseAllUnsecure = 0x0d,
76 kCommandTag_FlashProgramOnce = 0x0e,
77 kCommandTag_FlashReadOnce = 0x0f,
78 kCommandTag_FlashReadOnceResponse = 0xaf,
79 kCommandTag_FlashReadResource = 0x10,
80 kCommandTag_FlashReadResourceResponse = 0xb0,
81 kCommandTag_ConfigureQuadSpi = 0x11,
82 kCommandTag_ReliableUpdate = 0x12,
84 kCommandTag_ConfigureI2c = 0xc1,
100 kCommandFlag_None = 0,
101 kCommandFlag_HasDataPhase = 1
107 kFlashMemInternal = 0,
108 kFlashMemQuadSpi0 = 1,
109 kFlashMemExecuteOnly = 0x10
113 typedef struct CommandPacket
125 typedef struct FlashEraseAllPacket
132 typedef struct FlashEraseRegionPacket
140 typedef struct GetPropertyPacket
148 typedef struct SetPropertyPacket
156 typedef struct ReceiveSbFilePacket
163 typedef struct WriteMemoryPacket
171 typedef struct ReadMemoryPacket
179 typedef struct FillMemoryPacket
191 typedef struct ExecuteCallPacket
200 typedef struct FlashSecurityDisablePacket
208 typedef struct ProgramOncePacket
217 typedef struct ReadOncePacket
225 typedef struct FlashReadResourcePacket
234 typedef struct ConfigureQuadSpiPacket
242 typedef struct ReliableUpdatePacket
250 typedef struct ConfigureI2cPacket
258 typedef struct ConfigureSpiPacket
268 typedef struct ConfigureCanPacket
282 typedef struct GenericResponsePacket
290 typedef struct GetPropertyResponsePacket
298 typedef struct ReadMemoryResponsePacket
306 typedef struct FlashReadOnceResponsePacket
315 typedef struct FlashReadResourceResponsePacket
326 #endif // __COMMAND_PACKET_H__ uint32_t phase
Parameter 2: phase.
Definition: command_packet.h:263
uint32_t dataByteCount
parameter 1
Definition: command_packet.h:302
ReliableUpdate packet format.
Definition: command_packet.h:242
uint32_t propertyValue
Parameter 1: value to set.
Definition: command_packet.h:152
Mask for the high nibble of a command tag that identifies it as a response command.
Definition: command_packet.h:93
_command_tags
Commands codes.
Definition: command_packet.h:58
Read Memory response packet format.
Definition: command_packet.h:298
uint32_t keyLow
Paremeter 0: key bytes 0-3.
Definition: command_packet.h:203
uint32_t byteCount
Parameter 1: number of bytes.
Definition: command_packet.h:136
ReadMemory packet format.
Definition: command_packet.h:171
uint32_t commandTag
parameter 1
Definition: command_packet.h:286
ReceiveSbFile packet format.
Definition: command_packet.h:156
Definition: command_packet.h:47
_flash_mem_id
Flash memory identifiers.
Definition: command_packet.h:105
uint32_t callAddress
Paremeter 0: function address.
Definition: command_packet.h:194
WriteMemory packet format.
Definition: command_packet.h:163
uint32_t option
Parameter 2: option for flash read resource command.
Definition: command_packet.h:230
uint32_t argumentWord
Parameter 1: argument.
Definition: command_packet.h:195
Command packet format.
Definition: command_packet.h:113
GetProperty packet format.
Definition: command_packet.h:140
uint8_t commandTag
A command tag.
Definition: command_packet.h:115
Get Property response packet format.
Definition: command_packet.h:290
FlashEraseAll packet format.
Definition: command_packet.h:125
uint32_t rxid
Parameter 2: rxid.
Definition: command_packet.h:273
uint32_t keyHigh
Parameter 1: key bytes 4-7.
Definition: command_packet.h:204
Generic response packet format.
Definition: command_packet.h:282
FlashReadOnce packet format.
Definition: command_packet.h:217
Reserved command tag for Bus Pal.
Definition: command_packet.h:88
command_packet_t commandPacket
header
Definition: command_packet.h:127
Reserved command tag for Bus Pal.
Definition: command_packet.h:85
uint32_t status
parameter 0
Definition: command_packet.h:285
uint32_t speed
Parameter 1: speed.
Definition: command_packet.h:254
One word is header, two parameters reserved for index and byteCount.
Definition: command_packet.h:54
Flash Read Once response packet format.
Definition: command_packet.h:306
uint32_t configBlockAddress
Parameter 1: address of config block to use.
Definition: command_packet.h:238
_command_packet_constants
Command/Data Packet constants.
Definition: command_packet.h:43
Flash Read Resource response packet format.
Definition: command_packet.h:315
Reserved command tag for Bus Pal.
Definition: command_packet.h:86
uint32_t flashMemId
Parameter 0: quadspi ID.
Definition: command_packet.h:237
FlashEraseRegion packet format.
Definition: command_packet.h:132
Maximum linearly incrementing command tag value, excluding the response commands and bus pal commands...
Definition: command_packet.h:91
uint32_t startAddress
Paremeter 0: start address.
Definition: command_packet.h:135
_command_packet_flags
Command packet flags.
Definition: command_packet.h:98
uint32_t index
Parameter 0: index of pragram once field.
Definition: command_packet.h:211
FlashProgramOnce packet format.
Definition: command_packet.h:208
Execute/Call packet format.
Definition: command_packet.h:191
Definition: command_packet.h:51
FlashReadResource packet format.
Definition: command_packet.h:225
uint8_t flags
Combination of packet flags.
Definition: command_packet.h:116
uint32_t memoryId
Paremeter 0: Flash memory identifiers.
Definition: command_packet.h:128
uint8_t parameterCount
Number of parameters that follow in buffer.
Definition: command_packet.h:118
uint32_t polarity
Parameter 1: polarity.
Definition: command_packet.h:262
FillMemory packet format.
Definition: command_packet.h:179
uint32_t patternWord
Parameter 1: pattern word.
Definition: command_packet.h:184
uint32_t txid
Parameter 1: txid.
Definition: command_packet.h:272
uint32_t address
Definition: command_packet.h:245
uint32_t speedKhz
Parameter 0: spped Khz.
Definition: command_packet.h:261
SetProperty packet format.
Definition: command_packet.h:148
status_t(* call_function_t)(uint32_t)
Execute/Call command function pointer definition.
Definition: command_packet.h:188
uint32_t stackpointer
Parameter 2: stack pointer.
Definition: command_packet.h:196
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:121
FlashSecurityDisable packet format.
Definition: command_packet.h:200
uint32_t direction
Parameter 3: directionpolarity.
Definition: command_packet.h:264
uint32_t propertyTag
Parameter 0: requested property tag.
Definition: command_packet.h:143
uint8_t reserved
Reserved, helpful for alignment, set to zero.
Definition: command_packet.h:117