summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxmarvla <vlatko.markovic@seavus.com>2011-06-16 14:45:38 +0100
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2011-08-17 22:10:43 +0200
commitb9b4df06ddb81a6d14354fc0d42e22acf0b4c30c (patch)
tree48b17930f3f28c72094f090ba38e6761aa43416b
parentc9d1f9613e3ac18d5dd3b9432646e289bb88cec9 (diff)
LCM R1T and LCDriver R1N official release.
ST-Ericsson ID: 345044 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204 Change-Id: Ib1901abfc2efa6c887c70b8583ddd2258e21aa78 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25187 Tested-by: Vlatko STENKOSKI Tested-by: Cvetko MLADENOVSKI <cvetko.mladenovski@seavus.com> Tested-by: Aleksandar GASOSKI <aleksandar.gasoski@seavus.com> Reviewed-by: Zoran ANCEVSKI <zoran.ancevski@seavus.com> Reviewed-by: QATEST Reviewed-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com> Conflicts: lcmodule/win_binaries/LCM.dll win_binaries/LCDriver_CNH1606432.dll
-rwxr-xr-x[-rw-r--r--]lcmodule/source/LCM.rc6
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h4
-rwxr-xr-xlcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h4
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h5
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_protocol.c4
-rwxr-xr-xlcmodule/source/cnh1605204_ldr_transport_layer/source/a2_speedflash.c14
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c2
-rw-r--r--lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c2
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_header.h4
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_network.h4
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/r_r15_header.h6
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/t_a2_network.h6
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/t_protrom_network.h2
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_network_layer.h6
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/source/a2_network.c83
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/source/protrom_network.c91
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/source/r15_network_layer.c156
-rw-r--r--lcmodule/source/cnh1605205_ldr_network_layer/source/z_network.c35
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/debug_subsystem/r_debug_subsystem.h29
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h12
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/include/r_memory_utils.h (renamed from lcmodule/source/cnh1605551_ldr_utilities/include/r_memmory_utils.h)5
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/include/r_queue.h22
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/include/r_serialization.h35
-rw-r--r--lcmodule/source/cnh1605551_ldr_utilities/source/serialization.c188
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml672
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl6
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl16
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml65
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h6
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h11
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h25
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c16
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c42
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c2
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c18
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c24
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c8
-rw-r--r--lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c2
-rw-r--r--lcmodule/source/resource.h2
-rw-r--r--lcmodule/test_cases/ADbg_cnh1606344.c2
-rwxr-xr-x[-rw-r--r--]source/LCDriver.rc6
-rw-r--r--source/LCDriverMethods.cpp6
-rw-r--r--source/LCM/include/error_codes.h138
-rw-r--r--source/LCM/include/t_communication_service.h25
-rw-r--r--source/LCM/include/t_protrom_network.h2
-rw-r--r--source/LCM/include/t_r15_network_layer.h6
-rw-r--r--source/resource.h2
47 files changed, 1062 insertions, 765 deletions
diff --git a/lcmodule/source/LCM.rc b/lcmodule/source/LCM.rc
index 57344f6..b011c38 100644..100755
--- a/lcmodule/source/LCM.rc
+++ b/lcmodule/source/LCM.rc
@@ -69,16 +69,16 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "Comments", "Build date: 2011-06-15"
+ VALUE "Comments", "Build date: 2011-06-16"
VALUE "CompanyName", "ST Ericsson AB"
VALUE "FileDescription", "LCM Dynamic Link Library"
VALUE "FileVersion", "1,0,0,1"
VALUE "InternalName", "LCM"
VALUE "LegalCopyright", "Copyright (C) ST Ericsson 2011"
VALUE "OriginalFilename", "LCM.dll"
- VALUE "PrivateBuild", "http://gerrit.lud.stericsson.com/gerrit/20944"
+ VALUE "PrivateBuild", "Change-Id: Ib1901abfc2efa6c887c70b8583ddd2258e21aa78"
VALUE "ProductName", "CXA1104507 Loader Communication Module"
- VALUE "ProductVersion", "P1N"
+ VALUE "ProductVersion", "R1T"
END
END
BLOCK "VarFileInfo"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h
index 6a94bae..fc453c2 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_protocol.h
@@ -9,7 +9,9 @@
* @{
* @addtogroup a2_family
* @{
- * @addtogroup a2_protocol
+ * @addtogroup a2_protocol A2 Protocol
+ * Functionalities for handling A2 commands.
+ *
* @{
*/
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h
index 6124d58..b36b5f0 100755
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_speedflash.h
@@ -56,10 +56,7 @@ extern "C"
* Set the LCM in A2 Speedflash Mode.
*
* @param [in] Communication_p Communication module context.
- * @param [in] State State of the speedflash (TRUE - on, FALSE - off).
*
- * @retval E_SUCCESS After successful execution.
- * @retval
*/
LCM_API void Do_A2_Speedflash_Start(Communication_t *Communication_p);
@@ -73,7 +70,6 @@ extern "C"
* @param [in] BufferSize Size of the speedflash sub-blocks.
*
* @retval E_SUCCESS After successful execution.
- * @retval
*/
LCM_API ErrorCode_e Do_A2_Speedflash_WriteBlock(Communication_t *Communication_p, const void *Buffer, const uint32 BufferSize);
#ifdef __cplusplus
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h
index bb082e7..7d90384 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/include/r_a2_transport.h
@@ -9,7 +9,8 @@
* @{
* @addtogroup a2_family
* @{
- * @addtogroup ldr_transport_layer
+ * @addtogroup ldr_transport_layer A2 Transport Layer
+ *
* @{
*/
@@ -41,7 +42,7 @@ ErrorCode_e A2_Transport_Poll(Communication_t *Communication_p);
* @param [in] Communication_p The communication context
* structure to receive information
* about this module instance.
- * @param [in] InputData_p Pointer to the input data.
+ * @param [in] InputDataIn_p Pointer to the input data.
*
* @retval E_SUCCESS After successful execution.
* @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_protocol.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_protocol.c
index a26b677..a2a2a43 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_protocol.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_protocol.c
@@ -30,7 +30,7 @@
#include "r_debug.h"
#include "r_debug_macro.h"
#include "r_serialization.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* File scope types, constants and variables
@@ -179,7 +179,7 @@ static ErrorCode_e ProcessAcknowledgement(Communication_t *Communication_p, A2_P
ReturnValue = A2_Network_PacketRelease(Communication_p, Packet_p);
if (A2_SPEEDFLASH_START == A2_SPEEDFLASH(Communication_p)->State) {
- Communication_p->CommunicationDevice_p->Cancel(Communication_p);
+ Communication_p->CommunicationDevice_p->Cancel(Communication_p->CommunicationDevice_p);
A2_SPEEDFLASH(Communication_p)->State = A2_SPEEDFLASH_ACTIVE;
A2_SPEEDFLASH(Communication_p)->InboundState = A2_SPEEDFLASH_READ_REQ;
}
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_speedflash.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_speedflash.c
index b411027..abb6b58 100755
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_speedflash.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/a2_speedflash.c
@@ -83,11 +83,15 @@ ErrorCode_e A2_Speedflash_Poll(Communication_t *Communication_p)
case A2_SPEEDFLASH_READ_REQ:
A2_SPEEDFLASH(Communication_p)->InboundState = A2_SPEEDFLASH_WAIT_READ_REQ;
+#ifdef CFG_ENABLE_LOADER_TYPE
if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read((void *)A2_SPEEDFLASH(Communication_p)->Scratch,
- A2_SPEEDFLASH_REQ_SIZE, A2_Speedflash_ReadCallback, Communication_p)) {
+ A2_SPEEDFLASH_REQ_SIZE, A2_Speedflash_ReadCallback, Communication_p->CommunicationDevice_p)) {
A2_SPEEDFLASH(Communication_p)->InboundState = A2_SPEEDFLASH_READ_REQ;
}
-
+#else
+ (void)Communication_p->CommunicationDevice_p->Read((void *)A2_SPEEDFLASH(Communication_p)->Scratch,
+ A2_SPEEDFLASH_REQ_SIZE, A2_Speedflash_ReadCallback, Communication_p->CommunicationDevice_p);
+#endif
break;
case A2_SPEEDFLASH_WAIT_READ_REQ:
/* nothing to do */
@@ -98,7 +102,7 @@ ErrorCode_e A2_Speedflash_Poll(Communication_t *Communication_p)
A2_SPEEDFLASH(Communication_p)->InboundState = A2_SPEEDFLASH_WAIT_WRITE_BLOCK;
if (E_SUCCESS != Communication_p->CommunicationDevice_p->Write(A2_SPEEDFLASH(Communication_p)->Outbound_p,
- A2_SPEEDFLASH(Communication_p)->OutboundSize, A2_Speedflash_WriteCallback, Communication_p)) {
+ A2_SPEEDFLASH(Communication_p)->OutboundSize, A2_Speedflash_WriteCallback, Communication_p->CommunicationDevice_p)) {
A2_SPEEDFLASH(Communication_p)->InboundState = A2_SPEEDFLASH_WRITE_BLOCK;
}
}
@@ -114,7 +118,7 @@ ErrorCode_e A2_Speedflash_Poll(Communication_t *Communication_p)
void A2_Speedflash_WriteCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
A2_SPEEDFLASH(Communication_p)->Outbound_p = NULL;
A2_SPEEDFLASH(Communication_p)->OutboundSize = 0;
@@ -132,7 +136,7 @@ void A2_Speedflash_WriteCallback(const void *Data_p, const uint32 Length, void *
void A2_Speedflash_ReadCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
A2_CommandData_t CmdData;
CmdData.Type = A2_SPEEDFLASH_GR;
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c
index 5727d4e..dd92fe8 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/bulk_protocol.c
@@ -29,7 +29,7 @@
#include "r_debug_macro.h"
#include "r_communication_service.h"
#include "t_security_algorithms.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
#ifdef CFG_ENABLE_MEASUREMENT_TOOL
#include "r_measurement_tool.h"
diff --git a/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c b/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c
index ef50be7..6ea08d4 100644
--- a/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c
+++ b/lcmodule/source/cnh1605204_ldr_transport_layer/source/protrom_transport.c
@@ -28,7 +28,7 @@
#include "r_protrom_protocol.h"
#include "r_communication_service.h"
#include "t_security_algorithms.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* Declaration of file local functions
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_header.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_header.h
index cefb39f..d750063 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_header.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_header.h
@@ -9,7 +9,9 @@
* @{
* @addtogroup a2_family
* @{
- * @addtogroup ldr_header
+ * @addtogroup ldr_header A2 Header
+ * Functionalities for serialization and de-serialization A2 header.
+ *
* @{
*/
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_network.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_network.h
index e97a3e7..fd6efb7 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_network.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/r_a2_network.h
@@ -9,7 +9,9 @@
* @{
* @addtogroup a2_family
* @{
- * @addtogroup ldr_network_layer
+ * @addtogroup ldr_network_layer A2 Network Layer
+ * A2 network layer support receiving and sending A2 packets.
+ *
* @{
*/
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/r_r15_header.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/r_r15_header.h
index fc05539..0011bc3 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/r_r15_header.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/r_r15_header.h
@@ -63,9 +63,9 @@ void R15_SerializeHeader(void *Data_p, const R15_Header_t *Header_p);
/**
* Deserialize the extended header stored in network format to a structure.
*
- * @param [out] Header_p Pointer to the extended header structure where the
- * header data should be placed.
- * @param [in] Data_p Pointer to the buffer with received header.
+ * @param [out] ExtendedHeader_p Pointer to the extended header structure where the
+ * header data should be placed.
+ * @param [in] Data_p Pointer to the buffer with received header.
*
* @return none.
*/
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_a2_network.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_a2_network.h
index cdc71d4..d91b2f0 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_a2_network.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_a2_network.h
@@ -98,7 +98,7 @@ typedef struct A2_PacketMeta {
corresponding buffer used in
the packet. */
A2_Header_t Header; /**< Structure of the header. */
- uint32 Resend; /**< Resend counter. */
+ uint32 Resend; /**< Re-send counter. */
Timer_t *Timer_p; /**< Timer data used for
sending/receiving packet. */
uint8 *Payload_p; /**< Pointer to the payload data
@@ -137,7 +137,7 @@ typedef struct {
A2_Header_t Header;
/** Pointer to meta data for allocated buffer for handling A2 packet.*/
A2_PacketMeta_t *Packet_p;
- /** Number of packets before receiver is stoped. */
+ /** Number of packets before receiver is stopped. */
uint8 PacketsBeforeReceiverStop;
/** Indicator for stopping the receiver. */
boolean StopTransfer;
@@ -148,7 +148,7 @@ typedef struct {
/** A2_Outbound_t*/
/** Structure for handling outgoing A2 packets.*/
typedef struct {
- /**< State of the state machine for handling outgoing A2 packets. */
+ /** State of the state machine for handling outgoing A2 packets. */
A2_OutboundState_t State;
/** Temporary pointer for handling PROTROM packet.*/
A2_PacketMeta_t *Packet_p;
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_protrom_network.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_protrom_network.h
index 955b589..b29a65a 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_protrom_network.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_protrom_network.h
@@ -34,7 +34,7 @@ typedef enum {
PROTROM_RECEIVE_HEADER, /**< State for receiving Header.*/
PROTROM_RECEIVE_PAYLOAD, /**< State for receiving Payload.*/
PROTROM_RECEIVE_ERROR, /**< State for error handling.*/
- PROTROM_RECEIVE_IDLE /**< State for receiver idele.*/
+ PROTROM_RECEIVE_IDLE /**< State for receiver idle.*/
} Protrom_InboundState_t;
/** Defined state of the transmitter */
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_network_layer.h b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_network_layer.h
index 5e78ddd..3d48957 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_network_layer.h
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/include/t_r15_network_layer.h
@@ -286,13 +286,13 @@ typedef struct {
PacketMeta_t *MetaInfoList[COMMAND_BUFFER_COUNT+BULK_BUFFER_COUNT];
/**< List of meta data for used packets. */
RetransmissionContext_t *RetransmissionList[MAX_SIZE_RETRANSMISSION_LIST];
- /**< List of packet for retransmision */
+ /**< List of packet for retransmission */
uint32 RetransmissionListCount;
- /**< Counter for packets retransmision */
+ /**< Counter for packets retransmission */
R15_Inbound_t Inbound;
/**< Context for receiver. */
R15_Outbound_t Outbound;
- /**< Context for transmiter. */
+ /**< Context for transmitter. */
} R15_NetworkContext_t;
/*
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/source/a2_network.c b/lcmodule/source/cnh1605205_ldr_network_layer/source/a2_network.c
index 886ee46..cfbf592 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/source/a2_network.c
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/source/a2_network.c
@@ -70,7 +70,7 @@ ErrorCode_e A2_Network_Initialize(Communication_t *Communication_p)
memset(A2_NETWORK(Communication_p), 0, sizeof(A2_NetworkContext_t));
/* Simulate a finished read to get the inbound state-machine going. */
- A2_Network_ReadCallback(NULL, 0, Communication_p);
+ A2_Network_ReadCallback(NULL, 0, Communication_p->CommunicationDevice_p);
A2_NETWORK(Communication_p)->Outbound.TxCriticalSection = Do_CriticalSection_Create();
#ifdef CFG_ENABLE_LOADER_TYPE
@@ -123,7 +123,7 @@ ErrorExit:
/*
- * Handler for received packets in A2 protocl family.
+ * Handler for received packets in A2 protocol family.
*
* This callback function handles the received packets.
*
@@ -136,7 +136,7 @@ ErrorExit:
void A2_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
IDENTIFIER_NOT_USED(Data_p);
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
C_(printf("a2_network.c (%d) RecLength(%d) RecBackupData (%d)\n", __LINE__, Length, A2_NETWORK(Communication_p)->Inbound.RecBackupData);)
A2_NETWORK(Communication_p)->Inbound.RecData += Length + A2_NETWORK(Communication_p)->Inbound.RecBackupData;
@@ -186,46 +186,87 @@ void A2_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Para
ErrorCode_e A2_Network_ReceiverHandler(Communication_t *Communication_p)
{
uint32 ReqData;
+ uint32 ReqBufferOffset;
A2_Inbound_t *In_p = &(A2_NETWORK(Communication_p)->Inbound);
if (In_p->ReqData > 0) {
if (Communication_p->BackupCommBufferSize != 0) {
if (Communication_p->BackupCommBufferSize < In_p->ReqData) {
memcpy(In_p->Target_p + In_p->ReqBuffOffset, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
- In_p->RecBackupData = Communication_p->BackupCommBufferSize;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p + In_p->ReqBuffOffset + Communication_p->BackupCommBufferSize,
- In_p->ReqData - Communication_p->BackupCommBufferSize,
- A2_Network_ReadCallback, Communication_p);
- C_(printf("a2_network.c (%d) ReqData(%d) RecData(%d)\n", __LINE__, In_p->ReqData, In_p->RecData);)
- C_(printf("a2_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
- In_p->RecData = 0;
+ ReqData = In_p->ReqData;
+ In_p->ReqData = 0;
+ ReqBufferOffset = In_p->ReqBuffOffset;
In_p->ReqBuffOffset = 0;
+ In_p->RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
- In_p->ReqData = 0;
+ In_p->RecData = 0;
+
+ C_(printf("a2_network.c (%d) ReqData(%d) RecData(%d)\n", __LINE__, ReqData, In_p->RecData);)
+ C_(printf("a2_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset + In_p->RecBackupData,
+ ReqData - In_p->RecBackupData, A2_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ In_p->ReqBuffOffset = ReqBufferOffset;
+ Communication_p->BackupCommBufferSize = In_p->RecBackupData;
+ In_p->RecBackupData = 0;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset + In_p->RecBackupData,
+ ReqData - In_p->RecBackupData, A2_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+#endif
} else {
+ /* Copy content of backup buffer into receive buffer */
memcpy(In_p->Target_p + In_p->ReqBuffOffset, Communication_p->BackupCommBuffer_p, In_p->ReqData);
+ /* Move rest of backup data at the beginning of the backup buffer. */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + In_p->ReqData, Communication_p->BackupCommBufferSize - In_p->ReqData);
+ /* Update the size of the backup buffer to handle only unprocessed data. */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - In_p->ReqData;
+
ReqData = In_p->ReqData;
In_p->ReqData = 0;
- A2_Network_ReadCallback(In_p->Target_p + In_p->ReqBuffOffset, ReqData, Communication_p);
+ ReqBufferOffset = In_p->ReqBuffOffset;
+ In_p->ReqBuffOffset = 0;
In_p->RecData = 0;
+ A2_Network_ReadCallback(In_p->Target_p + ReqBufferOffset, ReqData, Communication_p->CommunicationDevice_p);
}
} else {
ReqData = In_p->ReqData;
In_p->ReqData = 0;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p + In_p->ReqBuffOffset, ReqData, A2_Network_ReadCallback, Communication_p);
- C_(printf("a2_network.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, In_p->ReqData, In_p->RecData);)
- C_(printf("a2_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
- In_p->RecData = 0;
+ ReqBufferOffset = In_p->ReqBuffOffset;
In_p->ReqBuffOffset = 0;
+ In_p->RecData = 0;
+
+ C_(printf("a2_network.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, ReqData, In_p->RecData);)
+ C_(printf("a2_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset, ReqData, A2_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ In_p->ReqBuffOffset = ReqBufferOffset;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset, ReqData, A2_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+#endif
}
}
- /* check for receiver sinhronization */
+ /* check for receiver synchronization */
if (In_p->State == A2_RECEIVE_ERROR) {
A2_RESET_INBOUND(In_p, A2_RECEIVE_HEADER);
A2_SYNC_HEADER(In_p, A2_HEADER_LENGTH, In_p->Scratch);
- //(void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p, A2_HEADER_LENGTH, A2_Network_ReadCallback, Communication_p);
+ //(void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p, A2_HEADER_LENGTH, A2_Network_ReadCallback, Communication_p->CommunicationDevice_p);
}
return A2_NETWORK(Communication_p)->Inbound.LCM_Error;
@@ -369,7 +410,7 @@ void A2_Network_WriteCallback(const void *Data_p, const uint32 Length, void *Par
{
IDENTIFIER_NOT_USED(Data_p);
IDENTIFIER_NOT_USED(Length);
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
A2_Outbound_t *Out_p = &(A2_NETWORK(Communication_p)->Outbound);
if (A2_SENDING_PAYLOAD == Out_p->State) {
@@ -512,7 +553,7 @@ ErrorCode_e A2_Network_TransmiterHandler(Communication_t *Communication_p)
}
if (E_SUCCESS == Communication_p->CommunicationDevice_p->Write((Out_p->Packet_p->Buffer_p),
- A2_HEADER_LENGTH, A2_Network_WriteCallback, Communication_p)) {
+ A2_HEADER_LENGTH, A2_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
C_(printf("a2_network.c (%d) Header Sent to comm device! \n", __LINE__);)
} else {
Out_p->State = A2_SEND_HEADER;
@@ -529,7 +570,7 @@ ErrorCode_e A2_Network_TransmiterHandler(Communication_t *Communication_p)
if (E_SUCCESS == Communication_p->CommunicationDevice_p->Write(
(Out_p->Packet_p->Buffer_p + A2_HEADER_LENGTH),
Out_p->Packet_p->Header.DataLength + A2_CRC_LENGTH,
- A2_Network_WriteCallback, Communication_p)) {
+ A2_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
C_(printf("a2_network.c (%d) Payload Sent to comm device! \n", __LINE__);)
} else {
Out_p->State = A2_SEND_PAYLOAD;
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/source/protrom_network.c b/lcmodule/source/cnh1605205_ldr_network_layer/source/protrom_network.c
index 0e52519..7b264e1 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/source/protrom_network.c
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/source/protrom_network.c
@@ -67,7 +67,7 @@ ErrorCode_e Protrom_Network_Initialize(Communication_t *Communication_p)
PROTROM_NETWORK(Communication_p)->Outbound.TxCriticalSection = Do_CriticalSection_Create();
/* Simulate a finished read to get the inbound state-machine going. */
- Protrom_Network_ReadCallback(NULL, 0, Communication_p);
+ Protrom_Network_ReadCallback(NULL, 0, Communication_p->CommunicationDevice_p);
(void)QUEUE(Communication_p, Fifo_SetCallback_Fn)(OBJECT_QUEUE(Communication_p), Communication_p->Outbound_p, QUEUE_NONEMPTY, Protrom_QueueCallback, Communication_p);
return E_SUCCESS;
@@ -109,13 +109,13 @@ ErrorCode_e Protrom_Network_Shutdown(const Communication_t *const Communication_
*
* @param [in] Data_p Pointer to the received data.
* @param [in] Length Length of the received data.
- * @param [in] Param_p Extra parameteres.
+ * @param [in] Param_p Extra parameters.
*
* @return none.
*/
void Protrom_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
A_(printf("protrom_family.c (%d) RecLength(%d) RecBackupData (%d)\n", __LINE__, Length, PROTROM_NETWORK(Communication_p)->Inbound.RecBackupData);)
PROTROM_NETWORK(Communication_p)->Inbound.RecData = Length + PROTROM_NETWORK(Communication_p)->Inbound.RecBackupData;
@@ -175,6 +175,7 @@ void Protrom_Network_ReadCallback(const void *Data_p, const uint32 Length, void
void Protrom_Network_ReceiverHandler(Communication_t *Communication_p)
{
uint32 ReqData;
+ uint32 ReqBufferOffset;
Protrom_Inbound_t *In_p = &(PROTROM_NETWORK(Communication_p)->Inbound);
/* new data for receiving ? */
@@ -182,42 +183,91 @@ void Protrom_Network_ReceiverHandler(Communication_t *Communication_p)
if (Communication_p->BackupCommBufferSize != 0) {
if (Communication_p->BackupCommBufferSize < In_p->ReqData) {
memcpy(In_p->Target_p + In_p->ReqBuffOffset, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
- In_p->RecBackupData = Communication_p->BackupCommBufferSize;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p + In_p->ReqBuffOffset + Communication_p->BackupCommBufferSize,
- In_p->ReqData - Communication_p->BackupCommBufferSize,
- Protrom_Network_ReadCallback, Communication_p);
- C_(printf("protrom_network.c (%d) ReqData(%d) RecData(%d)\n", __LINE__, In_p->ReqData, In_p->RecData);)
- C_(printf("protrom_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
- In_p->RecData = 0;
+ ReqData = In_p->ReqData;
+ In_p->ReqData = 0;
+ ReqBufferOffset = In_p->ReqBuffOffset;
In_p->ReqBuffOffset = 0;
+ In_p->RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
- In_p->ReqData = 0;
+ In_p->RecData = 0;
+
+ C_(printf("protrom_network.c (%d) ReqData(%d) RecData(%d)\n", __LINE__, ReqData, In_p->RecData);)
+ C_(printf("protrom_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset + In_p->RecBackupData,
+ ReqData - In_p->RecBackupData, Protrom_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ In_p->ReqBuffOffset = ReqBufferOffset;
+ Communication_p->BackupCommBufferSize = In_p->RecBackupData;
+ In_p->RecBackupData = 0;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset + In_p->RecBackupData,
+ ReqData - In_p->RecBackupData, Protrom_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+#endif
} else {
+ /* Copy content of backup buffer into receive buffer */
memcpy(In_p->Target_p + In_p->ReqBuffOffset, Communication_p->BackupCommBuffer_p, In_p->ReqData);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + In_p->ReqData, Communication_p->BackupCommBufferSize - In_p->ReqData);
+ /* Update the size of the backup buffer */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - In_p->ReqData;
+
ReqData = In_p->ReqData;
In_p->ReqData = 0;
- Protrom_Network_ReadCallback(In_p->Target_p + In_p->ReqBuffOffset, ReqData, Communication_p);
+ ReqBufferOffset = In_p->ReqBuffOffset;
+ In_p->ReqBuffOffset = 0;
In_p->RecData = 0;
+ Protrom_Network_ReadCallback(In_p->Target_p + ReqBufferOffset, ReqData, Communication_p->CommunicationDevice_p);
}
} else {
ReqData = In_p->ReqData;
In_p->ReqData = 0;
+ ReqBufferOffset = In_p->ReqBuffOffset;
+ In_p->ReqBuffOffset = 0;
In_p->RecData = 0;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p + In_p->ReqBuffOffset, ReqData, Protrom_Network_ReadCallback, Communication_p);
- C_(printf("protrom_network.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, In_p->ReqData, In_p->RecData);)
+ C_(printf("protrom_network.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, ReqData, In_p->RecData);)
C_(printf("protrom_network.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
- In_p->ReqBuffOffset = 0;
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset, ReqData, Protrom_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ In_p->ReqBuffOffset = ReqBufferOffset;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset, ReqData, Protrom_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+#endif
}
}
- /* check for receiver sinhronization */
+ /* check for receiver synchronization */
if (In_p->State == PROTROM_RECEIVE_ERROR) {
In_p->ReqData = 0;
In_p->RecData = 0;
In_p->ReqBuffOffset = 0;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p, PROTROM_HEADER_LENGTH, Protrom_Network_ReadCallback, Communication_p);
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS == Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ PROTROM_HEADER_LENGTH, Protrom_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ In_p->State = PROTROM_RECEIVE_HEADER;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ PROTROM_HEADER_LENGTH, Protrom_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
In_p->State = PROTROM_RECEIVE_HEADER;
+#endif
}
}
@@ -236,7 +286,7 @@ void Protrom_Network_ReceiverHandler(Communication_t *Communication_p)
*/
void Protrom_Network_WriteCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
Protrom_Outbound_t *Out_p = &(PROTROM_NETWORK(Communication_p)->Outbound);
if (Out_p->State == PROTROM_SENDING_PAYLOAD) {
if (NULL != Out_p->Packet_p) {
@@ -341,12 +391,11 @@ static ErrorCode_e Protrom_Network_TransmiterHandler(Communication_t *Communicat
}
/* FALLTHROUGH */
-
case PROTROM_SEND_HEADER:
Out_p->State = PROTROM_SENDING_HEADER;
if (E_SUCCESS != Communication_p->CommunicationDevice_p->Write(Out_p->Packet_p->Buffer_p,
- PROTROM_HEADER_LENGTH, Protrom_Network_WriteCallback, Communication_p)) {
+ PROTROM_HEADER_LENGTH, Protrom_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
Out_p->State = PROTROM_SEND_HEADER;
break;
}
@@ -357,7 +406,7 @@ static ErrorCode_e Protrom_Network_TransmiterHandler(Communication_t *Communicat
Out_p->State = PROTROM_SENDING_PAYLOAD;
if (E_SUCCESS != Communication_p->CommunicationDevice_p->Write(Out_p->Packet_p->Buffer_p + PROTROM_HEADER_LENGTH,
Out_p->Packet_p->Header.PayloadLength + PROTROM_CRC_LENGTH,
- Protrom_Network_WriteCallback, Communication_p)) {
+ Protrom_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
Out_p->State = PROTROM_SEND_PAYLOAD;
break;
}
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/source/r15_network_layer.c b/lcmodule/source/cnh1605205_ldr_network_layer/source/r15_network_layer.c
index 85be0a2..1ae4d2e 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/source/r15_network_layer.c
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/source/r15_network_layer.c
@@ -23,7 +23,6 @@
#include "c_system.h"
#include "r_r15_transport_layer.h"
#include "r_r15_family.h"
-#include "r_communication_service.h"
#include "r_r15_header.h"
#include "r_bulk_protocol.h"
#include "r_command_protocol.h"
@@ -41,7 +40,7 @@
extern Measurement_t *Measurement_p;
#endif
-static PacketMeta_t PacketMetaInfo[COMMAND_BUFFER_COUNT + BULK_BUFFER_COUNT] ; /* Packet Meta Info vector*/
+static PacketMeta_t PacketMetaInfo[COMMAND_BUFFER_COUNT + BULK_BUFFER_COUNT] = {{0}}; /* Packet Meta Info vector*/
/*******************************************************************************
* Declaration of file local functions
@@ -86,7 +85,7 @@ ErrorCode_e R15_Network_Initialize(Communication_t *Communication_p)
R15_NETWORK(Communication_p)->Outbound.TxCriticalSection = Do_CriticalSection_Create();
/* Simulate a finished read to get the inbound state-machine going. */
- R15_Network_ReadCallback(NULL, 0, Communication_p);
+ R15_Network_ReadCallback(NULL, 0, Communication_p->CommunicationDevice_p);
#ifdef CFG_ENABLE_LOADER_TYPE
(void)QUEUE(Communication_p, Fifo_SetCallback_Fn)(OBJECT_QUEUE(Communication_p), Communication_p->Outbound_p, QUEUE_NONEMPTY, R15_QueueOutCallback, Communication_p);
(void)QUEUE(Communication_p, Fifo_SetCallback_Fn)(OBJECT_QUEUE(Communication_p), Communication_p->Inbound_p, QUEUE_NONEMPTY, R15_QueueInCallback, Communication_p);
@@ -98,7 +97,7 @@ ErrorCode_e R15_Network_Initialize(Communication_t *Communication_p)
}
/*
- * Shut down the r15 network layer.
+ * Shutdown the R15 Network layer.
*
* @param [in,out] Communication_p Communication module context.
*
@@ -152,7 +151,7 @@ ErrorExit:
*/
void R15_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
C_(printf("r15_network_layer.c (%d) RecLength(%d) RecBackupData (%d)\n", __LINE__, Length, R15_NETWORK(Communication_p)->Inbound.RecBackupData);)
R15_NETWORK(Communication_p)->Inbound.RecData = Length + R15_NETWORK(Communication_p)->Inbound.RecBackupData;
@@ -208,7 +207,7 @@ void R15_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Par
ErrorCode_e R15_Network_ReceiverHandler(Communication_t *Communication_p)
{
uint32 ReqData;
- uint32 ReqBuffOffset = 0;
+ uint32 ReqBufferOffset;
R15_Inbound_t *In_p = &(R15_NETWORK(Communication_p)->Inbound);
/* new data for receiving ? */
@@ -216,43 +215,93 @@ ErrorCode_e R15_Network_ReceiverHandler(Communication_t *Communication_p)
if (Communication_p->BackupCommBufferSize != 0) {
if (Communication_p->BackupCommBufferSize < In_p->ReqData) {
memcpy(In_p->Target_p + In_p->ReqBuffOffset, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
- In_p->RecBackupData = Communication_p->BackupCommBufferSize;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p + In_p->ReqBuffOffset + Communication_p->BackupCommBufferSize,
- In_p->ReqData - Communication_p->BackupCommBufferSize,
- R15_Network_ReadCallback, Communication_p);
- C_(printf("r15_network_layer.c (%d) ReqData(%d) RecData(%d)\n", __LINE__, In_p->ReqData, In_p->RecData);)
- C_(printf("r15_network_layer.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
- In_p->RecData = 0;
+ ReqData = In_p->ReqData;
+ In_p->ReqData = 0;
+ ReqBufferOffset = In_p->ReqBuffOffset;
In_p->ReqBuffOffset = 0;
+ In_p->RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
- In_p->ReqData = 0;
+ In_p->RecData = 0;
+
+ C_(printf("r15_network_layer.c (%d) ReqData(%d) RecData(%d)\n", __LINE__, ReqData, In_p->RecData);)
+ C_(printf("r15_network_layer.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset + In_p->RecBackupData,
+ ReqData - In_p->RecBackupData, R15_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ In_p->ReqBuffOffset = ReqBufferOffset;
+ Communication_p->BackupCommBufferSize = In_p->RecBackupData;
+ In_p->RecBackupData = 0;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset + In_p->RecBackupData,
+ ReqData - In_p->RecBackupData, R15_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+
+#endif
} else {
+ /* Copy content of backup buffer into receive buffer */
memcpy(In_p->Target_p + In_p->ReqBuffOffset, Communication_p->BackupCommBuffer_p, In_p->ReqData);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + In_p->ReqData, Communication_p->BackupCommBufferSize - In_p->ReqData);
+ /* Update the size of the backup buffer */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - In_p->ReqData;
+
ReqData = In_p->ReqData;
In_p->ReqData = 0;
- R15_Network_ReadCallback(In_p->Target_p + In_p->ReqBuffOffset, ReqData, Communication_p);
+ ReqBufferOffset = In_p->ReqBuffOffset;
+ In_p->ReqBuffOffset = 0;
In_p->RecData = 0;
+ R15_Network_ReadCallback(In_p->Target_p + ReqBufferOffset, ReqData, Communication_p->CommunicationDevice_p);
}
} else {
ReqData = In_p->ReqData;
- ReqBuffOffset = (uint32)(In_p->ReqBuffOffset);
- In_p->ReqBuffOffset = 0;
In_p->ReqData = 0;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p + ReqBuffOffset, ReqData, R15_Network_ReadCallback, Communication_p);
- C_(printf("r15_network_layer.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, In_p->ReqData, In_p->RecData);)
- C_(printf("r15_network_layer.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
+ ReqBufferOffset = In_p->ReqBuffOffset;
+ In_p->ReqBuffOffset = 0;
In_p->RecData = 0;
+
+ C_(printf("r15_network_layer.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, ReqData, In_p->RecData);)
+ C_(printf("r15_network_layer.c (%d) Communication_p->BackupCommBufferSize(%d) RecBackupData (%d)\n", __LINE__, Communication_p->BackupCommBufferSize, In_p->RecBackupData);)
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset, ReqData, R15_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ In_p->ReqBuffOffset = ReqBufferOffset;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(
+ In_p->Target_p + ReqBufferOffset, ReqData, R15_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+#endif
}
}
- /* check for receiver sinhronization */
+ /* check for receiver synchronization */
if (In_p->State == RECEIVE_ERROR) {
In_p->ReqData = 0;
In_p->RecData = 0;
In_p->ReqBuffOffset = 0;
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS == Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ ALIGNED_HEADER_LENGTH, R15_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)){
+ In_p->State = RECEIVE_HEADER;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ ALIGNED_HEADER_LENGTH, R15_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
In_p->State = RECEIVE_HEADER;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p, ALIGNED_HEADER_LENGTH, R15_Network_ReadCallback, Communication_p);
+#endif
}
return R15_NETWORK(Communication_p)->Inbound.LCM_Error;
@@ -323,7 +372,7 @@ ErrorCode_e R15_Network_TransmiterHandler(Communication_t *Communication_p)
if (E_SUCCESS == Communication_p->CommunicationDevice_p->Write((Out_p->Packet_p->Buffer_p + HEADER_OFFSET_IN_BUFFER),
ContinuousBufferLength,
- R15_Network_WriteCallback, Communication_p)) {
+ R15_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
C_(printf("r15_network_layer.c (%d) Header Sent to comm device! \n", __LINE__);)
} else {
Out_p->State = SEND_HEADER;
@@ -342,7 +391,7 @@ ErrorCode_e R15_Network_TransmiterHandler(Communication_t *Communication_p)
if (E_SUCCESS == Communication_p->CommunicationDevice_p->Write(Out_p->Packet_p->Payload_p,
Aligned_Length,
- R15_Network_WriteCallback, Communication_p)) {
+ R15_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
RegisterRetransmission = TRUE;
C_(printf("r15_network_layer.c (%d) Payload Sent to comm device! \n", __LINE__);)
} else {
@@ -421,7 +470,7 @@ ErrorCode_e R15_Network_CancelRetransmission(const Communication_t *const Commun
* combination of protocol type, session number and command.
*
* @param [in] Packet_p Pointer to the packet.
- * @param [in] ExternalKey External key for marking the packet for retransmision.
+ * @param [in] ExternalKey External key for marking the packet for retransmission.
*
* @return Unique key.
*/
@@ -473,7 +522,6 @@ PacketMeta_t *R15_Network_PacketAllocate(const Communication_t *const Communicat
/* packet meta info setup */
C_(
-
if (BULK_BUFFER_SIZE > BufferSize)
printf("CmdBuffGet:%x\n", Buffer_p);
else {
@@ -562,7 +610,7 @@ ErrorExit:
*/
void R15_Network_WriteCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
R15_Outbound_t *Out_p = &(R15_NETWORK(Communication_p)->Outbound);
BulkExtendedHeader_t ExtendedHeader = {0};
B_(printf("r15_network_layer.c (%d): Device write finished!! \n", __LINE__);)
@@ -605,12 +653,14 @@ static ErrorCode_e R15_Network_ReceiveHeader(const Communication_t *const Commun
if (In_p->RecData == 0) {
In_p->ReqData = ALIGNED_HEADER_LENGTH;
In_p->Target_p = In_p->Scratch;
+ In_p->ReqBuffOffset = 0;
} else {
if (R15_IsReceivedHeader(In_p)) {
if (R15_IsValidHeader(In_p->Scratch)) {
R15_DeserializeHeader(&In_p->Header, In_p->Scratch);
In_p->Target_p += ALIGNED_HEADER_LENGTH;
+
if (In_p->Header.ExtendedHeaderLength == COMMAND_EXTENDED_HEADER_LENGTH) {
SET_INBOUND(In_p, RECEIVE_EXTENDED_HEADER, ALIGNED_COMMAND_EXTENDED_HEADER_LENGTH);
} else {
@@ -625,14 +675,16 @@ static ErrorCode_e R15_Network_ReceiveHeader(const Communication_t *const Commun
}
else
{
- uint32 Counter = 0;
-
- A_(printf("Invalid header! ");)
- for (Counter = 0; Counter < 16; Counter++)
- {
- A_(printf(" %02X", In_p->Scratch[Counter]);)
- }
- A_(printf("\n\n");)
+ A_(
+ uint32 Counter = 0;
+
+ printf("Invalid header! ");
+ for (Counter = 0; Counter < 16; Counter++)
+ {
+ printf(" %02X", In_p->Scratch[Counter]);
+ }
+ printf("\n\n");
+ )
}
}
@@ -669,11 +721,13 @@ static ErrorCode_e R15_Network_ReceiveExtendedHeader(Communication_t *Communicat
In_p->Packet_p->Header = R15Header;
In_p->Packet_p->ExtendedHeader_p = In_p->Packet_p->Buffer_p + HEADER_OFFSET_IN_BUFFER + ALIGNED_HEADER_LENGTH;
SET_PACKET_FLAGS(In_p->Packet_p, PACKET_RX_STATE_MASK, BUF_HDR_CRC_OK);
+
if (In_p->Packet_p->Header.ExtendedHeaderLength == COMMAND_EXTENDED_HEADER_LENGTH) {
In_p->Packet_p->Payload_p = In_p->Packet_p->ExtendedHeader_p + ALIGNED_COMMAND_EXTENDED_HEADER_LENGTH;
} else {
In_p->Packet_p->Payload_p = In_p->Packet_p->ExtendedHeader_p + ALIGNED_BULK_EXTENDED_HEADER_LENGTH;
}
+
memcpy(In_p->Packet_p->Buffer_p + HEADER_OFFSET_IN_BUFFER, &In_p->Packet_p->Header, HEADER_LENGTH);
memcpy(In_p->Packet_p->ExtendedHeader_p, In_p->Target_p, In_p->Header.ExtendedHeaderLength);
@@ -731,14 +785,16 @@ static ErrorCode_e R15_Network_ReceivePayload(Communication_t *Communication_p)
if (HASH_NONE != Packet_p->Header.Flags) {
#ifdef CFG_ENABLE_MEASUREMENT_TOOL
- if(In_p->Packet_p->Header.Protocol == BULK_PROTOCOL){
- BulkExtendedHeader_t ExtendedHeader = {0};
- R15_DeserializeBulkExtendedHeader(&ExtendedHeader, Packet_p->ExtendedHeader_p);
- if ((ExtendedHeader.TypeFlags & MASK_BULK_COMMAND_SELECT) == CMD_BULK_DATA){
- (void)MP(Measurement_p, ExtendedHeader.AcksChunk, START_HASHINGCHUNK_TIME);
- }
- }
+ if (In_p->Packet_p->Header.Protocol == BULK_PROTOCOL) {
+ BulkExtendedHeader_t ExtendedHeader = {0};
+ R15_DeserializeBulkExtendedHeader(&ExtendedHeader, Packet_p->ExtendedHeader_p);
+
+ if ((ExtendedHeader.TypeFlags & MASK_BULK_COMMAND_SELECT) == CMD_BULK_DATA) {
+ (void)MP(Measurement_p, ExtendedHeader.AcksChunk, START_HASHINGCHUNK_TIME);
+ }
+ }
+
#endif
Communication_p->HashDevice_p->Calculate(OBJECT_HASH(Communication_p),
Communication_p->CurrentFamilyHash,
@@ -807,7 +863,7 @@ static ErrorCode_e R15_Network_RegisterRetransmission(Communication_t *Communica
}
} while (Index < MAX_SIZE_RETRANSMISSION_LIST);
} else {
- A_(printf("r15_network_layer.c (%d) ** Err: Retransmision List is full! ** \n", __LINE__);)
+ A_(printf("r15_network_layer.c (%d) ** Err: Retransmission List is full! ** \n", __LINE__);)
}
return ReturnValue;
@@ -845,14 +901,16 @@ static void R15_InHashCallback(const void *const Data_p, uint32 Length, const ui
PacketMeta_t *Packet_p = (PacketMeta_t *)Param_p;
#ifdef CFG_ENABLE_MEASUREMENT_TOOL
- if(Packet_p->Header.Protocol == BULK_PROTOCOL){
- BulkExtendedHeader_t ExtendedHeader = {0};
- R15_DeserializeBulkExtendedHeader(&ExtendedHeader, Packet_p->ExtendedHeader_p);
- if ((ExtendedHeader.TypeFlags & MASK_BULK_COMMAND_SELECT) == CMD_BULK_DATA){
- (void)MP(Measurement_p, ExtendedHeader.AcksChunk, END_HASHINGCHUNK_TIME);
- }
+ if (Packet_p->Header.Protocol == BULK_PROTOCOL) {
+ BulkExtendedHeader_t ExtendedHeader = {0};
+ R15_DeserializeBulkExtendedHeader(&ExtendedHeader, Packet_p->ExtendedHeader_p);
+
+ if ((ExtendedHeader.TypeFlags & MASK_BULK_COMMAND_SELECT) == CMD_BULK_DATA) {
+ (void)MP(Measurement_p, ExtendedHeader.AcksChunk, END_HASHINGCHUNK_TIME);
+ }
}
+
#endif
if (memcmp(Hash_p, &Packet_p->Header.PayloadChecksum, 4) == 0) {
diff --git a/lcmodule/source/cnh1605205_ldr_network_layer/source/z_network.c b/lcmodule/source/cnh1605205_ldr_network_layer/source/z_network.c
index 8d7ef09..99551f5 100644
--- a/lcmodule/source/cnh1605205_ldr_network_layer/source/z_network.c
+++ b/lcmodule/source/cnh1605205_ldr_network_layer/source/z_network.c
@@ -56,7 +56,7 @@ ErrorCode_e Z_Network_Initialize(Communication_t *Communication_p)
Z_NETWORK(Communication_p)->Outbound.TxCriticalSection = Do_CriticalSection_Create();
/* Simulate a finished read to get the inbound state-machine going. */
- Z_Network_ReadCallback(NULL, 0, Communication_p);
+ Z_Network_ReadCallback(NULL, 0, Communication_p->CommunicationDevice_p);
return E_SUCCESS;
}
@@ -70,7 +70,7 @@ ErrorCode_e Z_Network_Shutdown(const Communication_t *const Communication_p)
void Z_Network_ReadCallback(const void *Data_p, const uint32 Length, void *Param_p)
{
- Communication_t *Communication_p = (Communication_t *)Param_p;
+ Communication_t *Communication_p = (Communication_t*)(((CommunicationDevice_t*)Param_p)->Object_p);
CommandData_t CmdData;
Z_NETWORK(Communication_p)->Inbound.RecData += Length;
@@ -100,15 +100,36 @@ void Z_Network_ReceiverHandler(Communication_t *Communication_p)
ReqData = In_p->ReqData;
In_p->ReqData = 0;
In_p->RecData = 0;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p, ReqData, Z_Network_ReadCallback, Communication_p);
C_(printf("z_network.c (%d) ReqData(%d) RecData(%d) \n", __LINE__, ReqData, In_p->RecData);)
+
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (E_SUCCESS != Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ ReqData, Z_Network_ReadCallback, Communication_p->CommunicationDevice_p)) {
+ /* Read failed! Return to previous state. */
+ In_p->ReqData = ReqData;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ ReqData, Z_Network_ReadCallback, Communication_p->CommunicationDevice_p);
+#endif
}
- /* check for receiver sinhronization */
+ /* check for receiver synchronization */
if (In_p->State == Z_RECEIVE_ERROR) {
In_p->ReqData = 0;
In_p->RecData = 0;
- (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p, Z_HEADER_LENGTH, Z_Network_ReadCallback, Communication_p);
+#ifdef CFG_ENABLE_LOADER_TYPE
+ if (TRUE == Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ Z_HEADER_LENGTH, Z_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p)) {
+ In_p->State = Z_RECEIVE_HEADER;
+ }
+#else
+ (void)Communication_p->CommunicationDevice_p->Read(In_p->Target_p,
+ Z_HEADER_LENGTH, Z_Network_ReadCallback,
+ Communication_p->CommunicationDevice_p);
+ In_p->State = Z_RECEIVE_HEADER;
+#endif
}
}
@@ -130,7 +151,7 @@ ErrorCode_e Z_Network_TransmiterHandler(Communication_t *Communication_p, Z_Send
switch (Out_p->State) {
case Z_SEND_IDLE:
- /* get next packet for transmiting */
+ /* get next packet for transmitting */
Out_p->State = Z_SEND_PACKET;
/* FALLTHROUGH */
@@ -138,7 +159,7 @@ ErrorCode_e Z_Network_TransmiterHandler(Communication_t *Communication_p, Z_Send
if (E_SUCCESS == Communication_p->CommunicationDevice_p->Write(Data_p,
Size,
- Z_Network_WriteCallback, Communication_p)) {
+ Z_Network_WriteCallback, Communication_p->CommunicationDevice_p)) {
Out_p->State = Z_SENDING_PACKET;
} else {
/* error state ?*/
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/debug_subsystem/r_debug_subsystem.h b/lcmodule/source/cnh1605551_ldr_utilities/debug_subsystem/r_debug_subsystem.h
index 8ab63cf..4f10bc6 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/debug_subsystem/r_debug_subsystem.h
+++ b/lcmodule/source/cnh1605551_ldr_utilities/debug_subsystem/r_debug_subsystem.h
@@ -24,6 +24,10 @@
******************************************************************************/
#include "t_basicdefinitions.h"
#include "t_debug_subsystem.h"
+#ifdef CFG_ENABLE_LOADER_TYPE
+#include "error_codes.h"
+#include "t_communication_service.h"
+#endif
/*******************************************************************************
* Defines
@@ -50,13 +54,34 @@
#ifndef CFG_ENABLE_LOADER_TYPE
void lcm_printf(const char *format, ...);
#else
+/*
+ * Initialization of Debug communication device.
+ *
+ * Used communication devices UART (specified with UART_DEBUG_PORT).
+ *
+ * @return none.
+ */
+void Do_Loader_DebugoutInit(void);
+
+/*
+ * Function for getting the debug communication device.
+ *
+ * @param [out] DebugDevice_pp Pointer to the initialized debug communication
+ * device.
+ *
+ * @retval E_SUCCESS After successful execution.
+ * @retval E_GENERAL_FATAL_ERROR If debug communication device is not
+ * initialized.
+ */
+ErrorCode_e Do_GetDebugCommunicationDevice(CommunicationDevice_t **DebugDevice_pp);
+
/**
* Calls function 'circular_printf'. If debug queue is not initialized this
- * function takes care for initialization and than redidrect input parameters to
+ * function takes care for initialization and than redirect input parameters to
* 'circular_printf' function.
*
* @param [in] *format The string constant format provides a description of the
- * output, with placeholders marked by "%" escape
+ * output, with place holders marked by "%" escape
* characters, to specify both the relative location and the
* type of output that the function should produce.(Standard
* definition for library 'printf' function).
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h b/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h
index 43f9e88..4faf681 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h
+++ b/lcmodule/source/cnh1605551_ldr_utilities/include/r_debug_macro.h
@@ -79,9 +79,7 @@
{ \
if(!(Condition)) \
{ \
- {\
- INT_DISABLE()\
- }\
+ INT_DISABLE()\
while(1); \
} \
} while(0)
@@ -143,9 +141,7 @@
if(!(Condition)) \
{ \
A_(printf("%s (%d): ** Assert failed **\n",__FILE__, __LINE__);)\
- {\
- INT_DISABLE()\
- }\
+ INT_DISABLE()\
while(1); \
} \
} while(0)
@@ -155,9 +151,7 @@
{ \
if(!(Condition)) \
{ \
- {\
- INT_DISABLE()\
- }\
+ INT_DISABLE()\
while(1); \
} \
} while(0)
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/include/r_memmory_utils.h b/lcmodule/source/cnh1605551_ldr_utilities/include/r_memory_utils.h
index fb4d54f..ee5eb18 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/include/r_memmory_utils.h
+++ b/lcmodule/source/cnh1605551_ldr_utilities/include/r_memory_utils.h
@@ -8,7 +8,7 @@
/**
* @addtogroup ldr_utilities
* @{
- * @addtogroup memmory_utils
+ * @addtogroup memory_utils
* @{
*/
@@ -52,9 +52,8 @@ if (NULL != (Buffer)) \
* variable ReturnValue to appropriate error code and send the function to error
* label.
*
- * @param [in] x Variable for alignemend check.
+ * @param [in] x Variable for alignment check.
*
- * @sigbased No - Macro
*/
#define IS_ALIGNED(x) if(((x) & 3)) \
{ \
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/include/r_queue.h b/lcmodule/source/cnh1605551_ldr_utilities/include/r_queue.h
index 06e9d17..abf0904 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/include/r_queue.h
+++ b/lcmodule/source/cnh1605551_ldr_utilities/include/r_queue.h
@@ -61,12 +61,12 @@ void Do_Fifo_Destroy(void *Object_p, void **const Queue_pp);
* reentrant across different queues, but enqueueing on the same queue is
* not necessarily reentrant.
*
- * @param [in] Object_p - Pointer to LCM instance context.
- * @param [in] Queue_p - The queue to append to.
- * @param [in] Value_p - The value to enqueue.
+ * @param [in] Object_p Pointer to LCM instance context.
+ * @param [in] Queue_p The queue to append to.
+ * @param [in] Value_p The value to enqueue.
* @return E_SUCCESS - The function completed successfully.
*
- * @return E_FAILED_TO_STORE_IN_FIFO - Faliled to store data in fifo.
+ * @return E_FAILED_TO_STORE_IN_FIFO - Failed to store data in fifo.
*/
ErrorCode_e Do_Fifo_Enqueue(void *Object_p,
void *const Queue_p,
@@ -174,8 +174,8 @@ void Do_RFifo_Create(void *Object_p,
/**
* @brief Releases any resources associated with the specified queue structure.
*
- * @param [in] Object_p - Pointer to LCM instance context.
- * @param [in,out] Queue_pp - Pointer to the queue structure to destroy.
+ * @param [in] Object_p Pointer to LCM instance context.
+ * @param [in,out] Queue_pp Pointer to the queue structure to destroy.
*/
void Do_RFifo_Destroy(void *Object_p, void **const Queue_pp);
@@ -184,10 +184,10 @@ void Do_RFifo_Destroy(void *Object_p, void **const Queue_pp);
*
* Enqueueing function of a re-entrant, interrupt-safe FIFO queue.
*
- * @param [in] Object_p - Pointer to LCM instance context.
- * @param [in] Queue_p - The queue to append to.
- * @param [in] Value_p - The value to enqueue.
- * @return E_SUCCESS - The function completed successfully.
+ * @param [in] Object_p Pointer to LCM instance context.
+ * @param [in] Queue_p The queue to append to.
+ * @param [in] Value_p The value to enqueue.
+ * @return E_SUCCESS The function completed successfully.
*
* @return E_FAILED_TO_STORE_IN_FIFO - Faliled to store data in fifo.
*/
@@ -226,7 +226,7 @@ void *Do_RFifo_Dequeue(void *Object_p, void *const Queue_p);
* function should be called each time the queue has
* transitioned from an empty to a non-empty state.
* @param [in] Callback The function to call when the specified event occurs
- * or NULL to unregister a previously registered func.
+ * or NULL to unregister a previously registered functions.
* @param [in] Param_p Parameter to pass to the callback function.
* @return The previously registered callback function for this
* type.
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/include/r_serialization.h b/lcmodule/source/cnh1605551_ldr_utilities/include/r_serialization.h
index b0cebd6..15a59bd 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/include/r_serialization.h
+++ b/lcmodule/source/cnh1605551_ldr_utilities/include/r_serialization.h
@@ -36,7 +36,9 @@
******************************************************************************/
#include "t_basicdefinitions.h"
#include "t_serialization.h"
+#if defined(CFG_ENABLE_LOADER_SERIALIZATION)
#include "command_ids.h"
+#endif
/*******************************************************************************
* Declaration of functions
@@ -320,9 +322,19 @@ void skip_block(void **data_pp,
*/
char *skip_str(void **data_pp);
+/**
+ * @brief Serialize device entries.
+ *
+ * @param [out] data_pp Pointer of serialized data for device entries.
+ * @param [in] source_p Source.
+ * @param [in] length length of source string.
+ * @return void.
+ */
+void insert_string(char **data_pp, const char *source_p, uint32 length);
+#if defined(CFG_ENABLE_LOADER_SERIALIZATION)
/**
- * @brief Get directory entries length...TODO: should be explained.
+ * @brief Get directory entries length.
*
* @param [out] source_p Source.
* @param [in] DirectoryEntriesCount Entry counter.
@@ -332,9 +344,9 @@ uint32 get_directory_entries_len(const DirEntry_t *source_p,
uint32 DirectoryEntriesCount);
/**
- * @brief Serialize directory entries...TODO: should be explained.
+ * @brief Serialize directory entries.
*
- * @param [out] data_pp /...TODO: should be explained.
+ * @param [out] data_pp Pointer of serialized data for directory entries.
* @param [in] source_p Source.
* @param [in] DirectoryEntriesCount Entry counter.
* @return void.
@@ -344,7 +356,7 @@ void serialize_directory_entries(void **data_pp,
uint32 DirectoryEntriesCount);
/**
- * @brief Get device entry length...TODO: should be explained.
+ * @brief Get device entry length.
*
* @param [out] source_p Source.
* @param [in] DeviceEntriesCount Entry counter.
@@ -354,9 +366,9 @@ uint32 get_device_entries_len(const ListDevice_t *source_p,
uint32 DeviceEntriesCount);
/**
- * @brief Serialize device entries...TODO: should be explained.
+ * @brief Serialize device entries.
*
- * @param [out] data_pp /...TODO: should be explained.
+ * @param [out] data_pp Pointer of serialized data for device entries.
* @param [in] source_p Source.
* @param [in] DeviceEntriesCount Entry counter.
* @return void.
@@ -364,16 +376,7 @@ uint32 get_device_entries_len(const ListDevice_t *source_p,
void serialize_device_entries(void **data_pp,
const ListDevice_t *source_p,
uint32 DeviceEntriesCount);
-
-/**
- * @brief Serialize device entries...TODO: should be explained.
- *
- * @param [out] data_pp /...TODO: should be explained.
- * @param [in] source_p Source.
- * @param [in] length length of source string.
- * @return void.
- */
-void insert_string(char **data_pp, const char *source_p, uint32 length);
+#endif
/** @} */
/** @} */
diff --git a/lcmodule/source/cnh1605551_ldr_utilities/source/serialization.c b/lcmodule/source/cnh1605551_ldr_utilities/source/serialization.c
index 3b6377f..717f847 100644
--- a/lcmodule/source/cnh1605551_ldr_utilities/source/serialization.c
+++ b/lcmodule/source/cnh1605551_ldr_utilities/source/serialization.c
@@ -76,103 +76,6 @@ uint32 get_uint32_be(void **data_pp)
return ((d[0] << 8 | d[1]) << 8 | d[2]) << 8 | d[3];
}
-uint32 get_directory_entries_len(const DirEntry_t *source_p, uint32 DirectoryEntriesCount)
-{
- uint32 EntriesLen = 0;
- uint32 i = 0;
-
- if (DirectoryEntriesCount > 0) {
- for (i = 0; i < DirectoryEntriesCount; i++) {
- EntriesLen += get_uint32_string_le((void **)&source_p[i].Name_p);
- EntriesLen += sizeof(uint32) + sizeof(uint32) + sizeof(uint64);
- }
- }
-
- return EntriesLen;
-}
-
-void serialize_directory_entries(void **data_pp, const DirEntry_t *source_p, uint32 DirectoryEntriesCount)
-{
- uint32 NameLength = 0;
- uint32 i = 0;
-
- if (DirectoryEntriesCount > 0) {
- for (i = 0; i < DirectoryEntriesCount; i++) {
- NameLength = get_uint32_string_le((void **)&source_p[i].Name_p);
- memcpy(*data_pp, source_p[i].Name_p, NameLength);
- *(const uint8 **)data_pp += NameLength;
- memcpy(*data_pp, &source_p[i].Size, sizeof(uint64));
- *(const uint8 **)data_pp += sizeof(uint64);
- memcpy(*data_pp, &source_p[i].Mode, sizeof(uint32));
- *(const uint8 **)data_pp += sizeof(uint32);
- memcpy(*data_pp, &source_p[i].Time, sizeof(uint32));
- *(const uint8 **)data_pp += sizeof(uint32);
- }
- }
-}
-
-uint32 get_device_entries_len(const ListDevice_t *source_p, uint32 DeviceEntriesCount)
-{
- uint32 EntriesLen = 0;
- uint32 i = 0;
-
- if (DeviceEntriesCount > 0) {
- for (i = 0; i < DeviceEntriesCount; i++) {
- if (NULL != source_p[i].Path_p) {
- EntriesLen += get_uint32_string_le((void **)&source_p[i].Path_p);
- } else {
- EntriesLen += sizeof(uint32);
- }
-
- if (NULL != source_p[i].Type_p) {
- EntriesLen += get_uint32_string_le((void **)&source_p[i].Type_p);
- } else {
- EntriesLen += sizeof(uint32);
- }
-
- EntriesLen += sizeof(uint64) + sizeof(uint64) + sizeof(uint64);
- }
- }
-
- return EntriesLen;
-}
-
-void serialize_device_entries(void **data_pp, const ListDevice_t *source_p, uint32 DeviceEntriesCount)
-{
- uint32 PathLen = 0;
- uint32 TypeLen = 0;
- uint32 i = 0;
-
- if (DeviceEntriesCount > 0) {
- for (i = 0; i < DeviceEntriesCount; i++) {
- if (NULL != source_p[i].Path_p) {
- PathLen = get_uint32_string_le((void **)&source_p[i].Path_p);
- memcpy(*data_pp, source_p[i].Path_p, PathLen);
- *(const uint8 **)data_pp += PathLen;
- } else {
- memset(*data_pp, 0x00, sizeof(char *));
- *(const uint8 **)data_pp += sizeof(char *);
- }
-
- if (NULL != source_p[i].Type_p) {
- TypeLen = get_uint32_string_le((void **)&source_p[i].Type_p);
- memcpy(*data_pp, source_p[i].Type_p, TypeLen);
- *(const uint8 **)data_pp += TypeLen;
- } else {
- memset(*data_pp, 0x00, sizeof(char *));
- *(const uint8 **)data_pp += sizeof(char *);
- }
-
- memcpy(*data_pp, &source_p[i].BlockSize, sizeof(uint64));
- *(const uint8 **)data_pp += sizeof(uint64);
- memcpy(*data_pp, &source_p[i].Start, sizeof(uint64));
- *(const uint8 **)data_pp += sizeof(uint64);
- memcpy(*data_pp, &source_p[i].Length, sizeof(uint64));
- *(const uint8 **)data_pp += sizeof(uint64);
- }
- }
-}
-
void put_block(void **data_pp, const void *source_p, uint32 length)
{
if (length > 0) {
@@ -324,6 +227,97 @@ void insert_string(char **data_pp, const char *source_p, uint32 length)
memcpy(*data_pp + sizeof(uint32), source_p, length);
}
+#if defined(CFG_ENABLE_LOADER_SERIALIZATION)
+uint32 get_directory_entries_len(const DirEntry_t *source_p, uint32 DirectoryEntriesCount)
+{
+ uint32 EntriesLen = 0;
+ uint32 i = 0;
+
+ for (i = 0; i < DirectoryEntriesCount; i++) {
+ EntriesLen += get_uint32_string_le((void **)&source_p[i].Name_p);
+ EntriesLen += sizeof(uint32) + sizeof(uint32) + sizeof(uint64);
+ }
+
+ return EntriesLen;
+}
+
+void serialize_directory_entries(void **data_pp, const DirEntry_t *source_p, uint32 DirectoryEntriesCount)
+{
+ uint32 NameLength = 0;
+ uint32 i = 0;
+
+ for (i = 0; i < DirectoryEntriesCount; i++) {
+ NameLength = get_uint32_string_le((void **)&source_p[i].Name_p);
+ memcpy(*data_pp, source_p[i].Name_p, NameLength);
+ *(const uint8 **)data_pp += NameLength;
+ memcpy(*data_pp, &source_p[i].Size, sizeof(uint64));
+ *(const uint8 **)data_pp += sizeof(uint64);
+ memcpy(*data_pp, &source_p[i].Mode, sizeof(uint32));
+ *(const uint8 **)data_pp += sizeof(uint32);
+ memcpy(*data_pp, &source_p[i].Time, sizeof(uint32));
+ *(const uint8 **)data_pp += sizeof(uint32);
+ }
+}
+
+uint32 get_device_entries_len(const ListDevice_t *source_p, uint32 DeviceEntriesCount)
+{
+ uint32 EntriesLen = 0;
+ uint32 i = 0;
+
+ for (i = 0; i < DeviceEntriesCount; i++) {
+ if (NULL != source_p[i].Path_p) {
+ EntriesLen += get_uint32_string_le((void **)&source_p[i].Path_p);
+ } else {
+ EntriesLen += sizeof(uint32);
+ }
+
+ if (NULL != source_p[i].Type_p) {
+ EntriesLen += get_uint32_string_le((void **)&source_p[i].Type_p);
+ } else {
+ EntriesLen += sizeof(uint32);
+ }
+
+ EntriesLen += sizeof(uint64) + sizeof(uint64) + sizeof(uint64);
+ }
+
+ return EntriesLen;
+}
+
+void serialize_device_entries(void **data_pp, const ListDevice_t *source_p, uint32 DeviceEntriesCount)
+{
+ uint32 PathLen = 0;
+ uint32 TypeLen = 0;
+ uint32 i = 0;
+
+ for (i = 0; i < DeviceEntriesCount; i++) {
+ if (NULL != source_p[i].Path_p) {
+ PathLen = get_uint32_string_le((void **)&source_p[i].Path_p);
+ memcpy(*data_pp, source_p[i].Path_p, PathLen);
+ *(const uint8 **)data_pp += PathLen;
+ } else {
+ memset(*data_pp, 0x00, sizeof(char *));
+ *(const uint8 **)data_pp += sizeof(char *);
+ }
+
+ if (NULL != source_p[i].Type_p) {
+ TypeLen = get_uint32_string_le((void **)&source_p[i].Type_p);
+ memcpy(*data_pp, source_p[i].Type_p, TypeLen);
+ *(const uint8 **)data_pp += TypeLen;
+ } else {
+ memset(*data_pp, 0x00, sizeof(char *));
+ *(const uint8 **)data_pp += sizeof(char *);
+ }
+
+ memcpy(*data_pp, &source_p[i].BlockSize, sizeof(uint64));
+ *(const uint8 **)data_pp += sizeof(uint64);
+ memcpy(*data_pp, &source_p[i].Start, sizeof(uint64));
+ *(const uint8 **)data_pp += sizeof(uint64);
+ memcpy(*data_pp, &source_p[i].Length, sizeof(uint64));
+ *(const uint8 **)data_pp += sizeof(uint64);
+ }
+}
+#endif
+
/* @} */
/* @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml b/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml
index b2ad470..171df8f 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/a2_commands.xml
@@ -9,14 +9,13 @@
<?xml-stylesheet type="text/xml" href="a2_commands_impl_h.xsl"?>
<?xml-stylesheet type="text/xml" href="a2_common.xsl"?>
-
<commandspec>
<AuthenticationList>
<value number="1" name="A1">A1</value>
<value number="2" name="CA">CA</value>
</AuthenticationList>
-
+
<PermissionList>
<value number="0" name="Permission1">Permission1</value>
<value number="2" name="Permission2">Permission2</value>
@@ -43,19 +42,19 @@
A2 System commands group (0x01)
</documentation>
<interface type="loader" name="A2_System"/>
-
+
<command number="101" name="TestCommand" source="PC">
<interface type="loader" name="TestCommand"/>
<documentation>
Performs controlled power down of the ME.
</documentation>
<input>
- <value type="uint32" name="EnglandLength"/>
- <value type="string" name="Sweden"/>
+ <value type="uint32" name="EnglandLength"/>
+ <value type="string" name="Sweden"/>
<value type="uint32" name="GermanyLength"/>
- <value type="uint32" name="France"/>
- <value type="buffer" name="Germany" length="GermanyLength"/>
- <value type="buffer" name="England" length="EnglandLength"/>
+ <value type="uint32" name="France"/>
+ <value type="buffer" name="Germany" length="GermanyLength"/>
+ <value type="buffer" name="England" length="EnglandLength"/>
</input>
<output>
<value type="uint32" name="AfricaLength"/>
@@ -72,12 +71,12 @@
The Loader shuts down in a controlled fashion and proceeds to shut down the ME itself.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ShutdownIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ShutdownIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="ShutdownOutLenght">Loader version length</value>
- <value type="buffer" name="ShutdownOut" length="ShutdownOutLenght">No data</value>
+ <value type="uint32" name="ShutdownOutLenght">Loader version length</value>
+ <value type="buffer" name="ShutdownOut" length="ShutdownOutLenght">No data</value>
</output>
</command>
@@ -87,42 +86,42 @@
The Loader Version command is sent by the PC to request version information from the loader. The ME responds with a Loader Version information coded as ASCII characters in the data field.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="LoaderVersionIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="LoaderVersionIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="LVLength">Loader version length</value>
+ <value type="uint32" name="LVLength">Loader version length</value>
<value type="buffer" name="LoaderVersionOut" length="LVLength">Loader version identifier</value>
</output>
</command>
-
+
<command number="3" name="Protocol Version" source="PC">
<interface type="loader" name="ProtocolVersion"/>
<documentation>
The Protocol Version command is sent by the PC to request the application protocol version information from the loader. The ME responds with two bytes holding the major and the minor version respectively.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ProtocolVersionIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ProtocolVersionIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="PVLength">Protocol version length</value>
+ <value type="uint32" name="PVLength">Protocol version length</value>
<value type="buffer" name="ProtocolVersionOut" length="PVLength">Protocol version identifier</value>
</output>
</command>
-
+
<command number="5" name="System Supported Command groups" source="PC">
<interface type="loader" name="SupportedCommandGroups"/>
<documentation>
The Loader returns a list of implemented command groups and whether they are permitted to execute in the current Loader state.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="CommandGroupsIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="CommandGroupsIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="CommandGroupsOutLength">Supported Groups length</value>
- <value type="buffer" name="CommandGroupsOut" length="CommandGroupsOutLength">Each byte of the string represents a supported command group.</value>
+ <value type="uint32" name="CommandGroupsOutLength">Supported Groups length</value>
+ <value type="buffer" name="CommandGroupsOut" length="CommandGroupsOutLength">Each byte of the string represents a supported command group.</value>
</output>
</command>
@@ -132,44 +131,44 @@
This command is sent by the PC to request a Platform Property, by sending a PropertyID in the data field. The ME responds with the Property value.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="GetPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
- <value type="buffer" name="GetPropertyOut" length="GetPropertyOutLength"/>
- </output>
+ <value type="uint32" name="GetPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
+ <value type="buffer" name="GetPropertyOut" length="GetPropertyOutLength"/>
+ </output>
</command>
<command number="8" name="Get Memory Property" source="PC">
<interface type="loader" name="GetMemoryProperty"/>
<documentation>
- This command is sent by the PC to request a Memory Property. The ME responds with the Memory Property value.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetMemPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="GetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
- <value type="buffer" name="GetMemPropertyOut" length="GetMemPropertyOutLength"/>
- </output>
- </command>
-
- <command number="9" name="Set Memory Property" source="PC">
- <interface type="loader" name="SetMemoryProperty"/>
- <documentation>
- This command is sent by the PC to set a Memory Property.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SetMemPropertyIn" length="CmdData_p-&gt;Payload.Size">The MemoryPropertyPayload buffer holds the Memory Propertiy ID and the Memory Property value. The size of the MemoryPropertyValue depends on the PropertyID</value>
- </input>
- <output>
- <value type="uint32" name="SetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
- <value type="buffer" name="SetMemPropertyOut" length="SetMemPropertyOutLength"/>
- </output>
- </command>
+ This command is sent by the PC to request a Memory Property. The ME responds with the Memory Property value.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetMemPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="GetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
+ <value type="buffer" name="GetMemPropertyOut" length="GetMemPropertyOutLength"/>
+ </output>
+ </command>
+
+ <command number="9" name="Set Memory Property" source="PC">
+ <interface type="loader" name="SetMemoryProperty"/>
+ <documentation>
+ This command is sent by the PC to set a Memory Property.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SetMemPropertyIn" length="CmdData_p-&gt;Payload.Size">The MemoryPropertyPayload buffer holds the Memory Propertiy ID and the Memory Property value. The size of the MemoryPropertyValue depends on the PropertyID</value>
+ </input>
+ <output>
+ <value type="uint32" name="SetMemPropertyOutLength">The size of the PropertyValue depends on the PropertyID</value>
+ <value type="buffer" name="SetMemPropertyOut" length="SetMemPropertyOutLength"/>
+ </output>
+ </command>
<command number="15" name="Read Security Data" source="PC">
<interface type="loader" name="ReadSecurityData"/>
@@ -177,93 +176,92 @@
This command is used in a Flashless bridge configuration. It returns the Static data and all dinamic variables cretaed during the signing process.
</documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SecurityDataIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SecurityDataIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="SecurityDataOutLength"/>
- <value type="buffer" name="SecurityDataOut" length="SecurityDataOutLength"/>
- </output>
- </command>
-
- <command number="17" name="Loader on Loader" source="PC">
- <interface type="loader" name="LoaderOnLoader"/>
- <documentation>
- This command is used to transfer a new Loader to the ME. The data should hold either Header or Payload.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="LOLIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="LOLOutLength"/>
- <value type="buffer" name="LOLOut" length="LOLOutLength"/>
- </output>
- </command>
-
- <command number="19" name="Reset" source="PC">
- <interface type="loader" name="Reset"/>
- <documentation>
- The Reset command is used to instruct the Loader to reset the ME. Upon receiving this command, the Loader shuts down in a controlled fashion and restarts the ME.
- </documentation>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ResetIn" length="CmdData_p-&gt;Payload.Size">The ResetTimeout value is in ms.</value>
- </input>
- <output>
- <value type="uint32" name="ResetOutLength"/>
- <value type="buffer" name="ResetOut" length="ResetOutLength"/>
- </output>
- </command>
+ <value type="uint32" name="SecurityDataOutLength"/>
+ <value type="buffer" name="SecurityDataOut" length="SecurityDataOutLength"/>
+ </output>
+ </command>
+
+ <command number="17" name="Loader on Loader" source="PC">
+ <interface type="loader" name="LoaderOnLoader"/>
+ <documentation>
+ This command is used to transfer a new Loader to the ME. The data should hold either Header or Payload.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="LOLIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="LOLOutLength"/>
+ <value type="buffer" name="LOLOut" length="LOLOutLength"/>
+ </output>
+ </command>
+
+ <command number="19" name="Reset" source="PC">
+ <interface type="loader" name="Reset"/>
+ <documentation>
+ The Reset command is used to instruct the Loader to reset the ME. Upon receiving this command, the Loader shuts down in a controlled fashion and restarts the ME.
+ </documentation>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ResetIn" length="CmdData_p-&gt;Payload.Size">The ResetTimeout value is in ms.</value>
+ </input>
+ <output>
+ <value type="uint32" name="ResetOutLength"/>
+ <value type="buffer" name="ResetOut" length="ResetOutLength"/>
+ </output>
+ </command>
<command number="20" name="Simlock Authentication Request" source="PC">
<interface type="loader" name="SimlockAuthenticationRequest"/>
<documentation>
- This command is sent by the PC to set the SIM Lock Keys.
- </documentation>
+ This command is sent by the PC to set the SIM Lock Keys.
+ </documentation>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SIMLockAuthReqIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
- </input>
- <output>
- <value type="uint32" name="SIMLockAuthReqOutLength"/>
- <value type="buffer" name="SIMLockAuthReqOut" length="SIMLockAuthReqOutLength"/>
- </output>
- </command>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SIMLockAuthReqIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
+ </input>
+ <output>
+ <value type="uint32" name="SIMLockAuthReqOutLength"/>
+ <value type="buffer" name="SIMLockAuthReqOut" length="SIMLockAuthReqOutLength"/>
+ </output>
+ </command>
+ </group>
-</group>
+ <group number="2" name="A2 Flash group">
+ <documentation>
+ A2 Flash Commands group (0x02)
+ </documentation>
+ <interface type="loader" name="A2_Flash"/>
-<group number="2" name="A2 Flash group">
- <documentation>
- A2 Flash Commands group (0x02)
- </documentation>
- <interface type="loader" name="A2_Flash"/>
-
<command number="1" name="Verify Signed Header" flag="true1" source="PC">
<documentation>
</documentation>
<interface type="loader" name="VerifySignedHeader"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="VerifyHeaderIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="VerifyHeaderOutLength"/>
- <value type="buffer" name="VerifyHeaderOut" length="VerifyHeaderOutLength"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="VerifyHeaderIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="VerifyHeaderOutLength"/>
+ <value type="buffer" name="VerifyHeaderOut" length="VerifyHeaderOutLength"/>
</output>
</command>
<command number="2" name="Software Block Address" flag="true1" source="PC">
- <documentation>
+ <documentation>
</documentation>
<interface type="loader" name="SoftwareBlockAddress"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SoftBlockAddIn" length="CmdData_p-&gt;Payload.Size">There are two parameters in the input buffer: Start address and Block size, both 4 bytes long.</value>
- </input>
- <output>
- <value type="uint32" name="SoftBlockAddOutLength"/>
- <value type="buffer" name="SoftBlockAddOut" length="SoftBlockAddOutLength"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SoftBlockAddIn" length="CmdData_p-&gt;Payload.Size">There are two parameters in the input buffer: Start address and Block size, both 4 bytes long.</value>
+ </input>
+ <output>
+ <value type="uint32" name="SoftBlockAddOutLength"/>
+ <value type="buffer" name="SoftBlockAddOut" length="SoftBlockAddOutLength"/>
</output>
</command>
@@ -272,44 +270,43 @@
</documentation>
<interface type="loader" name="ProgramFlash"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="ProgramFlashIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="ProgramFlashOutLength"/>
- <value type="buffer" name="ProgramFlashOut" length="ProgramFlashOutLength"/>
- </output>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="ProgramFlashIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="ProgramFlashOutLength"/>
+ <value type="buffer" name="ProgramFlashOut" length="ProgramFlashOutLength"/>
+ </output>
</command>
<command number="4" name="Verify Software Flash" flag="true1" source="PC">
<documentation>
</documentation>
<interface type="loader" name="VerifySoftwareFlash"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="VerifySoftwareFlashIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="VerifySoftwareFlashOutLength"/>
- <value type="buffer" name="VerifySoftwareFlashOut" length="VerifySoftwareFlashOutLength"/>
- </output>
- </command>
-
- <command number="5" name="Dump Flash Image" flag="true1" source="PC">
- <documentation>
- This command is used to readp from the flash. The input parameters buffer holds: Logical Unit number = 4 bits, Start address = 28 bits and End address = 4 bytes.
- </documentation>
- <interface type="loader" name="DumpFlashImage"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="DumpFlashImageIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="DumpFlashImageOutLength"/>
- <value type="buffer" name="DumpFlashImageOut" length="DumpFlashImageOutLength"/>
- </output>
- </command>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="VerifySoftwareFlashIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="VerifySoftwareFlashOutLength"/>
+ <value type="buffer" name="VerifySoftwareFlashOut" length="VerifySoftwareFlashOutLength"/>
+ </output>
+ </command>
+ <command number="5" name="Dump Flash Image" flag="true1" source="PC">
+ <documentation>
+ This command is used to readp from the flash. The input parameters buffer holds: Logical Unit number = 4 bits, Start address = 28 bits and End address = 4 bytes.
+ </documentation>
+ <interface type="loader" name="DumpFlashImage"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="DumpFlashImageIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="DumpFlashImageOutLength"/>
+ <value type="buffer" name="DumpFlashImageOut" length="DumpFlashImageOutLength"/>
+ </output>
+ </command>
</group>
<group number="3" name="A2 GDFS group">
@@ -323,21 +320,20 @@
</documentation>
<interface type="loader" name="GetGDFSProperty"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetGDFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetGDFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="GetGDFSPropertyOutLength"/>
- <value type="buffer" name="GetGDFSPropertyOut" length="GetGDFSPropertyOutLength"/>
+ <value type="uint32" name="GetGDFSPropertyOutLength"/>
+ <value type="buffer" name="GetGDFSPropertyOut" length="GetGDFSPropertyOutLength"/>
</output>
</command>
-
</group>
<group number="4" name="File system group">
<documentation>
- A2 File system commands Group (0x04)
- </documentation>
+ A2 File system commands Group (0x04)
+ </documentation>
<interface type="loader" name="A2_File_System"/>
<command number="1" name="Get File System Property" flag="true1" source="PC">
@@ -345,63 +341,62 @@
</documentation>
<interface type="loader" name="GetFileSystemProperty"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="GetFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="GetFSPropertyOutLength"/>
- <value type="buffer" name="GetFSPropertyOut" length="GetFSPropertyOutLength"/>
- </output>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="GetFSPropertyIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="GetFSPropertyOutLength"/>
+ <value type="buffer" name="GetFSPropertyOut" length="GetFSPropertyOutLength"/>
+ </output>
</command>
-
</group>
<group number="5" name="Signature group">
<documentation>
- A2 Signature Commands Group (0x05)
- </documentation>
+ A2 Signature Commands Group (0x05)
+ </documentation>
<interface type="loader" name="A2_Signature"/>
<command number="1" name="Set Control Keys" flag="true1" source="PC">
<documentation>
- This command is used to write the SIM Lock control keys.
+ This command is used to write the SIM Lock control keys.
</documentation>
<interface type="loader" name="SetControlKeys"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SetControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
- </input>
- <output>
- <value type="uint32" name="SetControlKeysOutLength"/>
- <value type="buffer" name="SetControlKeysOut" length="SetControlKeysOutLength"/>
- </output>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SetControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
+ </input>
+ <output>
+ <value type="uint32" name="SetControlKeysOutLength"/>
+ <value type="buffer" name="SetControlKeysOut" length="SetControlKeysOutLength"/>
+ </output>
</command>
<command number="2" name="Set Platform Property" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="SetPlatformProperty"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SetPlatformPropertyIn" length="CmdData_p-&gt;Payload.Size">The SetPlatformPropertyIn buffer holds the Platform Property ID and the Platform property value. The size of the Platform Property ID is 4 bytes and the size of the Platform Property Value depends on the PropertyID</value>
- </input>
- <output>
- <value type="uint32" name="SetPlatformPropertyOutLength"/>
- <value type="buffer" name="SetPlatformPropertyOut" length="SetPlatformPropertyOutLength"/>
- </output>
- </command>
-
- <command number="3" name="Write and Lock OTP" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="SetPlatformProperty"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SetPlatformPropertyIn" length="CmdData_p-&gt;Payload.Size">The SetPlatformPropertyIn buffer holds the Platform Property ID and the Platform property value. The size of the Platform Property ID is 4 bytes and the size of the Platform Property Value depends on the PropertyID</value>
+ </input>
+ <output>
+ <value type="uint32" name="SetPlatformPropertyOutLength"/>
+ <value type="buffer" name="SetPlatformPropertyOut" length="SetPlatformPropertyOutLength"/>
+ </output>
+ </command>
+
+ <command number="3" name="Write and Lock OTP" flag="true1" source="PC">
<documentation>
</documentation>
<interface type="loader" name="WriteAndLockOTP"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteAndLockOTPIn" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteAndLockOTPIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="WriteAndLockOTPOutLength"/>
- <value type="buffer" name="WriteAndLockOTPOut" length="WriteAndLockOTPOutLength"/>
+ <value type="uint32" name="WriteAndLockOTPOutLength"/>
+ <value type="buffer" name="WriteAndLockOTPOut" length="WriteAndLockOTPOutLength"/>
</output>
</command>
@@ -410,156 +405,155 @@
</documentation>
<interface type="loader" name="WriteDefaultData"/>
<input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteDefaultDataIn" length="CmdData_p-&gt;Payload.Size">The WriteDefaultDataIn buffer holds the Unit number,the Unit size and Unit data</value>
- </input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteDefaultDataIn" length="CmdData_p-&gt;Payload.Size">The WriteDefaultDataIn buffer holds the Unit number,the Unit size and Unit data</value>
+ </input>
<output>
- <value type="uint32" name="WriteDefaultDataOutLength"/>
- <value type="buffer" name="WriteDefaultDataOut" length="WriteDefaultDataOutLength"/>
+ <value type="uint32" name="WriteDefaultDataOutLength"/>
+ <value type="buffer" name="WriteDefaultDataOut" length="WriteDefaultDataOutLength"/>
</output>
</command>
<command number="5" name="Write Full Signature" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="WriteFullSignature"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteFullSignIn" length="CmdData_p-&gt;Payload.Size"/>
+ <documentation>
+ </documentation>
+ <interface type="loader" name="WriteFullSignature"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteFullSignIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="WriteFullSignOutLength"/>
- <value type="buffer" name="WriteFullSignOut" length="WriteFullSignOutLength"/>
+ <value type="uint32" name="WriteFullSignOutLength"/>
+ <value type="buffer" name="WriteFullSignOut" length="WriteFullSignOutLength"/>
</output>
</command>
- <command number="6" name="Write CID" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="WriteCID"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteCIDIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="WriteCIDOutLength"/>
- <value type="buffer" name="WriteCIDOut" length="WriteCIDOutLength"/>
- </output>
+ <command number="6" name="Write CID" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="WriteCID"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteCIDIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="WriteCIDOutLength"/>
+ <value type="buffer" name="WriteCIDOut" length="WriteCIDOutLength"/>
+ </output>
</command>
<command number="7" name="Write Test Signature" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="WriteTestSignature"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="WriteTestSignIn" length="CmdData_p-&gt;Payload.Size"/>
+ <documentation>
+ </documentation>
+ <interface type="loader" name="WriteTestSignature"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="WriteTestSignIn" length="CmdData_p-&gt;Payload.Size"/>
</input>
<output>
- <value type="uint32" name="WriteTestSignOutLength"/>
- <value type="buffer" name="WriteTestSignOut" length="WriteTestSignOutLength"/>
+ <value type="uint32" name="WriteTestSignOutLength"/>
+ <value type="buffer" name="WriteTestSignOut" length="WriteTestSignOutLength"/>
</output>
</command>
- <command number="8" name="Erase Security Data" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="EraseSecurityData"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="EraseSecDataIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="EraseSecDataOutLength"/>
- <value type="buffer" name="EraseSecDataOut" length="EraseSecDataOutLength"/>
- </output>
- </command>
-
- <command number="9" name="Key Sharing Stage 1 Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="KeySharingStage1Request"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="KeySharStage1ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage1ReqIn buffer holds the Version (1 byte), the ID (4 bytes) and Random Value (24 bytes)</value>
- </input>
- <output>
- <value type="uint32" name="KeySharStage1ReqOutLength"/>
- <value type="buffer" name="KeySharStage1ReqOut" length="KeySharStage1ReqOutLength"/>
- </output>
- </command>
-
- <command number="10" name="Key Sharing Stage 2 Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="KeySharingStage2Request"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="KeySharStage2ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage2ReqIn buffer holds the ID (4 bytes), the Cipher (1 byte), the CertificateLength (4 bytes) and Certificate (CertificateLength)</value>
- </input>
- <output>
- <value type="uint32" name="KeySharStage2ReqOutLength"/>
- <value type="buffer" name="KeySharStage2ReqOut" length="KeySharStage2ReqOutLength"/>
- </output>
- </command>
-
- <command number="11" name="Key Sharing Stage 3 Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="KeySharingStage3Request"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="KeySharStage3ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage3ReqIn buffer holds the ID (4 bytes), C2 (16 bytes) and MAC (20 bytes).</value>
- </input>
- <output>
- <value type="uint32" name="KeySharStage3ReqOutLength"/>
- <value type="buffer" name="KeySharStage3ReqOut" length="KeySharStage3ReqOutLength"/>
- </output>
- </command>
-
- <command number="12" name="DRM Secure Storage Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="DRMSecureStorageRequest"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="DRMSecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="DRMSecStorReqOutLength"/>
- <value type="buffer" name="DRMSecStorReqOut" length="DRMSecStorReqOutLength"/>
- </output>
- </command>
-
- <command number="14" name="Verify Control Keys" flag="true1" source="PC">
- <documentation>
- This command is used to compare received SIM Lock keys against the SIM Lock keys stored in the ME.
- </documentation>
- <interface type="loader" name="VerifyControlKeys"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="VerifyControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
- </input>
- <output>
- <value type="uint32" name="VerifyControlKeysOutLength"/>
- <value type="buffer" name="VerifyControlKeysOut" length="VerifyControlKeysOutLength"/>
- </output>
+ <command number="8" name="Erase Security Data" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="EraseSecurityData"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="EraseSecDataIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="EraseSecDataOutLength"/>
+ <value type="buffer" name="EraseSecDataOut" length="EraseSecDataOutLength"/>
+ </output>
+ </command>
+
+ <command number="9" name="Key Sharing Stage 1 Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="KeySharingStage1Request"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="KeySharStage1ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage1ReqIn buffer holds the Version (1 byte), the ID (4 bytes) and Random Value (24 bytes)</value>
+ </input>
+ <output>
+ <value type="uint32" name="KeySharStage1ReqOutLength"/>
+ <value type="buffer" name="KeySharStage1ReqOut" length="KeySharStage1ReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="10" name="Key Sharing Stage 2 Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="KeySharingStage2Request"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="KeySharStage2ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage2ReqIn buffer holds the ID (4 bytes), the Cipher (1 byte), the CertificateLength (4 bytes) and Certificate (CertificateLength)</value>
+ </input>
+ <output>
+ <value type="uint32" name="KeySharStage2ReqOutLength"/>
+ <value type="buffer" name="KeySharStage2ReqOut" length="KeySharStage2ReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="11" name="Key Sharing Stage 3 Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="KeySharingStage3Request"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="KeySharStage3ReqIn" length="CmdData_p-&gt;Payload.Size">The KeySharStage3ReqIn buffer holds the ID (4 bytes), C2 (16 bytes) and MAC (20 bytes).</value>
+ </input>
+ <output>
+ <value type="uint32" name="KeySharStage3ReqOutLength"/>
+ <value type="buffer" name="KeySharStage3ReqOut" length="KeySharStage3ReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="12" name="DRM Secure Storage Request" flag="true1" source="PC">
+ <documentation>
+ </documentation>
+ <interface type="loader" name="DRMSecureStorageRequest"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="DRMSecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="DRMSecStorReqOutLength"/>
+ <value type="buffer" name="DRMSecStorReqOut" length="DRMSecStorReqOutLength"/>
+ </output>
+ </command>
+
+ <command number="14" name="Verify Control Keys" flag="true1" source="PC">
+ <documentation>
+ This command is used to compare received SIM Lock keys against the SIM Lock keys stored in the ME.
+ </documentation>
+ <interface type="loader" name="VerifyControlKeys"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="VerifyControlKeysIn" length="CmdData_p-&gt;Payload.Size">There are 12 SIM Lock Keys, each represented with a 16 bytes long string.</value>
+ </input>
+ <output>
+ <value type="uint32" name="VerifyControlKeysOutLength"/>
+ <value type="buffer" name="VerifyControlKeysOut" length="VerifyControlKeysOutLength"/>
+ </output>
</command>
<command number="16" name="Secure Storage Request" flag="true1" source="PC">
- <documentation>
- </documentation>
- <interface type="loader" name="SecureStorageRequest"/>
- <input>
- <value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="SecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
- <output>
- <value type="uint32" name="SecStorReqOutLength"/>
- <value type="buffer" name="SecStorReqOut" length="SecStorReqOutLength"/>
- </output>
- </command>
-
+ <documentation>
+ </documentation>
+ <interface type="loader" name="SecureStorageRequest"/>
+ <input>
+ <value type="uint32" name="PayloadSize">Application packet length</value>
+ <value type="buffer" name="SecStorReqIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
+ <output>
+ <value type="uint32" name="SecStorReqOutLength"/>
+ <value type="buffer" name="SecStorReqOut" length="SecStorReqOutLength"/>
+ </output>
+ </command>
</group>
<group number="7" name="Reset group">
@@ -575,11 +569,11 @@
</documentation>
<input>
<value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="InitRequestIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
+ <value type="buffer" name="InitRequestIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
<output>
- <value type="uint32" name="InitRequestOutLength"/>
- <value type="buffer" name="InitRequestOut" length="InitRequestOutLength"/>
+ <value type="uint32" name="InitRequestOutLength"/>
+ <value type="buffer" name="InitRequestOut" length="InitRequestOutLength"/>
</output>
</command>
@@ -589,16 +583,15 @@
</documentation>
<input>
<value type="uint32" name="PayloadSize">Application packet length</value>
- <value type="buffer" name="UpdateRequestIn" length="CmdData_p-&gt;Payload.Size"/>
- </input>
+ <value type="buffer" name="UpdateRequestIn" length="CmdData_p-&gt;Payload.Size"/>
+ </input>
<output>
- <value type="uint32" name="UpdateRequestOutLength"/>
- <value type="buffer" name="UpdateRequestOut" length="UpdateRequestOutLength"/>
+ <value type="uint32" name="UpdateRequestOutLength"/>
+ <value type="buffer" name="UpdateRequestOut" length="UpdateRequestOutLength"/>
</output>
</command>
-
</group>
-
+
<group number="16" name="Control massage">
<documentation>
A2 Control massage (0x10)
@@ -611,11 +604,11 @@
<documentation>
</documentation>
<input>
- <value type="uint32" name="LoaderStartedInLength"/>
- <value type="buffer" name="LoaderStartedIn" length="LoaderStartedInLength"/>
+ <value type="uint32" name="LoaderStartedInLength"/>
+ <value type="buffer" name="LoaderStartedIn" length="LoaderStartedInLength"/>
</input>
<output>
- <value type="buffer" name="LoaderStartedOut" length="CmdData_p-&gt;Payload.Size"/>
+ <value type="buffer" name="LoaderStartedOut" length="CmdData_p-&gt;Payload.Size"/>
</output>
</command>
@@ -631,7 +624,6 @@
<value type="buffer" name="LoaderNotStartedOut" length="CmdData_p-&gt;Payload.Size"/>
</output>
</command>
-
</group>
-
+
</commandspec>
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl b/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl
index fbc00fc..db730d7 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/audit_c.xsl
@@ -205,9 +205,9 @@ CommandPermissionList_t * GetAuditData(CommandData_t * CmdData_p)
boolean A1_RD = FALSE;
boolean A1_Product = FALSE;
boolean A1_Service = FALSE;
-
+
uint8 A1_depandancy = 0x00;
-
+
uint32 AuthenticationVector = 0; */
int CounterList = 0;
@@ -228,7 +228,7 @@ ErrorCode_e CommandAudit(CommandData_t * CmdData_p)
{
ErrorCode_e ReturnValue = E_GENERAL_FATAL_ERROR;
CommandPermissionList_t* CmdPermission_p = NULL;
-
+
CmdPermission_p = GetAuditData(CmdData_p);
if(NULL == CmdPermission_p)
{
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl b/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl
index e351827..5e7842a 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/command_marshal.xsl
@@ -167,14 +167,14 @@ void disable_interrupt(void)
#ifndef WIN32
/* todo implement this */
//#warning This is disable_interrupt
-#endif
+#endif
}
void enable_interrupt(void)
{
#ifndef WIN32
/* todo implement this */
//#warning This is enable_interrupt
-#endif
+#endif
}
ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
@@ -194,13 +194,13 @@ ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
// ResponseStatus = (ErrorCode_e)get_uint16(&amp;Data_p);
}
-#ifdef CFG_ENABLE_AUDIT_CMD
+#ifdef CFG_ENABLE_AUDIT_CMD
if(COMMAND_TYPE == CmdData_p-&gt;Type)
{
ErrorCode_e AuditResponse = CommandAudit(CmdData_p);
CommandData_t CmdData = {0};
uint32 PLSize = sizeof(ErrorCode_e);
-
+
if (E_SUCCESS != AuditResponse)
{
memset((uint8*)&amp;CmdData, 0x00, sizeof(CommandData_t));
@@ -217,10 +217,10 @@ ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
A_(printf("command_marshal.c (%d): ** memory allocation failed! **\n",__LINE__);)
return E_ALLOCATE_FAILED;
}
-
+
Data_p = CmdData.Payload.Data_p;
put_uint32(&amp;Data_p, AuditResponse);
-
+
Status = Do_R15_Command_Send(GlobalCommunication_p, &amp;CmdData);
if (NULL != CmdData.Payload.Data_p)
{
@@ -240,12 +240,12 @@ ErrorCode_e Do_CEH_Call(void *Object_p, CommandData_t *CmdData_p)
}
}
#endif
-
+
switch(COMMAND(response, CmdData_p-&gt;ApplicationNr, CmdData_p-&gt;CommandNr))
{
<apply-templates select="group" mode="unmarshal"/>
default:
- {
+ {
Status = Do_CustomCEH_Call(CmdData_p);
if (E_SUCCESS != Status)
{
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml b/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml
index 138c902..7435367 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/config/error_codes.xml
@@ -12,11 +12,11 @@
<value number="0" name="E_SUCCESS" fatal="false" short="Operation successful."> Operation finished successfully.</value>
<value number="1" name="E_GENERAL_FATAL_ERROR" fatal="true" short="General Failure."> Unknown error.</value>
<value number="2" name="E_ALLOCATE_FAILED" fatal="true" short="Failed to allocate memory."> Try to reset the loader and if problem still exist, report it.</value>
-
+
<value number="51" name="E_INVALID_INPUT_PARAMETERS" fatal="false" short="The expected value into the function was incorrect."> Check the input parameters in the command that you try to execute. Repeat operation. Report if problem is not solved.</value>
<value number="52" name="E_INVALID_CURRDATE_STRING_LENGTH" fatal="false" short="Indicate that the currdate string array variable has invalid length."> Try to reset the loader and if problem still exist, report this error.</value>
<value number="53" name="E_UNALIGNED_DATA" fatal="false" short="Indicate that a variable is not aligned."> Try to reset the loader and if still exist the problem, report this error.</value>
-
+
<!--
* IO Fatal 100-150
* IO non-fatal 151-199
@@ -190,7 +190,7 @@
<value number="989" name="E_FAILED_TO_FIND_ELF_SECTION" fatal="false" short="Can not find elf section."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="990" name="E_MAX_NUMBER_OF_MOUNTED_VOLUMES_EXCEEDED" fatal="false" short="Unable to mount volume due to exceeding the maximum number of allowed volumes.">First check the defined number of volumes in the flasharchive. If it is lower than maximum allowed volumes repeat the operation or reset loader. Report if problem still exist </value>
<value number="991" name="E_NO_MOUNTED_DEVICES_ARE_FOUND" fatal="false" short="Information message that no mounted devices are found."> This message can be issued in case when is detected that loader is trying to unmount zero mounted devices.</value>
-
+
<!--
* Command Auditing and execution Fatal 1000-1050
* Command Auditing and execution non-fatal 1051-1099
@@ -203,7 +203,7 @@
<value number="1052" name="E_OVERLOAD_COMMAND_TABLE" fatal="false" short="Too many commands are registered."> It is not allowed more than 5 commands to be registered.</value>
<value number="1053" name="E_COMMAND_ALREADY_REGISTERED" fatal="false" short="Command has already registered in execution queue.">It is not allowed the command to be registerd more than once in execution queue</value>
<value number="1054" name="E_AUDITING_FAILED" fatal="false" short=" Command auditing failed."> You should be authenticate with appropriate permission level in order to execute this command.</value>
-
+
<!--
* Timers Fatal 1200-1250
* Timers non-fatal 1251-1299
@@ -263,9 +263,9 @@
<value number="1393" name="E_CSPSA_RESULT_E_ALREADY_EXISTS" fatal="false" short="Parameter storage area with same name was already registered."> Loader internal problem. Report this issue.</value>
<value number="1394" name="E_CSPSA_RESULT_E_OUT_OF_MEMORY" fatal="false" short="There was not enough memory to perform the operation."> Loader internal problem. Report this issue.</value>
<value number="1395" name="E_CSPSA_RESULT_E_BAD_PARAMETER" fatal="false" short="Error because of bad input parameter.">Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
-
+
<value number="1399" name="E_GD_NO_DATA_TO_READ" fatal="false" short="GD: No data to read."> Write something to GD before attempting to read from it. Report this problem if you are shore that GD is not empty.</value>
-
+
<!--
* Block device Fatal 1400-1450
* Block device non-fatal 1451-1499
@@ -297,7 +297,7 @@
<value number="1475" name="E_BDM_PRE_FLASH_FINISHED" fatal="false" short="BDM: No more preflash blocks can be fetched."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1476" name="E_BDM_PRE_FLASH_TERMINATE_FAILED" fatal="false" short="BDM: Termination of preflash failed."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1477" name="E_BDM_OUT_OF_MEM" fatal="false" short="BDM: Could not allocate enough memory."> Internal error. Reset loader. Report if problem still exist.</value>
-
+
<value number="1481" name="E_BDM_XSR_CRITICAL_ERROR" fatal="false" short="BDM XSR: Critical error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1482" name="E_BDM_XSR_INVALID_PARAMS" fatal="false" short="BDM XSR: Invalid parameters."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
<value number="1483" name="E_BDM_XSR_PARTITION_NOT_OPENED" fatal="false" short="BDM XSR: Could not open partition."> Internal error. Reset loader. Report if problem still exist.</value>
@@ -310,7 +310,7 @@
<value number="1490" name="E_BDM_XSR_DEVICE_ERROR" fatal="false" short="BDM XSR: Device error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1491" name="E_BDM_XSR_GOODBLOCK" fatal="false" short="BDM XSR: Good block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
<value number="1492" name="E_BDM_XSR_BADBLOCK" fatal="false" short="BDM XSR: Bad block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
-
+
<!--
* Boot area Fatal 1500-1550
* Boot area non-fatal 1551-1619
@@ -368,7 +368,7 @@
<value number="1607" name="E_BAM_ONLD_DEVICE_ERROR" fatal="false" short="BAM ONLD: Device error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1608" name="E_BAM_ONLD_GOODBLOCK" fatal="false" short="BAM ONLD: Good block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
<value number="1609" name="E_BAM_ONLD_BADBLOCK" fatal="false" short="BAM ONLD: Bad block."> Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
-
+
<!--
* Cops data Fatal 1620-1650
* Cops data non-fatal 1651-1699
@@ -399,7 +399,7 @@
<value number="1674" name="E_COPS_ARGUMENT_ERROR" fatal="false" short="COPS: Argument error!"> Verify the input parameters. Repeat operation. Report if problem still exist.</value>
<value number="1698" name="E_COPS_VERIFY_FAILED" fatal="false" short="COPS: Failed to verify internal data.">Reset loader. Report if problem still exist.</value>
<value number="1699" name="E_COPS_UNDEFINED_ERROR" fatal="false" short="COPS: Undefined error."> Internal error. Reset loader. Report if problem still exist.</value>
-
+
<!--
* PD NAND Fatal 1700-1750
* PD NAND non-fatal 1751-1799
@@ -413,11 +413,10 @@
<value number="1757" name="E_PD_NAND_RESULT_READING_ERASED_PAGE" fatal="false" short="PD NAND: Attempting to read erased page."> Repeat operation. Report if problem still exist.</value>
<value number="1758" name="E_PD_NAND_RESULT_NUMBER_OF_ITEMS" fatal="false" short="PD NAND: Number of valid states of this type."> Repeat operation. Report if problem still exist.</value>
<value number="1759" name="E_PD_NAND_RESULT_UNDEFINED" fatal="false" short="PD NAND: Represents an undefined value of this type."> Repeat operation. Report if problem still exist.</value>
-
+
<!--
* Trim Area non-fatal 1851-1899
-->
-
<value number="1851" name="E_GD_TA_BASE" fatal="false" short="GD/TA: TA base."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="1852" name="E_GD_TA_UNKNOWN_PARTITION" fatal="false" short="GD/TA: Unknown partition."> Check input parameters. Repeat operation with the correct input parameters. Report if problem still exist.</value>
<value number="1853" name="E_GD_TA_UNKNOWN_CONFIG" fatal="false" short="GD/TA: Unknown configuration."> Possible wrong or missing configuration in flash archive. Check the archive. Flash the correct archive. If problem still exist report the problem.</value>
@@ -433,7 +432,7 @@
<value number="1863" name="E_GD_UNKNOWN_UNIT_NAME" fatal="false" short="GD: Unknown unit name."> Check input parameters. Requested unit is not supported. Repeat operation with the correct input parameters. Report if problem still exist.</value>
<value number="1864" name="E_GD_LAST" fatal="false" short="GD: Last enumeration (last valid + 1)."> Reset loader. If problem doesn't solved report it.</value>
-
+
<!--
* Loader utilities Fatal 1900-1950
* Loader utilities non-fatal 1951-1999
@@ -456,7 +455,7 @@
<value number="1966" name="E_DEVICE_TYPE" fatal="false" short="Device type to long."> Check manifest file from flash archive. Repeat operation with correct flash archive. Report if problem still exist.</value>
<value number="1967" name="E_NUMBER_OF_TARGET_DEVICES" fatal="false" short="Number of target devices to big.">Internal error. Reset the loader. Report if problem still exist.</value>
<value number="1968" name="E_DESCRIPTION_TOO_LONG" fatal="false" short="Description field too long.">Internal error. Reset the loader. Report if problem still exist.</value>
-
+
<!--
* Loader ADBG Fatal 2000-2050
* Loader ADBG non-fatal 2051-2099
@@ -471,7 +470,7 @@
<value number="2007" name="E_INT_FUNCTION_LIST_EMPTY" fatal="true" short="There isn't any interface function in interface group."> Use List Interface command to see if there's any available internal function.</value>
<value number="2008" name="E_PRECONDITION_IS_ALREADY_SET" fatal="true" short="Request for setting precondition that is already set."> Precondition is already set. If you want to change it, recover precondition, and than set it again.</value>
<value number="2009" name="E_PRECONDITION_IS_NOT_SET" fatal="true" short="Request to recover condition that is not changed."> You cannot recover condition that is not set before. There's no need of any further activities in order to resolve this problem. Loader will work fine.</value>
-
+
<!--
* OTP applications Fatal 2100-2150
* OTP applications non-fatal 2151-2199
@@ -482,7 +481,7 @@
<value number="2103" name="E_INVALID_CID_VALUE" fatal="true" short="Trying to write invalid CID in OTP."> The value for CID must be in the range from 19 to 16384.0 value is also alowed CID value</value>
<value number="2104" name="E_INIT_OTP_LD_FAILED" fatal="true" short="Failed to initialize OTD logical driver."> Internal error. Reset loader. Report if problem still exist</value>
<value number="2105" name="E_OTP_AREA_LOCKED" fatal="true" short="Requested OTP area is already locked."> It is not allowed to write in already locked OTP area</value>
-
+
<!--
* Security applications Fatal 2200-2250
* Security applications non-fatal 2251-2299
@@ -497,7 +496,7 @@
<value number="2258" name="E_SEC_APP_PATCH_REINSTALLED" fatal="true" short="Operation successful."> ROM Patch in Flash is successfuly reinstalled.</value>
<value number="2259" name="E_SEC_APP_ROOTKEY_EXISTS" fatal="true" short="RootKey is already installed.">.Please make sure that version of Root key is the same with already installed</value>
<value number="2260" name="E_SEC_APP_ROOTKEY_REINSTALLED" fatal="true" short="Operation successful."> Root Key is successfuly reinstalled.</value>
-
+
<!--
* Trim Area Fatal 2300-2350
* Trim Area non-fatal 2351-2499
@@ -514,22 +513,21 @@
<value number="2360" name="E_TA_INSUFFICIANT_SPACE" fatal="false" short="TA: Not enough space to flush the Trim Area."> Internal error. Reset loader. Report if problem still exist</value>
<value number="2361" name="E_TA_UNKNOWN_PARTITION" fatal="false" short="TA: Unknown partition."> Check input parameters. Repeat operation with the correct input parameters. Report if problem still exist.</value>
<value number="2362" name="E_TA_FAIL" fatal="false" short="TA: Fail."> Internal error. Reset loader. Report if problem still exist.</value>
-
+
<value number="2460" name="E_TA_MEDIA_ERROR" fatal="false" short="TA: Media error."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="2461" name="E_TA_NOT_CONFIGURED" fatal="false" short="TA: Error occurs during configuration."> Possible wrong or missing configuration in flash archive. Check the archive. Flash the correct archive. If problem still exist report the problem.</value>
-
+
<!--
* Recovery applications Fatal 2500-2550
* Recovery applications non-fatal 2551-2599
-->
<value number="2500" name="E_REQUEST_DENIED" fatal="true" short="Request for change operation denied."> Init request is twice called and state is changed. Should be sent Update request then can be used Init request again.</value>
<value number="2501" name="E_UNDEFINED_CHANGE_OPERATION" fatal="true" short="Requested change operation is not supported."> Use the implemented change operation.</value>
-
+
<!--
* PD CFI Flash Fatal 2600-2650
* PD CFI Flash non-fatal 2651-2699
-->
-
<value number="2651" name="E_PD_CFI_IN_PROGRESS" fatal="false" short="PD CFI: The operation is in progress. Additional poll calls must be done."></value>
<value number="2652" name="E_PD_CFI_UNKNOWN_REQUEST" fatal="false" short="PD CFI: Type not recognized."> Internal error. Reset loader. Report if problem still exist.</value>
<value number="2653" name="E_PD_CFI_HARDWARE_ERROR" fatal="false" short="PD CFI: Operation could not be completed because of a hardware malfunction."> It is possible that part of the operation has been carried out.</value>
@@ -571,6 +569,27 @@
<value number="2851" name="E_CR_NOT_RUNNING" fatal="false" short="Communication Relay is not running.">Communication relay is set in error state or it is not configured properly. Check the relay state. If error occured restart the loader, otherwise try reconfiguring the relay.</value>
<!--
+ * SDIO Driver SDIO_BSC_Result_t - Error codes for all functions (offset 2900)
+ * SDIO Driver Fatal 2900-2924
+ * SDIO Driver Non-Fatal 2925-2949
+ -->
+ <value number="2901" name="E_SDIO_BSC_RESULT_FAILED" fatal="true" short="General Error.">It is possible to failed to initialize the communication device.Reset loader.Report if problem still exist</value>
+ <value number="2902" name="E_SDIO_BSC_RESULT_FAILED_INVALIDARGS" fatal="true" short="Invalid arguments.">.Check input parameters. Retry operation. If problem still exist reset loader. Report if problem doesn't solved.</value>
+ <value number="2903" name="E_SDIO_BSC_RESULT_FAILED_NOTSUPPORTED" fatal="true" short="Implementation is removed."> Implementation it is not supported anymore.</value>
+ <value number="2904" name="E_SDIO_BSC_RESULT_FAILED_SDIOERR" fatal="true" short="SDIO internal error.">Buffer with unaligned length is requested to be transfered or device driver is confiured to use unsupported frame size.</value>
+ <value number="2905" name="E_SDIO_BSC_RESULT_FAILED_BUSY" fatal="true" short="Communication device is busy.">Current transfer is not finished.</value>
+
+ <!--
+ * SDIO Driver SDIO_BSC_Error_t - Error codes for error callbacks (offset 2950)
+ * SDIO Driver Error Callback Fatal 2950-2974
+ * SDIO Driver Error Callback Non-Fatal 2975-2999
+ -->
+ <value number="2951" name="E_SDIO_BSC_ERROR_TIMEOUT" fatal="true" short="Timeout error.">Incorrect number of bits received.</value>
+ <value number="2952" name="E_SDIO_BSC_ERROR_BREAK" fatal="true" short="Break received.">.Reset loader.Report if problem still exist.</value>
+ <value number="2953" name="E_SDIO_BSC_ERROR_RECEIVE" fatal="true" short="Receive buffer is not provided.">Reset loader.Report if problem still exist.</value>
+ <value number="2954" name="E_SDIO_BSC_ERROR_TRANSMIT" fatal="true" short="Transmit buffer is not provided.">Reset loader.Report if problem still exist.</value>
+
+ <!--
* Security Library Fatal 4000-4050
* Security Library non-fatal 4051-4250
-->
@@ -634,7 +653,7 @@
<value number="4308" name="E_INVALID_A01_FORMAT" fatal="true" short="Something wrong with the A01 file containing the flash image.">Verify that the flash image is valid, otherwise report the problem. </value>
<value number="4309" name="E_A01_BUFFER_FULL" fatal="true" short="Buffer holding the data from the A01 file is full.">Reset loader. Report if problem still exist.</value>
<value number="4350" name="E_CONFIG_FILE_NOT_SPECIFIED" fatal="false" short="Configuration file for the emulator is not specified."> The loader will start with the default settings.</value>
-
+
<!--
* R13 and lower versions
* Error codes translation
@@ -854,7 +873,7 @@
<value number="5329" name="A2_E_READ_FILE" fatal="true" short="Failed to read a file from the file system.">.</value>
<value number="61797" name="A2_E_CORE_SUPERV" fatal="true"></value>
<value number="66166" name="A2_E_MEM_ALLOC" fatal="true"></value>
-
+
<!--
* GDFS Error codes
-->
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
index 614aaa9..c5f409b 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
@@ -7,7 +7,11 @@
/**
* @addtogroup ldr_communication_serv
* @{
- * @addtogroup a2_family
+ * @addtogroup a2_family A2 protocol family
+ * The A2 family include only one protocol, A2 protocol, used for
+ * communication between the ME and PC tool. This module includes
+ * A2 transport layer and A2 network layer for handling A2 protocol.
+ *
* @{
*/
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
index 75306a9..86e2990 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/r_communication_service.h
@@ -57,7 +57,6 @@
extern Communication_t *GlobalCommunication_p;
extern Communication_t DebugCommunication;
-
/*******************************************************************************
* Declaration of functions
******************************************************************************/
@@ -73,13 +72,17 @@ extern "C"
* and communication device descriptor, a new instance of the
* communication module is created and bound to use the provided devices.
*
- * @param [in,out] Communication_p Communication module context.
+ * @param [in] Object_p Instance which will use initialized communication.
+ * @param [in,out] Communication_pp Communication module context.
* @param [in] Family Initial protocol family.
* @param [in] HashDevice_p The device to use for checksum
* calculations and verifications.
- * @param [in] *CommunicationDevice_p The device to use for network
+ * @param [in] CommunicationDevice_p The device to use for network
* transmission.
* @param [in] CommandCallback_p Collback function for command handling.
+ * @param [in] Buffers_p Pointer to buffer handling functions.
+ * @param [in] Timers_p Pointer to timers handling functions.
+ * @param [in] Queue_p Pointer to queue handling functions.
*
* @retval E_SUCCESS If the module instance is successfully
* initialized. A protocol family dependant error
@@ -203,7 +206,7 @@ extern "C"
LCM_API ErrorCode_e Do_Communication_SetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t *CommunicationDevice_p);
/*
- * Cancek Receiving new packets
+ * Cancel Receiving new packets
*
* @param [in] Communication_p Communication module context.
* @param [in] PacketsBeforeReceiverStop Number of packets to be send before stopping the receiver.
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h
index 3b686cc..74f4721 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/include/t_communication_service.h
@@ -44,7 +44,7 @@ typedef enum {
typedef void (*CommunicationCallback_t)(const void *Data_p, const uint32 Length, void *Param_p);
typedef void (*HashCallback_t)(void *Data_p, const uint32 Length, uint8 *Hash_p, void *Param_p);
-typedef boolean(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
+typedef ErrorCode_e(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
typedef ErrorCode_e(*DeviceWrite_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
typedef ErrorCode_e(*DeviceCancel_fn)(void *Param_p);
typedef void (*HashDeviceCancel_fn)(void *Object_p, void **Param_p);
@@ -122,8 +122,8 @@ typedef struct {
defined timer. */
ReadTime_t ReadTime_Fn; /**< Pointer to function for read time from
specified timer. */
- GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read curent
- sytem time. */
+ GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read current
+ system time. */
void *Object_p; /**< Pointer for instancing. It is used in
the PC application, but in the loaders
is always NULL */
@@ -165,7 +165,7 @@ typedef struct {
then all interrupt
enabled. */
RFifoDestroy_t RFifoDestroy_Fn; /**< Pointer to function
- for Fifo destroing.
+ for Fifo destroying.
First all interrupts
are disabled,
function executed and
@@ -219,9 +219,9 @@ typedef struct {
executed and then all
interrupt enabled. */
void *Object_p; /**<Pointer for instancing.
- It is used in the PC
- application, but in the
- loaders is always NULL.*/
+ It is used in the PC
+ application, but in the
+ loaders is always NULL.*/
} QueueInterface_t;
/**
@@ -247,9 +247,10 @@ typedef struct {
communication device. */
DeviceWrite_fn Write; /**< Pointer to function for write data thru the
communication device. */
- DeviceCancel_fn Cancel; /**< Pointer to function for caneling current
- communcation with communiation device. */
+ DeviceCancel_fn Cancel; /**< Pointer to function for canceling current
+ communication with communication device. */
void *Context_p; /**< Pointer to Device description data. */
+ void *Object_p; /**< Pointer to Object associated with the device. */
} CommunicationDevice_t;
/**
@@ -288,7 +289,7 @@ typedef struct ExecutionContext_s {
/** Communication context.*/
typedef struct {
void *Inbound_p; /**< Pointer to structure for
- handling incomming
+ handling incoming
packets.*/
void *Outbound_p; /**< Pointer to structure for
handling outgoing
@@ -309,7 +310,7 @@ typedef struct {
FunctionInterface_t *Functions_p; /**< Pointer to interface
functions for buffers,
timers and queue.*/
- Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to calback
+ Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to callback
function for handling
commands received thru
the LCM.*/
@@ -329,7 +330,7 @@ typedef struct FamilyDescriptor_s {
ErrorCode_e(*FamilyInit_fn)(Communication_t *Communication_p);
/**< Pointer to Interface function for protocol family de-initialization. */
ErrorCode_e(*FamilyShutdown_fn)(Communication_t *Communication_p);
- /**< Pointer to Pooling function in curren protocol family. */
+ /**< Pointer to Pooling function in current protocol family. */
ErrorCode_e(*Process_fn)(Communication_t *Communication_p);
/**< Pointer to function for sending packets.*/
ErrorCode_e(*Send_fn)(Communication_t *Communication_p, void *InputData_p);
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c
index 83f155e..e5aad13 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/a2_family.c
@@ -56,14 +56,18 @@ ErrorCode_e A2_Family_Init(Communication_t *Communication_p)
Communication_p->CurrentFamilyHash = HASH_CRC16;
if (NULL != Communication_p->BackupCommBuffer_p) {
- if (Communication_p->BackupCommBufferSize <= A2_HEADER_LENGTH) {
+ if (Communication_p->BackupCommBufferSize < A2_HEADER_LENGTH) {
memcpy(A2_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
A2_NETWORK(Communication_p)->Inbound.ReqData = A2_HEADER_LENGTH - Communication_p->BackupCommBufferSize;
A2_NETWORK(Communication_p)->Inbound.ReqBuffOffset = Communication_p->BackupCommBufferSize;
A2_NETWORK(Communication_p)->Inbound.RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
} else {
+ /* Copy content of backup buffer into scratch buffer */
memcpy(A2_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, A2_HEADER_LENGTH);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + A2_HEADER_LENGTH, Communication_p->BackupCommBufferSize - A2_HEADER_LENGTH);
+ /* Update the size of the backup buffer */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - A2_HEADER_LENGTH;
A2_NETWORK(Communication_p)->Inbound.RecBackupData = A2_HEADER_LENGTH;
}
@@ -86,7 +90,7 @@ ErrorExit:
/*
- * A2 family protocols sutdown.
+ * A2 family protocols shutdown.
*
* @param [in] Communication_p Communication module context.
*
@@ -131,10 +135,10 @@ ErrorExit:
}
/*
- * A2 Cancel Transmition.
+ * A2 Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -145,12 +149,12 @@ ErrorCode_e A2_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBef
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- A2_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ A2_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
A2_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c
index 342cb1b..99ac27e 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/communication_service.c
@@ -21,7 +21,7 @@
#include "r_r15_network_layer.h"
#include "r_communication_service.h"
#include "r_basicdefinitions.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
#ifdef CFG_ENABLE_A2_FAMILY
#include "r_a2_family.h"
@@ -60,7 +60,7 @@ static FamilyDescriptor_t ProtocolFamilies[] = {
A2_Transport_Send,
NULL,
NULL,
- A2_CancelReceiver
+ A2_CancelReceiver
#else
NULL,
NULL,
@@ -104,7 +104,7 @@ static FamilyDescriptor_t ProtocolFamilies[] = {
#define MAX_FAMILY (sizeof(ProtocolFamilies) / sizeof(ProtocolFamilies[0]))
/*******************************************************************************
- * Delaration of internal functions
+ * Declaration of internal functions
******************************************************************************/
static BuffersInterface_t *CreateBufferInterfaceHelpper(BuffersInterface_t *Buffers_p);
@@ -120,23 +120,27 @@ FamilyDescriptor_t *GetFamily(Family_t Family);
* Definition of external functions
******************************************************************************/
-/*
+/**
* Initialize an instance of the communication module.
*
* Given the initial family, already initialized hash device descriptor
* and communication device descriptor, a new instance of the
* communication module is created and bound to use the provided devices.
*
- * @param [in,out] Communication_p Communication module context.
+ * @param [in] Object_p Instance which will use initialized communication.
+ * @param [in,out] Communication_pp Communication module context.
* @param [in] Family Initial protocol family.
* @param [in] HashDevice_p The device to use for checksum
* calculations and verifications.
- * @param [in] *CommunicationDevice_p The device to use for network
+ * @param [in] CommunicationDevice_p The device to use for network
* transmission.
- * @param [in] CommandCallback_p Collback function for command handling.
+ * @param [in] CommandCallback_p Callback function for command handling.
+ * @param [in] Buffers_p Pointer to buffer handling functions.
+ * @param [in] Timers_p Pointer to timers handling functions.
+ * @param [in] Queue_p Pointer to queue handling functions.
*
* @retval E_SUCCESS If the module instance is successfully
- * initialized. A protocol family dependant error
+ * initialized. A protocol family dependent error
* code otherwise.
*/
ErrorCode_e Do_Communication_Initialize(void *Object_p, Communication_t **Communication_pp, Family_t Family, HashDevice_t *HashDevice_p, CommunicationDevice_t *CommunicationDevice_p, Do_CEH_Call_t CommandCallback_p, BuffersInterface_t *Buffers_p, TimersInterface_t *Timers_p, QueueInterface_t *Queue_p)
@@ -188,6 +192,8 @@ ErrorCode_e Do_Communication_Initialize(void *Object_p, Communication_t **Commun
Communication_p->CurrentFamilyHash = HASH_NONE;
Communication_p->BackupCommBufferSize = 0;
+ CommunicationDevice_p->Object_p = Communication_p;
+
ReturnValue = Do_Communication_SetFamily(Communication_p, Family, CommandCallback_p);
C_(printf("#---------------------------------------------------------\n");)
@@ -208,7 +214,7 @@ ErrorExit:
* @param [in,out] Communication_pp Communication module context.
*
* @retval E_SUCCESS If the module instance is successfully
- * shut down. A protocol family dependant error
+ * shut down. A protocol family dependent error
* code otherwise.
*/
ErrorCode_e Do_Communication_Shutdown(Communication_t **Communication_pp)
@@ -261,7 +267,7 @@ ErrorExit:
* @param [in] CEHCallback Callback that will handle the commands.
*
* @retval E_SUCCESS If the family is successfully changed. A
- * protocol family dependant error code otherwise.
+ * protocol family dependent error code otherwise.
*/
ErrorCode_e Do_Communication_SetFamily(Communication_t *Communication_p, Family_t Family, Do_CEH_Call_t CEHCallback)
{
@@ -271,7 +277,7 @@ ErrorCode_e Do_Communication_SetFamily(Communication_t *Communication_p, Family_
VERIFY(NULL != Family_p, E_INVALID_INPUT_PARAMETERS);
if (NULL != Communication_p->Family_p) {
- (void)Communication_p->CommunicationDevice_p->Cancel(Communication_p);
+ (void)Communication_p->CommunicationDevice_p->Cancel(Communication_p->CommunicationDevice_p);
ReturnValue = Communication_p->Family_p->FamilyShutdown_fn(Communication_p);
VERIFY(E_SUCCESS == ReturnValue, ReturnValue);
@@ -298,7 +304,7 @@ ErrorExit:
*
*
* @retval E_SUCCESS If all packets are successfully handled. A
- * protocol family dependant error code otherwise.
+ * protocol family dependent error code otherwise.
*/
ErrorCode_e Do_Communication_Poll(Communication_t *Communication_p)
{
@@ -316,7 +322,7 @@ ErrorExit:
* Function for sending packet.
*
* @param [in] Communication_p Communication module context.
- * @param [in] InputData_p Pointer to the data for tranmission.
+ * @param [in] InputData_p Pointer to the data for transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_FAILED_TO_ALLOCATE_COMM_BUFFER Failed to allocate communication
@@ -397,7 +403,7 @@ ErrorExit:
* device for the given LCM context.
*
* @retval E_SUCCESS After successful execution.
- * @retval E_INVALID_INPUT_PARAMTERS In case when communicaiton is not Singleton
+ * @retval E_INVALID_INPUT_PARAMTERS In case when communication is not Singleton
* and Communication_p is NULL pointer.
*/
ErrorCode_e Do_Communication_GetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t** CommunicationDevice_pp)
@@ -422,7 +428,7 @@ ErrorExit:
* device to be set for the given LCM context.
*
* @retval E_SUCCESS After successful execution.
- * @retval E_INVALID_INPUT_PARAMTERS In case when communicaiton is not Singleton
+ * @retval E_INVALID_INPUT_PARAMTERS In case when communication is not Singleton
* and Communication_p is NULL pointer.
*/
ErrorCode_e Do_Communication_SetCommunicationDevice(Communication_t *Communication_p, CommunicationDevice_t* CommunicationDevice_p)
@@ -437,7 +443,7 @@ ErrorExit:
}
/*
- * Cancek Receiving new packets
+ * Cancel Receiving new packets
*
* @param [in] Communication_p Communication module context.
* @param [in] PacketsBeforeReceiverStop Number of packets to be send before stopping the receiver.
@@ -451,7 +457,7 @@ ErrorCode_e Do_Communication_Cancel_Receiver(Communication_t *Communication_p, u
VERIFY(NULL != Communication_p->Family_p, ReturnValue);
- ReturnValue = Communication_p->Family_p->CancelReceiver_fn(Communication_p, PacketsBeforeReceiverStop);
+ ReturnValue = Communication_p->Family_p->CancelReceiver_fn(Communication_p, PacketsBeforeReceiverStop);
ErrorExit:
return ReturnValue;
@@ -463,7 +469,7 @@ void Do_CommunicationInternalErrorHandler(const ErrorCode_e IntError)
IDENTIFIER_NOT_USED(IntError);
#endif
A_(printf("# Error Code: 0x%X !\n", IntError);)
- A_(printf("# Loader stoped!\n");)
+ A_(printf("# Loader stopped!\n");)
A_(printf("#---------------------------------------------------------\n");)
/* coverity[no_escape] */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c
index 29c678d..4b42f60 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/measurement_tool.c
@@ -17,7 +17,7 @@
#include "r_time_utilities.h"
#include "r_serialization.h"
#include "r_debug_macro.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* File scope types, constants and variables
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c
index ec4c468..762d5cb 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/protrom_family.c
@@ -52,14 +52,18 @@ ErrorCode_e Protrom_Family_Init(Communication_t *Communication_p)
PROTROM_NETWORK(Communication_p)->Inbound.StopTransfer = FALSE;
if (NULL != Communication_p->BackupCommBuffer_p) {
- if (Communication_p->BackupCommBufferSize <= PROTROM_HEADER_LENGTH) {
+ if (Communication_p->BackupCommBufferSize < PROTROM_HEADER_LENGTH) {
memcpy(PROTROM_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
PROTROM_NETWORK(Communication_p)->Inbound.ReqData = PROTROM_HEADER_LENGTH - Communication_p->BackupCommBufferSize;
PROTROM_NETWORK(Communication_p)->Inbound.ReqBuffOffset = Communication_p->BackupCommBufferSize;
PROTROM_NETWORK(Communication_p)->Inbound.RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
} else {
+ /* Copy content of backup buffer into scratch buffer */
memcpy(PROTROM_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, PROTROM_HEADER_LENGTH);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + PROTROM_HEADER_LENGTH, Communication_p->BackupCommBufferSize - PROTROM_HEADER_LENGTH);
+ /* Update the size of the backup buffer */
Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - PROTROM_HEADER_LENGTH;
PROTROM_NETWORK(Communication_p)->Inbound.RecBackupData = PROTROM_HEADER_LENGTH;
}
@@ -79,7 +83,7 @@ ErrorExit:
}
/*
- * Protrom family protocols sutdown.
+ * Protrom family protocols shutdown.
*
* @param [in] Communication_p Communication module context.
*
@@ -122,10 +126,10 @@ ErrorExit:
}
/*
- * Protrom Cancel Transmition.
+ * Protrom Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -134,16 +138,16 @@ ErrorCode_e Protrom_CancelReceiver(Communication_t *Communication_p, uint8 Packe
{
ErrorCode_e ReturnValue = E_SUCCESS;
- printf("Protrom_CancelReceiver called ...\n");
+ printf("Protrom_CancelReceiver called ...\n");
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- PROTROM_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ PROTROM_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
PROTROM_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
/** @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c
index bf9c24a..29be578 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/r15_family.c
@@ -57,16 +57,20 @@ ErrorCode_e R15_Family_Init(Communication_t *Communication_p)
R15_NETWORK(Communication_p)->Inbound.StopTransfer = FALSE;
if (NULL != Communication_p->BackupCommBuffer_p) {
- if (Communication_p->BackupCommBufferSize <= HEADER_LENGTH) {
+ if (Communication_p->BackupCommBufferSize < ALIGNED_HEADER_LENGTH) {
memcpy(R15_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);
- R15_NETWORK(Communication_p)->Inbound.ReqData = HEADER_LENGTH - Communication_p->BackupCommBufferSize;
+ R15_NETWORK(Communication_p)->Inbound.ReqData = ALIGNED_HEADER_LENGTH - Communication_p->BackupCommBufferSize;
R15_NETWORK(Communication_p)->Inbound.ReqBuffOffset = Communication_p->BackupCommBufferSize;
R15_NETWORK(Communication_p)->Inbound.RecBackupData = Communication_p->BackupCommBufferSize;
Communication_p->BackupCommBufferSize = 0;
} else {
- memcpy(R15_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, HEADER_LENGTH);
- Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - HEADER_LENGTH;
- R15_NETWORK(Communication_p)->Inbound.RecBackupData = HEADER_LENGTH;
+ /* Copy content of backup buffer into scratch buffer */
+ memcpy(R15_NETWORK(Communication_p)->Inbound.Scratch, Communication_p->BackupCommBuffer_p, ALIGNED_HEADER_LENGTH);
+ /* Move rest of backup data at the beginning of the backup buffer */
+ memcpy(Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBuffer_p + ALIGNED_HEADER_LENGTH, Communication_p->BackupCommBufferSize - ALIGNED_HEADER_LENGTH);
+ /* Update the size of the backup buffer */
+ Communication_p->BackupCommBufferSize = Communication_p->BackupCommBufferSize - ALIGNED_HEADER_LENGTH;
+ R15_NETWORK(Communication_p)->Inbound.RecBackupData = ALIGNED_HEADER_LENGTH;
}
C_(printf("r15_family.c(%d) BackupBuffer=0x%x Size=%d\n", __LINE__, Communication_p->BackupCommBuffer_p, Communication_p->BackupCommBufferSize);)
@@ -89,7 +93,7 @@ ErrorExit:
/*
- * R15 family protocols sutdown.
+ * R15 family protocols shutdown.
*
* @param [in] Communication_p Communication module context.
*
@@ -136,10 +140,10 @@ ErrorExit:
}
/*
- * R15 Cancel Transmition.
+ * R15 Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -150,12 +154,12 @@ ErrorCode_e R15_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBe
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- R15_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ R15_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
R15_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
/** @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c b/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c
index ee090c9..d27a8b8 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/source/z_family.c
@@ -115,10 +115,10 @@ ErrorExit:
}
/*
- * Z family Cancel Transmition.
+ * Z family Cancel Transmission.
*
* @param [in] Communication_p Communication module context.
- * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
+ * @param [in] PacketsBeforeTransferStop Number of packets that will be transmitted before stopping the transmission.
*
* @retval E_SUCCESS After successful execution.
* @retval E_INVALID_INPUT_PARAMETERS Invalid input parameter.
@@ -129,12 +129,12 @@ ErrorCode_e Z_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBefo
VERIFY(NULL != Communication_p, E_INVALID_INPUT_PARAMETERS);
- Z_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
+ Z_NETWORK(Communication_p)->Inbound.PacketsBeforeReceiverStop = PacketsBeforeReceiverStop;
Z_NETWORK(Communication_p)->Inbound.StopTransfer = TRUE;
ErrorExit:
A_(printf("protrom_family.c(%d) ErrorCode=%d\n", __LINE__, ReturnValue);)
- return ReturnValue;
+ return ReturnValue;
}
/** @} */
diff --git a/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c b/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c
index 79845d6..eb0e2b4 100644
--- a/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c
+++ b/lcmodule/source/cnh1606344_ldr_communication_module/test_cases/ADbg_cnh1606344.c
@@ -26,7 +26,7 @@
#include "r_adbg_module.h"
#include "r_adbg_command.h"
#include "r_communication_service.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* The test case functions declarations
diff --git a/lcmodule/source/resource.h b/lcmodule/source/resource.h
index e7c0c12..2f2342a 100644
--- a/lcmodule/source/resource.h
+++ b/lcmodule/source/resource.h
@@ -4,7 +4,7 @@
//
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
diff --git a/lcmodule/test_cases/ADbg_cnh1606344.c b/lcmodule/test_cases/ADbg_cnh1606344.c
index d4b1c96..373102a 100644
--- a/lcmodule/test_cases/ADbg_cnh1606344.c
+++ b/lcmodule/test_cases/ADbg_cnh1606344.c
@@ -26,7 +26,7 @@
#include "r_adbg_module.h"
#include "r_adbg_command.h"
#include "r_communication_service.h"
-#include "r_memmory_utils.h"
+#include "r_memory_utils.h"
/*******************************************************************************
* The test case functions declarations
diff --git a/source/LCDriver.rc b/source/LCDriver.rc
index 2a79341..5be4ef9 100644..100755
--- a/source/LCDriver.rc
+++ b/source/LCDriver.rc
@@ -81,16 +81,16 @@ BEGIN
BEGIN
BLOCK "000904b0"
BEGIN
- VALUE "Comments", "Build date: 2011-06-15"
+ VALUE "Comments", "Build date: 2011-06-16"
VALUE "CompanyName", "STEricsson AB"
VALUE "FileDescription", "LCDriver Dynamic Link Library"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "Loader Communication Driver"
VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2011"
VALUE "OriginalFilename", "LCDriver_CNH1606432.dll"
- VALUE "PrivateBuild", "http://gerrit.lud.stericsson.com/gerrit/20944"
+ VALUE "PrivateBuild", "Change-Id: Ib1901abfc2efa6c887c70b8583ddd2258e21aa78"
VALUE "ProductName", "CXC 173 0865, LCDriver DLL"
- VALUE "ProductVersion", "P1M"
+ VALUE "ProductVersion", "R1N"
END
END
BLOCK "VarFileInfo"
diff --git a/source/LCDriverMethods.cpp b/source/LCDriverMethods.cpp
index 22c4923..7a54ecc 100644
--- a/source/LCDriverMethods.cpp
+++ b/source/LCDriverMethods.cpp
@@ -398,7 +398,7 @@ int CLCDriverMethods::Do_Initialize(void **ppInstance)
}
VERIFY_SUCCESS(m_pLcmInterface->CommunicationInitialize(this, m_CurrentProtocolFamily, m_pHashDevice, m_pCommunicationDevice, m_CurrentCEHCallback, &BufferFunctions, &TimerFunctions, &QueueFunctions));
- *ppInstance = m_pLcmInterface->getLCMContext();
+ *ppInstance = m_pCommunicationDevice;
// Create main thread
if (m_pTimer) {
@@ -725,7 +725,7 @@ int CLCDriverMethods::Done_System_GetControlKeys(TSIMLockKeys *pSIMLockKeys)
pSIMLockKeys->pchPCKLock, pSIMLockKeys->pchESLCKLock,
pSIMLockKeys->pchNLCKUnLock, pSIMLockKeys->pchNSLCKUnLock,
pSIMLockKeys->pchSPLCKUnLock, pSIMLockKeys->pchCLCKUnLock,
- pSIMLockKeys->pchPCKLock, pSIMLockKeys->pchESLCKUnLock));
+ pSIMLockKeys->pchPCKUnLock, pSIMLockKeys->pchESLCKUnLock));
VERIFY_SUCCESS(WaitForEvent(EVENT_GR_RECEIVED, GROUP_SYSTEM, COMMAND_SYSTEM_AUTHENTICATE));
ErrorExit:
@@ -2147,7 +2147,7 @@ int CLCDriverMethods::Do_Z_Exit_Z_Protocol()
VERIFY_SUCCESS(IsMainThreadAlive());
- m_pCommunicationDevice->Cancel(m_pLcmInterface->getLCMContext());
+ m_pCommunicationDevice->Cancel(m_pCommunicationDevice);
//Send exit z-protocol command.
VERIFY_SUCCESS(m_pZRpcFunctions->DoRPC_Z_Exit_Z_Protocol());
diff --git a/source/LCM/include/error_codes.h b/source/LCM/include/error_codes.h
index e71d4b4..cc970cb 100644
--- a/source/LCM/include/error_codes.h
+++ b/source/LCM/include/error_codes.h
@@ -117,14 +117,28 @@ typedef enum {
E_FAILED_TO_ALLOCATE_COMM_BUFFER = 206, /**< Failed to allocate communication buffer. */
E_FAILED_TO_FLUSH_RXFIFO = 207, /**< Failed to flush RX FIFO. */
E_RETRANSMITION_FAILED = 208, /**< Retransmission failed. After MAX_RESENDS attempt, failed to send packet. */
- E_COMMAND_NO_ERROR = 209, /**< */
+ E_COMMAND_NO_ERROR = 209, /**< Stopped command error sequence. */
E_FAILED_TO_RELEASE_COMM_BUFFER = 210, /**< Failed to release communication buffer. */
E_FAILED_TO_INTIALIZE_TIMER_FUNCTIONS = 211, /**< Failed to initialize timer functions. */
E_FAILED_TO_INTIALIZE_QUEUE_FUNCTIONS = 212, /**< Failed to initialize queue functions. */
+ E_DMA_INIT_ERROR = 213, /**< Failed to initialize DMA. */
+ E_FAILED_TO_STOP_DMA = 214, /**< Failed to stop DMA channel. */
+ E_FAILED_TO_OPEN_DMA_CHANNEL = 215, /**< Failed to open DMA channel. */
+ E_FAILED_TO_SET_DMA_CHANNEL_TYPE = 216, /**< Failed to set DMA channel type. */
+ E_FAILED_TO_SET_DMA_CHANNEL_MODE = 217, /**< Failed to set DMA channel mode. */
+ E_FAILED_TO_OPEN_DMA_PIPE = 218, /**< Failed to open DMA pipe. */
+ E_FAILED_TO_SET_DMA_IT_LOGIC = 219, /**< Failed to set DMA interrupt logic. */
+ E_FAILED_TO_CLOSE_DMA_PIPE = 220, /**< Failed to close DMA pipe. */
+ E_FAILED_TO_CLOSE_DMA_CHANNEL = 221, /**< Failed to close DMA channel. */
+ E_FAILED_TO_CONFIG_SRC_DMA_DEVICE = 222, /**< Failed to configure DMA source device. */
+ E_FAILED_TO_UPDATE_DMA_SRC_MEMORY_BUFFER = 223, /**< Failed to update DMA source memory buffer. */
+ E_FAILED_TO_CONFIG_DEST_DMA_DEVICE = 224, /**< Failed to configure DMA destination device. */
+ E_FAILED_TO_UPDATE_DMA_DEST_MEMORY_BUFFER = 225, /**< Failed to update DMA destination memory buffer. */
+ E_FAILED_TO_RUN_DMA = 226, /**< Failed to run DMA transfer. */
E_INVALID_BULK_MODE = 251, /**< Invalid bulk mode. */
E_FAILED_TO_FIND_COMM_BUFFER = 252, /**< Failed to find communication buffer. */
E_INVALID_TYPE_OF_BUFFER = 253, /**< Invalid type of buffer. */
- E_COM_DEVICE_BUSY = 254, /**< */
+ E_COM_DEVICE_BUSY = 254, /**< Communication device is busy. */
E_NOT_FOUND_ELEMENT_IN_RETRANSMISSION_LIST = 255, /**< The element in retransmission list is not found. */
E_FAILED_READING_FROM_BULK = 256, /**< Failed to read from bulk. */
E_FAILED_WRITING_TO_BULK = 257, /**< Failed to write to bulk. */
@@ -144,14 +158,14 @@ typedef enum {
E_UNREGISTER_FS_SERVICE_FAILED = 458, /**< Unregistering of File System Manager Service failed. */
E_UNREGISTER_FPD_SERVICE_FAILED = 459, /**< Unregistering of Flash Physical Driver Service failed. */
E_UNREGISTER_GD_SERVICE_FAILED = 460, /**< Unregistering of Global Data Manager Service failed. */
- E_GENERAL_ZIP_ERROR = 551, /**< */
- E_ZIP_FAILED_TO_CREATE_CONTEXT = 552, /**< */
- E_ZIP_FAILED_TO_OPEN_FILE = 553, /**< */
- E_FILESYS_APP_INIT_FAILURE = 600, /**< */
- E_NO_FILESYSTEM_PROPERTY = 601, /**< */
- E_UNDEFINED_AUTHENTICATION_TYPE = 602, /**< */
- E_RTC_TIME_NOT_ACCURATE = 651, /**< */
- E_RTC_INTIALIZATION_FAILED = 652, /**< */
+ E_GENERAL_ZIP_ERROR = 551, /**< General error. */
+ E_ZIP_FAILED_TO_CREATE_CONTEXT = 552, /**< Failed to parse the zip. */
+ E_ZIP_FAILED_TO_OPEN_FILE = 553, /**< Failed to open file from the zip. */
+ E_FILESYS_APP_INIT_FAILURE = 600, /**< Failed to initialize the file system application. */
+ E_NO_FILESYSTEM_PROPERTY = 601, /**< Failed to start file system. */
+ E_UNDEFINED_AUTHENTICATION_TYPE = 602, /**< Undefined authentication type. */
+ E_RTC_TIME_NOT_ACCURATE = 651, /**< System Time is not properly set. */
+ E_RTC_INTIALIZATION_FAILED = 652, /**< Hardware error ocure during initialization of RTC. */
E_DIFFERENT_FLASHLAYOUT = 751, /**< Different flashlayout. */
E_EMPTY_FILE_IN_ARCHIVE = 752, /**< Archive contain empty file. */
E_UNKNOWN_COMM_DEVICE = 753, /**< Unknown communication device was detected. */
@@ -162,6 +176,23 @@ typedef enum {
E_FPD_NOT_CONFIGURED = 758, /**< Flash physical driver is not configured. */
E_INVALID_SIZE_IN_MEMCONF = 759, /**< MEMCONF boot record contain invalid TotalSize field. */
E_ARCHIVE_TO_LARGE = 760, /**< Flash archive larger than available space in BDM. */
+ E_ENTRY_NOT_FOUND_IN_FLASHLAYOUT = 761, /**< Entry not found in flashlayout file. */
+ E_MISMATCH_MANIFEST_FLASHLAYOUT = 762, /**< Mismatch between manifest and flashlayout. */
+ E_INVALID_SUBTOC_PARAMETERS = 763, /**< SUBTOC is invalid. */
+ E_FAILED_TO_READ_SUBTOC = 764, /**< Reading SUBTOC from flash failed. */
+ E_OVERLAPPING_PARTITIONS_FOUND = 765, /**< Overlapping partitions found in the archive. */
+ E_PARTITION_NOT_FOUND = 766, /**< Partition not found in TOC. */
+ E_FLASHLAYOUT_NULL = 767, /**< Flashlayout data equals NULL. */
+ E_INVALID_TOC_TYPE = 768, /**< Invalid TOC type supplied during TOC list creation. */
+ E_TOC_HANDLER_INPUT_DATA_EMPTY = 769, /**< TOC list cannot be created because supplied buffer is empty. */
+ E_TOC_HANDLER_INPUT_DATA_CORRUPTED = 770, /**< TOC list cannot be created because supplied buffer contains corrupted data. */
+ E_TOC_LIST_CORRUPTED = 771, /**< TOC list cannot be created. Some malicious state occurs. */
+ E_TOC_BOOT_AREA_EMPTY = 772, /**< TOC list cannot be created. Boot area is empty. */
+ E_BOOT_AREA_NOT_FOUND = 773, /**< Boot Area not found. */
+ E_MISMATCH_MANIFEST_TOC = 774, /**< Mismatch between manifest and TOC. */
+ E_FILE_TOO_LARGE = 775, /**< File too large. */
+ E_FILE_OUT_OF_BOOT_AREA = 776, /**< File outside of boot area */
+ E_DUMP_OUT_OF_FLASH_RANGE = 777, /**< Dump outside of flash range */
E_PATH_NOT_EXISTS = 951, /**< Path not exist. */
E_CLOSE_FILE = 952, /**< Failed to close a file in the file system. */
E_INSUFFICENT_SPACE = 953, /**< Not enough memory space for desired operation. */
@@ -207,13 +238,13 @@ typedef enum {
E_INVALID_INPUT_PARAMETER = 1001, /**< Invalid input parameter */
E_UNSUPPORTED_CMD = 1002, /**< The loader does not support the requested command. */
E_UNSUPPORTED_GROUP = 1003, /**< The loader does not support the requested group. */
- E_INVALID_COMMAND_SIZE = 1051, /**< */
- E_OVERLOAD_COMMAND_TABLE = 1052, /**< */
- E_COMMAND_ALREADY_REGISTERED = 1053, /**< */
+ E_INVALID_COMMAND_SIZE = 1051, /**< The size of the command is invalid. */
+ E_OVERLOAD_COMMAND_TABLE = 1052, /**< Too many commands are registered. */
+ E_COMMAND_ALREADY_REGISTERED = 1053, /**< Command has already registered in execution queue. */
E_AUDITING_FAILED = 1054, /**< Command auditing failed. */
- E_NONEXIST_TIMER = 1251, /**< */
- E_FAILED_TO_SET_TIMER = 1252, /**< */
- E_TIMER_INIT_FAILED = 1253, /**< */
+ E_NONEXIST_TIMER = 1251, /**< Timer with the specified index does not exist. */
+ E_FAILED_TO_SET_TIMER = 1252, /**< Failed to start the timer. */
+ E_TIMER_INIT_FAILED = 1253, /**< Timer initialization failed. */
E_TIMER_IRQ_CONF_FAILED = 1254, /**< */
E_GD_INVALID_UNIT_SIZE = 1351, /**< GD/GDFS: Error in specifying unit size. */
E_GD_LL_ILLEGAL_SIZE = 1352, /**< GD/GDFS: Size too large for the block. */
@@ -247,6 +278,19 @@ typedef enum {
E_GD_MISSING_CONFIG = 1380, /**< GD/GDFS: Missing configuration parameter. */
E_GD_ILLEGAL_CONFIG = 1381, /**< GD/GDFS: Illegal configuration. */
E_GD_TRANSACTION_LOG_CORRUPT = 1382, /**< GD/GDFS: The transaction log used for tracking updates to GD contents is corrupt and prevents roll-back from working properly. */
+ E_CSPSA_RESULT_E_INVALID_KEY = 1383, /**< Error, parameter key not valid. */
+ E_CSPSA_RESULT_E_OUT_OF_SPACE = 1384, /**< Error, there is not space enough on memory media to update the parameter area. */
+ E_CSPSA_RESULT_E_NO_VALID_IMAGE = 1385, /**< Error, no valid CSPSA image found. */
+ E_CSPSA_RESULT_E_MEDIA_INACCESSIBLE = 1386, /**< Memory media could not be accessed. */
+ E_CSPSA_RESULT_E_READ_ONLY = 1387, /**< Image is read-only. */
+ E_CSPSA_RESULT_E_READ_ERROR = 1388, /**< Error occurred while reading from media. */
+ E_CSPSA_RESULT_E_WRITE_ERROR = 1389, /**< Error occurred while writing to media. */
+ E_CSPSA_RESULT_UNDEFINED = 1390, /**< Represents an undefined value of this enum. */
+ E_CSPSA_RESULT_E_END_OF_DATA = 1391, /**< No more parameters, end of data has been reached. */
+ E_CSPSA_RESULT_E_OPEN_ERROR = 1392, /**< Parameter storage area could not be opened (media error). */
+ E_CSPSA_RESULT_E_ALREADY_EXISTS = 1393, /**< Parameter storage area with same name was already registered. */
+ E_CSPSA_RESULT_E_OUT_OF_MEMORY = 1394, /**< There was not enough memory to perform the operation. */
+ E_CSPSA_RESULT_E_BAD_PARAMETER = 1395, /**< Error because of bad input parameter. */
E_GD_NO_DATA_TO_READ = 1399, /**< GD: No data to read. */
E_BDM_W_NO_MORE_GC_POSSIBLE = 1451, /**< BDM: No more garbage collection is possible. */
E_BDM_UNIT_STARTED = 1452, /**< BDM: Unit has already been started. */
@@ -416,12 +460,12 @@ typedef enum {
E_INT_FUNCTION_LIST_EMPTY = 2007, /**< There isn't any interface function in interface group. */
E_PRECONDITION_IS_ALREADY_SET = 2008, /**< Request for setting precondition that is already set. */
E_PRECONDITION_IS_NOT_SET = 2009, /**< Request to recover condition that is not changed. */
- E_INIT_OTP_PD_FAILED = 2100, /**< */
- E_READING_OTP_FAILED = 2101, /**< */
- E_WRITTING_OTP_FAILED = 2102, /**< */
- E_INVALID_CID_VALUE = 2103, /**< */
- E_INIT_OTP_LD_FAILED = 2104, /**< */
- E_OTP_AREA_LOCKED = 2105, /**< */
+ E_INIT_OTP_PD_FAILED = 2100, /**< Failed to initialize OTD driver. */
+ E_READING_OTP_FAILED = 2101, /**< Failed to read data from OTP. */
+ E_WRITTING_OTP_FAILED = 2102, /**< Failed to write data in OTP. */
+ E_INVALID_CID_VALUE = 2103, /**< Trying to write invalid CID in OTP. */
+ E_INIT_OTP_LD_FAILED = 2104, /**< Failed to initialize OTD logical driver. */
+ E_OTP_AREA_LOCKED = 2105, /**< Requested OTP area is already locked. */
E_SEC_APP_PROPERTY_NOT_FOUND = 2251, /**< App property cannot be found. */
E_SEC_APP_IMEI_NOT_CHANGABLE = 2252, /**< IMEI not changeable. */
E_SEC_APP_OPERATION_DENIED = 2253, /**< Security operation denied. */
@@ -429,9 +473,9 @@ typedef enum {
E_SEC_APP_ROM_ERROR_CRITICAL = 2255, /**< Critical error in ROM has occurred. */
E_SEC_APP_ROM_ERROR = 2256, /**< Unexpected ROM error. */
E_SEC_APP_PATCH_EXISTS = 2257, /**< ROM Patch is already installed. */
- E_SEC_APP_PATCH_REINSTALLED = 2258, /**< ROM Patch in Flash is reinstalled. */
- E_SEC_APP_ROOTKEY_EXISTS = 2259, /**< ROM Patch is already installed. */
- E_SEC_APP_ROOTKEY_REINSTALLED = 2260, /**< Root Key is reinstalled. */
+ E_SEC_APP_PATCH_REINSTALLED = 2258, /**< Operation successful. */
+ E_SEC_APP_ROOTKEY_EXISTS = 2259, /**< RootKey is already installed. */
+ E_SEC_APP_ROOTKEY_REINSTALLED = 2260, /**< Operation successful. */
E_TA_WRONG_PARTITION = 2351, /**< TA: Unknown partition. */
E_TA_ILLOGICAL_CONFIGURATION = 2352, /**< TA: Configuration error. */
E_TA_UNKNOWN_MEMORY_TYPE = 2353, /**< TA: Unsupported memory type. */
@@ -456,6 +500,28 @@ typedef enum {
E_PD_CFI_PROTECTED = 2656, /**< PD CFI: The requested flash address is protected from the requested type of access. */
E_PD_CFI_UNSUPPORTED_DEVICE = 2657, /**< PD CFI: Flash devices not supported by this driver. */
E_PD_CFI_OPERATION_COMPLETE = 2658, /**< PD CFI: Requested operation was not suspended as it has completed. */
+ E_PD_CFI_HARDWARE_NOT_DETECTED = 2659, /**< PD CFI: NOR memory was not detected on current configuration. */
+ E_HSI_BSC_RESULT_FAILED = 2701, /**< General Error. */
+ E_HSI_BSC_RESULT_FAILED_INVALIDARGS = 2702, /**< Invalid arguments. */
+ E_HSI_BSC_RESULT_FAILED_NOTSUPPORTED = 2703, /**< Implementation is removed. */
+ E_HSI_BSC_RESULT_FAILED_HSIERR = 2704, /**< HSI internal error. */
+ E_HSI_BSC_RESULT_FAILED_BUSY = 2705, /**< Communication device is busy. */
+ E_HSI_BSC_ERROR_SIGNAL = 2751, /**< Signal error. */
+ E_HSI_BSC_ERROR_TIMEOUT = 2752, /**< Timeout error. */
+ E_HSI_BSC_ERROR_BREAK = 2753, /**< Break received. */
+ E_HSI_BSC_ERROR_RECEIVE = 2754, /**< Receive buffer is not provided. */
+ E_HSI_BSC_ERROR_TRANSMIT = 2755, /**< Transmit buffer is not provided. */
+ E_CR_INVALID_STATE = 2850, /**< Invalid state for commnication relay detected. */
+ E_CR_NOT_RUNNING = 2851, /**< Communication Relay is not running. */
+ E_SDIO_BSC_RESULT_FAILED = 2901, /**< General Error. */
+ E_SDIO_BSC_RESULT_FAILED_INVALIDARGS = 2902, /**< Invalid arguments. */
+ E_SDIO_BSC_RESULT_FAILED_NOTSUPPORTED = 2903, /**< Implementation is removed. */
+ E_SDIO_BSC_RESULT_FAILED_SDIOERR = 2904, /**< SDIO internal error. */
+ E_SDIO_BSC_RESULT_FAILED_BUSY = 2905, /**< Communication device is busy. */
+ E_SDIO_BSC_ERROR_TIMEOUT = 2951, /**< Timeout error. */
+ E_SDIO_BSC_ERROR_BREAK = 2952, /**< Break received. */
+ E_SDIO_BSC_ERROR_RECEIVE = 2953, /**< Receive buffer is not provided. */
+ E_SDIO_BSC_ERROR_TRANSMIT = 2954, /**< Transmit buffer is not provided. */
E_LOADER_SEC_LIB_CHIP_ID_INVALID = 4000, /**< Invalid input parameters. */
E_LOADER_SEC_LIB_INVALID_PARAMETER_TO_FUNC = 4096, /**< Invalid input parameters. */
E_LOADER_SEC_LIB_FAILURE = 4120, /**< Failure. */
@@ -499,16 +565,18 @@ typedef enum {
E_LOADER_SEC_LIB_BOOT_BLOCK_DO_NOT_EXIST = 4212, /**< Boot record do not exist. */
E_LOADER_SEC_LIB_CORRUPTED_DOMAIN_DATA = 4213, /**< Corrupted or do not exist domain data in boot block. */
E_LOADER_SEC_LIB_INVALID_DOMAIN = 4214, /**< Invalid domain. */
- E_FIFO_OVERFLOW = 4300, /**< */
- E_FIFO_UNDERFLOW = 4301, /**< */
- E_OBJECT_NULL = 4302, /**< */
- E_POINTER_NOT_NULL = 4303, /**< */
- E_UNRECOGNIZED_STATE = 4304, /**< */
- E_UNKNOWN_MANUFACTURER_ID = 4305, /**< */
- E_UNKNOWN_DEVICE_ID = 4306, /**< */
- E_INVALID_A01_FORMAT = 4308, /**< */
- E_A01_BUFFER_FULL = 4309, /**< */
- E_CONFIG_FILE_NOT_SPECIFIED = 4350, /**< */
+ E_LOADER_SEC_LIB_INVALID_CHALLENGE_DATA_BLOCK = 4215, /**< Invalid challenge data block. */
+ E_LOADER_SEC_LIB_NO_DEBUG_HW_NOT_ALLOWED = 4216, /**< Not allowed operation on NoDebug HW. */
+ E_FIFO_OVERFLOW = 4300, /**< UART FIFO overflow. */
+ E_FIFO_UNDERFLOW = 4301, /**< UART FIFO underflow. */
+ E_OBJECT_NULL = 4302, /**< Null pointer to Object. */
+ E_POINTER_NOT_NULL = 4303, /**< Pointer is not NULL. */
+ E_UNRECOGNIZED_STATE = 4304, /**< The state in the State Machine is invalid. */
+ E_UNKNOWN_MANUFACTURER_ID = 4305, /**< The provided manufacturer ID is not valid. */
+ E_UNKNOWN_DEVICE_ID = 4306, /**< The provided device ID is not valid. */
+ E_INVALID_A01_FORMAT = 4308, /**< Something wrong with the A01 file containing the flash image. */
+ E_A01_BUFFER_FULL = 4309, /**< Buffer holding the data from the A01 file is full. */
+ E_CONFIG_FILE_NOT_SPECIFIED = 4350, /**< Configuration file for the emulator is not specified. */
A2_E_SUCCESS = 5000, /**< Operation successful. */
A2_E_PROP_NOT_SUPPORTED = 5001, /**< The property is not supported. */
A2_E_PROP_READ_ONLY = 5002, /**< The property is read only. */
diff --git a/source/LCM/include/t_communication_service.h b/source/LCM/include/t_communication_service.h
index 3b686cc..74f4721 100644
--- a/source/LCM/include/t_communication_service.h
+++ b/source/LCM/include/t_communication_service.h
@@ -44,7 +44,7 @@ typedef enum {
typedef void (*CommunicationCallback_t)(const void *Data_p, const uint32 Length, void *Param_p);
typedef void (*HashCallback_t)(void *Data_p, const uint32 Length, uint8 *Hash_p, void *Param_p);
-typedef boolean(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
+typedef ErrorCode_e(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
typedef ErrorCode_e(*DeviceWrite_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p);
typedef ErrorCode_e(*DeviceCancel_fn)(void *Param_p);
typedef void (*HashDeviceCancel_fn)(void *Object_p, void **Param_p);
@@ -122,8 +122,8 @@ typedef struct {
defined timer. */
ReadTime_t ReadTime_Fn; /**< Pointer to function for read time from
specified timer. */
- GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read curent
- sytem time. */
+ GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read current
+ system time. */
void *Object_p; /**< Pointer for instancing. It is used in
the PC application, but in the loaders
is always NULL */
@@ -165,7 +165,7 @@ typedef struct {
then all interrupt
enabled. */
RFifoDestroy_t RFifoDestroy_Fn; /**< Pointer to function
- for Fifo destroing.
+ for Fifo destroying.
First all interrupts
are disabled,
function executed and
@@ -219,9 +219,9 @@ typedef struct {
executed and then all
interrupt enabled. */
void *Object_p; /**<Pointer for instancing.
- It is used in the PC
- application, but in the
- loaders is always NULL.*/
+ It is used in the PC
+ application, but in the
+ loaders is always NULL.*/
} QueueInterface_t;
/**
@@ -247,9 +247,10 @@ typedef struct {
communication device. */
DeviceWrite_fn Write; /**< Pointer to function for write data thru the
communication device. */
- DeviceCancel_fn Cancel; /**< Pointer to function for caneling current
- communcation with communiation device. */
+ DeviceCancel_fn Cancel; /**< Pointer to function for canceling current
+ communication with communication device. */
void *Context_p; /**< Pointer to Device description data. */
+ void *Object_p; /**< Pointer to Object associated with the device. */
} CommunicationDevice_t;
/**
@@ -288,7 +289,7 @@ typedef struct ExecutionContext_s {
/** Communication context.*/
typedef struct {
void *Inbound_p; /**< Pointer to structure for
- handling incomming
+ handling incoming
packets.*/
void *Outbound_p; /**< Pointer to structure for
handling outgoing
@@ -309,7 +310,7 @@ typedef struct {
FunctionInterface_t *Functions_p; /**< Pointer to interface
functions for buffers,
timers and queue.*/
- Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to calback
+ Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to callback
function for handling
commands received thru
the LCM.*/
@@ -329,7 +330,7 @@ typedef struct FamilyDescriptor_s {
ErrorCode_e(*FamilyInit_fn)(Communication_t *Communication_p);
/**< Pointer to Interface function for protocol family de-initialization. */
ErrorCode_e(*FamilyShutdown_fn)(Communication_t *Communication_p);
- /**< Pointer to Pooling function in curren protocol family. */
+ /**< Pointer to Pooling function in current protocol family. */
ErrorCode_e(*Process_fn)(Communication_t *Communication_p);
/**< Pointer to function for sending packets.*/
ErrorCode_e(*Send_fn)(Communication_t *Communication_p, void *InputData_p);
diff --git a/source/LCM/include/t_protrom_network.h b/source/LCM/include/t_protrom_network.h
index 955b589..b29a65a 100644
--- a/source/LCM/include/t_protrom_network.h
+++ b/source/LCM/include/t_protrom_network.h
@@ -34,7 +34,7 @@ typedef enum {
PROTROM_RECEIVE_HEADER, /**< State for receiving Header.*/
PROTROM_RECEIVE_PAYLOAD, /**< State for receiving Payload.*/
PROTROM_RECEIVE_ERROR, /**< State for error handling.*/
- PROTROM_RECEIVE_IDLE /**< State for receiver idele.*/
+ PROTROM_RECEIVE_IDLE /**< State for receiver idle.*/
} Protrom_InboundState_t;
/** Defined state of the transmitter */
diff --git a/source/LCM/include/t_r15_network_layer.h b/source/LCM/include/t_r15_network_layer.h
index 5e78ddd..3d48957 100644
--- a/source/LCM/include/t_r15_network_layer.h
+++ b/source/LCM/include/t_r15_network_layer.h
@@ -286,13 +286,13 @@ typedef struct {
PacketMeta_t *MetaInfoList[COMMAND_BUFFER_COUNT+BULK_BUFFER_COUNT];
/**< List of meta data for used packets. */
RetransmissionContext_t *RetransmissionList[MAX_SIZE_RETRANSMISSION_LIST];
- /**< List of packet for retransmision */
+ /**< List of packet for retransmission */
uint32 RetransmissionListCount;
- /**< Counter for packets retransmision */
+ /**< Counter for packets retransmission */
R15_Inbound_t Inbound;
/**< Context for receiver. */
R15_Outbound_t Outbound;
- /**< Context for transmiter. */
+ /**< Context for transmitter. */
} R15_NetworkContext_t;
/*
diff --git a/source/resource.h b/source/resource.h
index eb45504..3c3fe90 100644
--- a/source/resource.h
+++ b/source/resource.h
@@ -4,7 +4,7 @@
//
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101