Quality RTOS & Embedded Software

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




Loading

migrating from 8.0.0 to 8.2.1

Posted by williamjsell on May 20, 2015

I had an issue with the migration from 8.0.0 to 8.2.1. I copied all relevant files over and the built the new image (I had to remove a cast from FreeRTOSConfig.h for configMAX_PRIORITIES). When I ran the system, I had an assertion on line 3466 in tasks.c:

	if( pxMutexHolder != NULL )
	{
		/* A task can only have an inherited priority if it holds the mutex.
		If the mutex is held by a task then it cannot be given from an
		interrupt, and if a mutex is given by the holding task then it must
		be the running state task. */
		configASSERT( pxTCB == pxCurrentTCB );

This works fine on the 8.0.0, but this assert check is not made, so maybe something bad is happening and not being trapped? Anyway, I had to pull back to 8.0.0 until I can get an indication as to the problem.


migrating from 8.0.0 to 8.2.1

Posted by rtel on May 21, 2015

Some optimisations were made to giving semaphores from interrupts. Previously the semaphore give from ISR macro used the queue send from ISR function - now it has its own function which allows it to be slimmer (parts of the function relevant only to a queue do not have to be executed). That did however mean that mutexes can no longer be given from interrupts if a priority has been inherited - as you have found.

It may be possible to call xQueueSendFromISR() to give a mutex from an interrupt, instead of xSemaphoreGiveFromISR() (you may need to cast the SemaphoreHandlet to a QueueHandlet when passing in the parameter to avoid compiler warnings). It is on our todo list to look at this to see if it is safe, and if not, make it safe. You could try it.

Regards.


migrating from 8.0.0 to 8.2.1

Posted by williamjsell on July 22, 2015

I just encountered this problem again on a different processor and project; I am not sure what you are suggesting for a solution. If I follow the call stack back, the call to xSemaphoreGive(calibrationMutex); is made, but as you can see this is not from an ISR. Isn't this a critical error in the v8.2.1, seeing that I have encountered it twice now...?


migrating from 8.0.0 to 8.2.1

Posted by edwards3 on July 22, 2015

Is the task giving the mutex holding the mutex? Or is it giving it without taking it first?


migrating from 8.0.0 to 8.2.1

Posted by williamjsell on July 23, 2015

I have a gatekeeper task which takes the mutex, which allows the gk queue to fill with additional requests. The GK task signals an event_group which pumps a state machine. When the state machine has concluded, it calls a function to give the mutex, which allows the next request in the queue to run. This scheme works well with 8.0.0 but fails with 8.2.1


migrating from 8.0.0 to 8.2.1

Posted by richard_damon on July 24, 2015

That sounds like a better use for a semaphore than a mutex. The big feature of the mutex over a semaphore is that it will boost the priority of the task holding it to avoid priority inversion if needed. It sounds like the task that took the mutex (the Gate Keeper) isn't the task responsible for the processing so the priority boost doesn't do anything.

I am also not sure from your description who else is trying to acquire the mutex to provide the exclusion.


migrating from 8.0.0 to 8.2.1

Posted by athos1984 on October 2, 2015

I have the same issue. No ISR involved, no difference between semaphore and mutex, no issue in RTOS v8.0.0.

Is there any possibility to get a solution?


migrating from 8.0.0 to 8.2.1

Posted by athos1984 on July 5, 2016

Still there, also with v9.0.0


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists