Tool/software:
I have an application that utilizes a modified version of LWIP with IPC messages for communication between the DSP and CPU1.
The following sequence occurs when a UDP packet is received:
-
Forwarding to CPU1:
- An IPC message containing the UDP packet data is sent to CPU1 using
IPC_sendCommand(IPC_CM_L_CPU1_R, IPC_FLAG0, IPC_ADDR_CORRECTION_ENABLE, IPCTOCPU_PROTO_PCK, (uint32_t)packetData, (uint32_t)pckLength);
IPC_waitForAck(IPC_CM_L_CPU1_R, IPC_FLAG0);
is called to wait for an acknowledgment from CPU1.
- An IPC message containing the UDP packet data is sent to CPU1 using
-
Processing by CPU1:
- CPU1 processes the received packet.
-
Sending Response from CPU1:
- CPU1 sends a response to CM using
IPC_sendCommand(IPC_CPU1_L_CM_R, IPC_FLAG1, IPC_ADDR_CORRECTION_ENABLE, IPCTOCM_PROTO_PCK, (uint32_t) packetDataTx, nByte);
IPC_waitForAck(IPC_CPU1_L_CM_R, IPC_FLAG1);
is called to wait for an acknowledgment from CM.
- CPU1 sends a response to CM using
Problem:
The code intermittently enters a loop, indicated by the assembly instructions:
F24D0004 movw r0, #0xd004
00001628: F2C4000F movt r0, #0x400f
0000162c: 6800 ldr r0, [r0]
0000162e: 0840 lsrs r0, r0, #1
00001630: D3F8 blo #0x1624
According to the datasheet, 0x400fd004 corresponds to an IPC configuration register. This loop appears to be associated with the IPC_waitForAck()
function:
static inline void IPC_waitForAck(IPC_Type_t ipcType, uint32_t flag) {
while((IPC_Instance[ipcType].IPC_Flag_Ctr_Reg->IPC_FLG & flag) != 0U) {
// Wait for flag to be cleared
}
}
where #define IPC_FLAG0 0x00000001U
is the flag used for ethernet messages from CM to CPU1.
Removing both IPC_waitForAck()
calls did not resolve the issue.
Could you please provide guidance on troubleshooting this issue? I can share relevant code snippets via private message if needed.