Hi everyone!
I had a problem when I was trying to memcpy p->payload directly into a systems memory. I tried to do it as below.
memcpy
(
(unsigned int *)(SYSTEM_MEMORY + 4*size),\
(unsigned int *)(p->payload+PACKET_HEADER),
bytesReceived-PACKET_HEADER
);
This didn't work at all, and my packets data part didn't get copied. Then I tried to do it as follows.
char *receiveBuffer = malloc(sizeof(char) * DATA_PART);
if(receiveBuffer == NULL){
xil_printf("out of memory\n");
}
memcpy(receiveBuffer, p->payload+PACKET_HEADER, bytesReceived-PACKET_HEADER);
And now from *packet I'm able to copy it into my systems memory address.
memcpy
(
(unsigned int *)(WARPLAB_TXBUFF_RADIO1 + 4*rxArgs0),\
(unsigned int *)(receiveBuffer),
bytesReceived-PACKET_HEADER
);
Any reason why I wasn't able to copy it directly from p->payload?