ea4mz wrote on Tuesday, January 17, 2017:
Hi Hein and RTE,
Thank you very much for your answer, I will try to explain more in detail the problem:
The binary parser I am trying to implement on port 7081 is quite similar to the one implemented in FreeRTOS labs for the echo server:
- There is a server listening for incomming connections to port 7081
- When there is a new connection it spawns a task to handle it
- The handler decodes the command and then answer back the data, result, etc.
There is not any interrupt involved in my code, unless the handling of sockets in FreeRTOS is interrupt driven???
Here is the structure I am filling with values inside the task that handle values:
char Ip0; // 1
char Ip1; // 2
char Ip2; // 3
char Ip3; // 4
Then when you handle this inside the task:
Assign and address to pointer:
StandardInfo_p = (StandardInfo_t *)FIRST_BYTE_ANSWER_PTR;
Then assing a value to the elements inside the structure:
counter = 1;
StandardInfo_p->Ip0 = (char)counter;
StandardInfo_p->Ip1 = (char)counter;
StandardInfo_p->Ip2 = (char)counter;
StandardInfo_p->Ip3 = (char)counter;
Everything is OK until you start assigning a value to float, then it crashes:
StandardInfo_p->UL1_RMS = (float)counter;
StandardInfo_p->UL2_RMS = (float)counter;
StandardInfo_p->UL3_RMS = (float)counter;
When using another commands that do not use floats everything is OK.
Thanks again for your help.