Quality RTOS & Embedded Software

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




Loading

Does xQueueSendToBack() work inside a non-ISR or non-tasks too?

Posted by shubham294 on September 4, 2017

Hi folks,

I was wondering if it is possible to enque an item to a queue by an entity other than a FreeRTOS task/ISR.

I was going through the multi-threaded netconn API implementation in LWIP and saw that there was a function which polls the ethernet drivers and enques an item (actually, posts in a mailbox) to a FreeRTOS queue. That function seems to be neither a FreeRTOS task, nor an ISR. As far as I know, the scheduler needs to know the call context, which often is a task so that the calling task can be put into blocked/un-blocked state.

I could be wrong at some places so please feel free to correct me.


Does xQueueSendToBack() work inside a non-ISR or non-tasks too?

Posted by heinbali01 on September 4, 2017

That function was neither a FreeRTOS task and nor an ISR

Once the scheduler has started, all running code is either called from a task, or from an ISR.

As you probably know, ISR code uses FreeRTOS API's that end with FromISR(). All other API's are being used in a task context. And yes there are a few exceptions, depending on the type of port.

So xQueueSendToBack() can be called from within a task.

I'm afraid that I don't know how all details of lwIP ported to FreeRTOS.

FreeRTOS has developed its own complete TCP/IP stack called FreeRTOS+TCP. After a few years of development and intensive testing, we now consider it stable. It is very much integrated with the kernel. It uses kernel primitives to implement API's and message passing. It has been ported to several hardware platforms ( CPU's and PHY's ).


[ 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