Hello!
1. I would like to ask, if there are existing an SSL implementation at Lwip Tcp Stack? If yes, where I can find? I have a LM3S8962 demo board, and I would like to use SSL at the TCP communication.
2. The Lwip Tcp/ip stack uses 8Mhz oscillator frequency, and if I turn on the PLL, the stack goes off. I think because of timing restrictions. Is there a solution for this?
Hello Gergely,
Within the StellarisWare there are no examples that use SSL with the LWiP stack. For your other question, can you provide more information when you say the "stack goes off?"
Regards,
Craig
Hello Craig!
Thanks for your response. I tried the enet_lwip demo application on the KES-LM3S8962, and I made a TCP server, where I need to send 30KB data to a TCP client. The communication between the server-client works fine (without errors) when the processor is running at 8Mhz frequency (tcp server and web server together), but when I turn on the PLL, a lot of packets have lost. I analyze the transmission with Wireshark, and there is full of error (TCP retransission, duplicate ACK). After a few wrong packets the TCP connection breaks.
Do you have any idea, how can I resolve it?
Gergely
Can you try adding this code before you set the clock to use the PLL (the SysCtlClockSet function)?
SysCtlLDOSet(SYSCTL_LDO_2_75V);
You may have to include it in this conditional:
if(REVISION_IS_A2)
{
}
Hope that helps.
I tried to add this function before PLL setup, but it didn't resolve the problem.
Here is a part of code:
intmain(void){// unsigned char i;// unsigned char a; unsigned long ulUser0, ulUser1; unsigned char pucMACArray[8]; if(REVISION_IS_A2) { SysCtlLDOSet(SYSCTL_LDO_2_75V); } // // Set the clocking to run directly from the crystal. // SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ); FOSC=SysCtlClockGet(); // // Initialize the UART for debug output. // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTStdioInit(0);
I took 2 screenshot about the transmission with and without PLL.
Where I am using PLL the total time of transmission takes 4.89-1.71=3.18 sec, and where I use 8Mhz Fosc, the total time takes only 2.40-2.32=0.08 sec.For my application is the most important thing the time :(
The board IP is 145 and the client IP is 147. I attached the screenshots, thanks for your response.
And there is the other one, where I am using PLL.
I measured the voltage on pin 7 (LDO pin) and I obtained the following values:
when using the SysCtlLDOSet(SYSCTL_LDO_2_75V) : 2.73 V , and without this: 2.48 V
I noticed that with the increase in the SysClk the Systick interval was not changed. Could you try droping the Systick interval to something similar to the 8MHz case? You could do this by adding
#define SYSTCIKKHZ_50 625
then change the line 257 code from
SysTickPeriodSet(SysCtlClockGet() / SYSTICKHZ);
to
SysTickPeriodSet(SysCtlClockGet() / SYSTICKHZ_50);
Can you try that and see if that helps at all?
I tried this code, but it didn't resolved the problem. Sending the 30KB of data seems like in the picture what I sent previously. Now I observed that this problem persists only when I try to send this "big" data. When my application has no data to send, receives from client keep alive messages, and then sends keep alive response messages, and this "communication" works fine.
If you want, I can send my application, at which You can connect with telnet, and this sends up 30kb of data. Probably You can find the problem in a few moments :) In this moment I have no more idea, what can be the problem with this.
A few more things.
1) Has the code been modified at all? This code has been run using file sizes in the MB ranges including using the PLL with the same configuration you are using (50 MHz).
2) Can you reduce the PLL frequecncy and does the transfer start working?
3) You can put the SysTick interval back to SYSTICKHZ.
Thanks a lot for giving me this idea to reduce the PLL. Well I reduced the PLL frequency to 33.33 Mhz, and the application now is working perfectly. I think it is enough for the requirements.
I put back the SysTick interval, and now I am satisfied with this parameters :)
I modified the enet_lwip demo app, to listen 2 ports at a time, one for web server, and one for a tcp connection. To the board is attached a fingerprint sensor, a card reader and a few I/O ports. The role of the app. is to send the fingerprint or card ID to a client so fast as it can.
I will think about this problem in the future, but I consider that this topic is resolved. If you will found the solution, please tell me. Thanks for your help.
Hello Gergerly,
You are welcome. Glad it is working for you now.
Take a look at Evaluating PeerSec Networks MatrixSSL on a Stellaris Microcontroller (AN01244)
: