This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
Original post solve my problem.
Now i want to move my code in sdk 3.20.0.10.
I follow all step which mention in original post for ping request but ping request always "Reply timeout".
Also, I simply import project code from (workspace for sdk2.30) to (workspace sdk3.20). but that code work with (workspace for sdk2.30) and not work in (workspace sdk3.20). (workspace sdk3.20) code "Reply timeout".
Dinkar
Hi Dinkar,
I will get back to you shortly after I try reproducing this on my end.
BR,
Seong
Hi dinkar,
Please see this related thread: https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/782195?MSP432E401Y-ICMP-ping-checksum-is-set-to-0
BR,
Seong
Hi,
Thanks for reply,
I want to use original library function because i want to use RTOS.
You send me a thread which is discuss for no rtos code.
Have you check with original question code sequence?
Thanks,
Dinkar
Hi Dinkar,
I've replicated your issue with the latest v.3.30 SDK, and it seems like the icmp packets do not have their checksums added correctly, just like what is described in https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/782195?MSP432E401Y-ICMP-ping-checksum-is-set-to-0
I will need to debug this and see how to re-enable the icmp checksum generation, and I appreciate your patience as I take a look at this.
Regards,
Michael
Hi Dinkar,
I figured out a fix to get ping functionality to work within the RTOS-enabled NDK.
Just like with LWIP, there seems to be an issue when the checksum is calculated in software, as the SW-calculated checksum gets overwritten somewhere in the network stack. To fix this, we need to let the hardware generate the checksum.
It turns out that doing so is as simple as providing a NULL checksum, and letting the hardware write the checksum field itself. To do so with the code you had previously working on the v2.30 SDK, you simply need to modify the BuildPing() function in conping.c to remove the checksum generation step like so:
static void BuildPing( char *pBuf, uint16_t seq ) { ICMPHDR *pIcHdr; ICMPREQHDR *pReqHdr; int cc; /* Fill in the ping data buffer */ for( cc = 8; cc < DATALEN; cc++ ) *(pBuf+cc) = '0'+cc; /* Get pointers to the ICMP and ICMPREQ headers */ pIcHdr = (ICMPHDR *)pBuf; pReqHdr = (ICMPREQHDR *)pIcHdr->Data; /* Fill out echo request */ pIcHdr->Type = ICMP_ECHO; pIcHdr->Code = 0; pReqHdr->Id = HNC16(PING_IDENT); pReqHdr->Seq = HNC16(seq); /* Checksum the ICMP header */ /* Although the checksum function is reentrant, we follow the rules */ /* and call llEnter()/llExit() since this is a stack function. */ llEnter(); //ICMPChecksum( pIcHdr, DATALEN ); pIcHdr->Checksum = 0; llExit(); }
That should allow the hardware to compute and write the ICMP checksum, allowing ping to work. Let me know if that doesn't work for you, or if you have further questions about the ICMP functions of the MSP432E4.
Regards,
Michael
Hi Michael,
Thanks for helping.
This is work for me for SDK3.20.
Is this same ping code works for SDK3.30?
Thanks ,
Dinkar
Hi Dinkar,
I was actually debugging and testing the ping code on SDK v.3.30. The code provided definitely works for v.3.30, but it's good to know that it also works on v.3.20.
Regards,
Michael
**Attention** This is a public forum