Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Issue with Microblaze LWIP Example code

Posted by timelmg on November 19, 2015

When I integrated this code into my code I found a strange error. 0x4000 was being inserted in the same place in random ethernet packets. After a lot of investigation I found my culprit - code I got from the demo code.

~~~~ static void prvRxHandler( void pvNetIf ) { / This is taken from lwIP example code and therefore does not conform to the FreeRTOS coding standard. */

struct ethhdr *pxHeader; struct pbuf *p; unsigned short usInputLength; static unsigned char ucBuffer[ 1520 ] attribute((aligned(32))); extern portBASETYPE xInsideISR; struct netif *pxNetIf = ( struct netif * ) pvNetIf;

XIntc_AckIntr( XPAR_AXI_ETHERNETLITE_0_BASEADDR, XPAR_AXI_ETHERNETLITE_0_IP2INTC_IRPT_MASK );

/* Ensure the pbuf handling functions don't attempt to use critical
sections. */
xInsideISR++;

usInputLength = ( long ) XEmacLite_Recv( &xEMACInstance, ucBuffer );

...

~~~~ This code is from lwIP/netif/ethernetif.c

The line XIntc_AckIntr( XPAR_AXI_ETHERNETLITE_0_BASEADDR, XPAR_AXI_ETHERNETLITE_0_IP2INTC_IRPT_MASK ); is designed to acknowledge the interrupt but it writes to the Ethernet peripheral instead of the interrupt controller. The place where it writes is in the middle of the outgoing buffer and the MASK has the value of 0x4000 in my code (it may be different in different systems).

The solution is to remove this line entirely as the interrupt acknowledgement is done in the interrupt controller driver and thus the line was irrelevant anyway.

Hopefully this will stop people getting mystery errors in the future.

Thanks,

Tim


Issue with Microblaze LWIP Example code

Posted by rtel on November 19, 2015

Thank you for taking the time to report this issue - but I'm having trouble locating the file you are referring to. Is it a file in the main FreeRTOS zip file download, or a file generated by the Xilinx SDK tools?

I'm looking in FreeRTOSDemoMicroBlazeKintex7EthernetLiteRTOSDemosrclwIPDemolwIPportnetif, where I find the following files:

xadapter.c xemacliteif.c xpqueue.c xtopology_g.c

none of which contain a function prvRxHandler().

Thanks in advance for any additional info you can provide.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS