blackswords wrote on Sunday, April 08, 2012:
Hi everybody,
I’m new on this forum and I will start with a big thanks to the FreeRTOS team, you really do a great job with this system!
I’m trying to get the uIP stack working with my STM32F103 linked with an ENC28J60 and I’m encountering some issues.
I started with the example provided and replaced the receive and send packet functions by the ones that I have for the ENC28J60.
When I ping the IP address I get a pong but if it type the IP address in my browser, nothing append. The page is loading indefinitely. What could be wrong?
I’ve already used this configuration (STM32F103+ENC28J60) with an other project and it works fine but was not satisfied with the stack, that’s why I would like to use the uIP stack.
there is my main function :
int main( void ){
struct uip_eth_addr mac = { {0x42,0x45,0x4E,0x45,0x4C,0x21} };
enc28j60Init(mac.addr);
enc28j60PhyWrite(PHLCON,0x7a4);
enc28j60clkout(2); // change clkout from 6.25MHz to 12.5MHz
uip_init();
uip_arp_init();
xTaskCreate( vuIP_TASK, "uIP", mainUIP_TASK_STACK_SIZE, NULL, mainUIP_PRIORITY, NULL );
vTaskStartScheduler();
return 0;
}
and the uIP task :
void vuIP_TASK( void *pvParameters )
{
httpd_init();
while(1)
{
/* Let the network device driver read an entire IP packet
into the uip_buf. If it returns > 0, there is a packet in the
uip_buf buffer. */
uip_len = enc28j60PacketReceive(UIP_BUFSIZE, uip_buf);
if(uip_len > 0)
{
/* A packet is present in the packet buffer. We call the
appropriate ARP functions depending on what kind of packet we
have received. If the packet is an IP packet, we should call
uip_input() as well. */
if(BUF->type == htons(UIP_ETHTYPE_IP))
{
uip_arp_ipin();
uip_input();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if(uip_len > 0)
{
uip_arp_out();
enc28j60PacketSend(uip_len,uip_buf);
}
}
else if(BUF->type == htons(UIP_ETHTYPE_ARP))
{
uip_arp_arpin();
/* If the above function invocation resulted in data that
should be sent out on the network, the global variable
uip_len is set to a value > 0. */
if(uip_len > 0)
{
enc28j60PacketSend(uip_len,uip_buf);
}
}
}
vTaskDelay( uipSHORT_DELAY );
}
}
thanks