Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion config/default_mm_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,24 @@ typedef struct {
applicable */
} MM_HkTlm_Payload_t;

/**
* \brief Peek Packet Payload
*/
typedef struct {
MM_MemType_Enum_t MemType; /**< \brief Memory type */
uint32 DataValue; /**< \brief Data from peek */
MM_MemAddress_t Address; /**< \brief Fully resolved address */
MM_MemSize_t BytesProcessed; /**< \brief Bytes processed */
} MM_PeekPacket_Payload_t;

/**
* \brief Symbol Lookup Packet Payload
*/
typedef struct {
char SymName[CFE_MISSION_MAX_API_LEN]; /**< \brief Symbol name */
MM_MemAddress_t Address; /**< \brief Fully resolved address */
} MM_SymLookupPacket_Payload_t;

#endif /* DEFAULT_MM_MSGDEFS_H */

/**\}*/
/**\}*/
2 changes: 2 additions & 0 deletions config/default_mm_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
*/

#define MM_HK_TLM_MID MM_TLM_PLATFORM_MIDVAL(HK_TLM)
#define MM_PEEK_TLM_MID MM_TLM_PLATFORM_MIDVAL(PEEK_TLM)
#define MM_SYM_LOOKUP_TLM_MID MM_TLM_PLATFORM_MIDVAL(SYM_LOOKUP)

#endif /* DEFAULT_MM_MSGIDS_H */

Expand Down
18 changes: 17 additions & 1 deletion config/default_mm_msgstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,22 @@ typedef struct {
CFE_MSG_TelemetryHeader_t TelemetryHeader;
} MM_SendHkCmd_t;

/**
* \brief Symbol Lookup Packet Structure
*/
typedef struct {
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
MM_SymLookupPacket_Payload_t Payload; /**< \brief Symbol Lookup Packet Payload */
} MM_SymLookupPacket_t;

/**
* \brief Peek Packet Structure
*/
typedef struct {
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief Telemetry header */
MM_PeekPacket_Payload_t Payload; /**< \brief Peek Packet Payload */
} MM_PeekPacket_t;

#endif /* DEFAULT_MM_MSGSTRUCT_H */

/**\}*/
/**\}*/
2 changes: 1 addition & 1 deletion docs/mm_FunctionalRequirements.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ b) length of data written
c) value of the data written
",Confirms memory poke operations
MM2000.2,MM2000.2,"When MM receives a Poke command, if the data size is not 8, 16, or 32 bits, MM shall reject the command.",Ensure writes happen at 8-bit boundaries
MM2002,MM2002,"Upon receipt of a Peek command, MM shall read 8, 16, or 32 bits of data from the command-specified RAM address and telemeter the following information in the HK packet + issue an event message containing:
MM2002,MM2002,"Upon receipt of a Peek command, MM shall read 8, 16, or 32 bits of data from the command-specified RAM address and telemeter the following information in the HK and Peek packet + issue an event message containing:
a) address read
b) length of data read
c) value of the data read
Expand Down
46 changes: 45 additions & 1 deletion eds/mm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@
</EntryList>
</ContainerDataType>

<ContainerDataType name="PeekPacket_Payload" shortDescription="Peek Packet Payload">
<EntryList>
<Entry name="MemType" type="MemType" shortDescription="Memory type"/>
<Entry name="DataValue" type="BASE_TYPES/uint32" shortDescription="Data from peek"/>
<Entry name="Address" type="MemAddress" shortDescription="Fully resolved address"/>
<Entry name="BytesProcessed" type="MemSize" shortDescription="Bytes processed"/>
</EntryList>
</ContainerDataType>

<ContainerDataType name="SymLookupPacket_Payload" shortDescription="Symbol Lookup Packet Payload">
<EntryList>
<Entry name="SymName" type="SymName" shortDescription="Symbol Name"/>
<Entry name="Address" type="MemAddress" shortDescription="Fully resolved address"/>
</EntryList>
</ContainerDataType>

<!-- COMMANDS -->

<ContainerDataType name="CommandBase" baseType="CFE_HDR/CommandHeader"/>
Expand Down Expand Up @@ -343,6 +359,18 @@
<Entry type="HkTlm_Payload" name="Payload"/>
</EntryList>
</ContainerDataType>

<ContainerDataType name="PeekPacket" baseType="CFE_HDR/TelemetryHeader">
<EntryList>
<Entry type="PeekPacket_Payload" name="Payload"/>
</EntryList>
</ContainerDataType>

<ContainerDataType name="SymLookupPacket" baseType="CFE_HDR/TelemetryHeader">
<EntryList>
<Entry type="SymLookupPacket_Payload" name="Payload"/>
</EntryList>
</ContainerDataType>
</DataTypeSet>

<ComponentSet>
Expand All @@ -365,22 +393,38 @@
<GenericTypeMap name="TelemetryDataType" type="HkTlm" />
</GenericTypeMapSet>
</Interface>

<Interface name="PEEK_TLM" shortDescription="Memory peek telemetry interface" type="CFE_SB/Telemetry">
<GenericTypeMapSet>
<GenericTypeMap name="TelemetryDataType" type="PeekPacket" />
</GenericTypeMapSet>
</Interface>

<Interface name="SYM_LOOKUP" shortDescription="Symbol lookup telemetry interface" type="CFE_SB/Telemetry">
<GenericTypeMapSet>
<GenericTypeMap name="TelemetryDataType" type="SymLookupPacket" />
</GenericTypeMapSet>
</Interface>
</RequiredInterfaceSet>

<Implementation>
<VariableSet>
<Variable type="BASE_TYPES/uint16" readOnly="true" name="CmdTopicId" initialValue="${CFE_MISSION/MM_CMD_TOPICID}"/>
<Variable type="BASE_TYPES/uint16" readOnly="true" name="SendHkTopicId" initialValue="${CFE_MISSION/MM_SEND_HK_TOPICID}"/>
<Variable type="BASE_TYPES/uint16" readOnly="true" name="HkTlmTopicId" initialValue="${CFE_MISSION/MM_HK_TLM_TOPICID}"/>
<Variable type="BASE_TYPES/uint16" readOnly="true" name="PeekTlmTopicId" initialValue="${CFE_MISSION/MM_PEEK_TLM_TOPICID}"/>
<Variable type="BASE_TYPES/uint16" readOnly="true" name="SymLookupTopicId" initialValue="${CFE_MISSION/MM_SYM_LOOKUP_TOPICID}"/>
</VariableSet>

<ParameterMapSet>
<ParameterMap interface="CMD" parameter="TopicId" variableRef="CmdTopicId" />
<ParameterMap interface="SEND_HK" parameter="TopicId" variableRef="SendHkTopicId" />
<ParameterMap interface="HK_TLM" parameter="TopicId" variableRef="HkTlmTopicId" />
<ParameterMap interface="PEEK_TLM" parameter="TopicId" variableRef="PeekTlmTopicId" />
<ParameterMap interface="SYM_LOOKUP" parameter="TopicId" variableRef="SymLookupTopicId" />
</ParameterMapSet>
</Implementation>
</Component>
</ComponentSet>
</Package>
</PackageFile>
</PackageFile>
8 changes: 7 additions & 1 deletion fsw/inc/mm_topicids.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@
#define MM_MISSION_HK_TLM_TOPICID MM_MISSION_TIDVAL(HK_TLM)
#define DEFAULT_MM_MISSION_HK_TLM_TOPICID 0x87

#endif /* MM_TOPICIDS_H */
#define MM_MISSION_PEEK_TLM_TOPICID MM_MISSION_TIDVAL(PEEK_TLM)
#define DEFAULT_MM_MISSION_PEEK_TLM_TOPICID 0x88

#define MM_MISSION_SYM_LOOKUP_TOPICID MM_MISSION_TIDVAL(SYM_LOOKUP)
#define DEFAULT_MM_MISSION_SYM_LOOKUP_TOPICID 0x89

#endif /* MM_TOPICIDS_H */
11 changes: 11 additions & 0 deletions fsw/src/mm_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ CFE_Status_t MM_AppInit(void) {
CFE_MSG_Init(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader),
CFE_SB_ValueToMsgId(MM_HK_TLM_MID), sizeof(MM_HkTlm_t));

/*
** Initialize the local peek telemetry packet (clear user data area)
*/
CFE_MSG_Init(CFE_MSG_PTR(MM_AppData.PeekPacket.TlmHeader), CFE_SB_ValueToMsgId(MM_PEEK_TLM_MID), sizeof(MM_PeekPacket_t));

/*
** Initialize the local symbol lookup telemetry packet (clear user data area)
*/
CFE_MSG_Init(CFE_MSG_PTR(MM_AppData.SymLookupPacket.TlmHeader), CFE_SB_ValueToMsgId(MM_SYM_LOOKUP_TLM_MID), sizeof(MM_SymLookupPacket_t));


/*
** Create Software Bus message pipe
*/
Expand Down
6 changes: 5 additions & 1 deletion fsw/src/mm_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
typedef struct {
MM_HkTlm_t HkTlm; /**< \brief Housekeeping telemetry packet */

MM_SymLookupPacket_t SymLookupPacket; /**< \brief Symbol lookup telemetry packet */

MM_PeekPacket_t PeekPacket; /**< \brief Memory peek telemetry packet */

CFE_SB_PipeId_t CmdPipe; /**< \brief Command pipe ID */

uint32 RunStatus; /**< \brief Application run status */
Expand Down Expand Up @@ -108,4 +112,4 @@ void MM_AppMain(void);
*/
CFE_Status_t MM_AppInit(void);

#endif
#endif
7 changes: 7 additions & 0 deletions fsw/src/mm_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg) {
CFE_EVS_SendEvent(MM_SYM_LOOKUP_INF_EID, CFE_EVS_EventType_INFORMATION,
"Symbol Lookup Command: Name = '%s' Addr = %p", SymName,
(void *)ResolvedAddr);

/* Update Symbol Look Up Tlm */
strncpy(MM_AppData.SymLookupPacket.Payload.SymName, SymName, sizeof(MM_AppData.SymLookupPacket.Payload.SymName));

MM_AppData.SymLookupPacket.Payload.Address = ResolvedAddr;
CFE_SB_TimeStampMsg(CFE_MSG_PTR(MM_AppData.SymLookupPacket.TlmHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(MM_AppData.SymLookupPacket.TlmHeader), true);
} else {
MM_AppData.HkTlm.Payload.ErrCounter++;
CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
Expand Down
9 changes: 9 additions & 0 deletions fsw/src/mm_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress) {
"Peek Command: Addr = %p Size = %u bits Data = 0x%08X",
(void *)SrcAddress, (unsigned int)DataSize,
(unsigned int)DataValue);

/* Update Peek TLM Packet */
MM_AppData.PeekPacket.Payload.MemType = CmdPtr->Payload.MemType;
MM_AppData.PeekPacket.Payload.Address = SrcAddress;
MM_AppData.PeekPacket.Payload.BytesProcessed = BytesProcessed;
MM_AppData.PeekPacket.Payload.DataValue = DataValue;

CFE_SB_TimeStampMsg(CFE_MSG_PTR(MM_AppData.PeekPacket.TlmHeader));
CFE_SB_TransmitMsg(CFE_MSG_PTR(MM_AppData.PeekPacket.TlmHeader), true);
} else {
CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
"PSP read memory error: RC=%d, Address=%p, MemType=MEM%u",
Expand Down
Loading