cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4

benjaminguillot.699
Associate II
Posted on January 08, 2013 at 15:24

Hi, I am using the STM3240G card with STM32F4 microcontrolleur. I would generate PWM for motor control. However, I need to handle data coming from a primary card ( beagle board) by ethernet (RJ45) with udp protocol.

I am stuck because I don't find how I can capture the data received from the ethernet wire.

I use DMA controlleur. I kwnow that data received is store in a specific buffer (pbuf) but when i try to screen the data value on the LCD screen, nothing happen. I also use the ETH_Get_Received_Frame() to reach the Buffer1Addr in a ETH_DMADESCTypedef structure, but I can't recover incoming data.

I use 

#done!
2 REPLIES 2
benjaminguillot.699
Associate II
Posted on January 16, 2013 at 11:14

Resolved, what i did : 

char temp[20];

data = malloc(20*sizeof(*data));

tot_length = p->tot_len;

length = p-> len;

data_addr = p->payload;

memcpy (data, p->payload, length);

LCD_ClearLine(Line3);

LCD_ClearLine(Line4);

  LCD_ClearLine(Line5);

  LCD_ClearLine(Line6);

LCD_ClearLine(Line7);

LCD_ClearLine(Line8);

  LCD_SetTextColor(White);

sprintf(temp,''length: %X'',length);

LCD_DisplayStringLine(Line4, (uint8_t*)temp);

sprintf(temp,''tot_length: %X'',tot_length);

LCD_DisplayStringLine(Line5, (uint8_t*)temp);

sprintf(temp,''data_addr: %X'',data_addr);

LCD_DisplayStringLine(Line6, (uint8_t*)temp);

sprintf(temp,''dataCpyAd: %X'',data);

LCD_DisplayStringLine(Line7, (uint8_t*)temp);

LCD_SetTextColor(Green);

LCD_DisplayStringLine(Line8, (uint8_t*)data);

benjaminguillot.699
Associate II
Posted on January 16, 2013 at 11:16

I miss to use the function ''memcpy (data, p->payload, length);''