Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner