Quality RTOS & Embedded Software

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


Loading

pucGetNetworkBuffer() and BufferAllocation_1.c

Posted by tc-cadscan on December 21, 2017

I'm attempting to write a zero-copy network driver for FreeRTOS+TCP. The DMA alignment requirements for the chip I'm using mean that I need to use statically allocated buffers (i.e. BufferAllocation1.c). The page on porting says that the receive buffers should be allocated to the DMA at start-up using pucGetNetworkBuffer(), but this isn't defined in BufferAllocation1.c, only in BufferAllocation_2.c

I think I can get around this by getting a full descriptor (using pxGetNetworkBufferWithDescriptor()), and using the buffer from that. Then set the descriptor's buffer pointer to NULL and give it back to the TCP/IP stack, like in the receiving data example on the porting page. However there doesn't seem to be anything in BufferAllocation_1.c to prevent a descriptor with a NULL pointer from being reused, so I'm not sure if this will actually work?

It seems as though the examples on the porting page for writing zero-copy drivers couldn't actually work with the code as is. Looking on this forum though, it seems several people have had success writing zero-copy drivers before, so it must be possible. Am I missing something here?


pucGetNetworkBuffer() and BufferAllocation_1.c

Posted by rtel on December 21, 2017

Have a look at the Zynq example in the labs download. I think that uses BufferAllocation_1.c and might be a good reference.


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




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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 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