Quality RTOS & Embedded Software

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


Loading

FreeRTOS Learning

Posted by eaoiyrioeaf on February 28, 2017

I'm learning FreeRTOS currently, I will try to write down what I learned from the source code and share it in this forum. hope it can help the beginner, and if I have made some mistake, it will be highly appreciated if some one can point out.


FreeRTOS Learning

Posted by eaoiyrioeaf on February 28, 2017

Don't know how to insert picture, attached picture is how I understood the List of FreeRTOS.

Attachments

001.jpg (74060 bytes)

FreeRTOS Learning

Posted by eaoiyrioeaf on February 28, 2017

Another picture to explain the function: void vListInsert( Listt * const pxList, ListItemt * const pxNewListItem )

Attachments

002.jpg (55697 bytes)

FreeRTOS Learning

Posted by eaoiyrioeaf on February 28, 2017

Picture to explain the function: UBaseTypet uxListRemove( ListItemt * const pxItemToRemove )

Attachments

003.jpg (60940 bytes)

FreeRTOS Learning

Posted by heinbali01 on February 28, 2017

Hi John, thanks for the clear pictures. That all looks correct to me.

As you can see, the List_t type has been implemented with a minimum RAM footprint. All items (elements) know to which list they belong, if any. Each node in the list is part its object.

For instance, an example taken from FreeRTOS+TCP: a network buffer is either linked into a free list or into a list of occupied buffers. In order to make it linkable, it gets a ListItem_t field:

~~~~ typedef struct xNETWORKBUFFER { ListItemt xBufferListItem; /* Used to reference the buffer form the free buffer list or a socket. / uint32_t ulIPAddress; / Source or destination IP address, depending on usage scenario. / uint8_t *pucEthernetBuffer; / Pointer to the start of the Ethernet frame. */ ... } NetworkBufferDescriptor_t; ~~~~

Now xBufferListItem will always point to one of the two lists. You can add more ListItem_t's to your objects to make them linkable to several lists.

The List_t type has been exposed in a header file, but normally developers will not make use of them. It is a type definition "internal to the kernel". But you're free to use it, of course. Note that with a few additions (wrappers), you can create both FIFO's and stacks, based on List_t.

Other objects are more important for most developers: Queue's, Semaphores, Event-Groups and the mechanisms to notify (and wake-up) a task.


FreeRTOS Learning

Posted by eaoiyrioeaf on February 28, 2017

Hello Hein, your explanation help me a lot to move forward, Thank you very much Sir!


[ 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