Wrong values getting assigned when same structure assignment is done.
I am developing an TCP/IP Server Client application on my NUCLEO-F207ZG development board.I am implementing a function to send ADC values on Ethernet.
void Client_Data_Send(void)
{
char temp_buff[TEMP_BUFF_SIZE];
volatile uint32_t buff_len;
volatile uint16_t Temperature = 0;
struct pbuf *p = NULL;
Temperature = TEMP;
buff_len = sprintf(temp_buff,"DHT11 Sensor value from TCP Client : %u \n\r",Temperature);
/*allocate pbuf from ram*/
p = (pbuf_alloc(PBUF_TRANSPORT,buff_len,PBUF_POOL));
(tcp_client->p)= (p);
if(tcp_client->p != NULL)
{
/*copy the data to send into the allocated pbuf*/
pbuf_take( tcp_client->p ,(char *)temp_buff,buff_len);
/*send data*/
tcp_client_send(tx_pcb, tcp_client);
/*free mem*/
pbuf_free( tcp_client->p);
}
}
Above is the function I implemented.
At line (tcp_client->p)= (p); when I debuged I came to know that values are not getting assinged.
Below are the screen shot.


since wrong values for all members getting assigned I am facing Hard fault issue. Is it structure alignment issue? I am using LwIP library for Tcp/Ip application.
