Quality RTOS & Embedded Software

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


Loading

8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by stephanhd on April 7, 2015

Hi tasker,

as the change started in FREERTOS, I start here as well.

Problem: In queue.c there is a new (compared to 8.2.0) assert in:

BaseTypet xQueueGiveFromISR( QueueHandlet xQueue, BaseType_t * const pxHigherPriorityTaskWoken ) *... */ Normally a mutex would not be given from an interrupt, and doing so is * definitely wrong if there is a mutex holder as priority inheritance makes no * sense for an interrupts, only tasks. */ *configASSERT( !( ( pxQueue->uxQueueType == queueQUEUEISMUTEX ) && ( pxQueue->pxMutexHolder != NULL ) ) ); *...

unfortunately, Atmels ASF "freertosspimaster.c" (3.21.0) uses this and the assertion fails:

static void localspihandler(const portBASETYPE spiindex) *... */ If the driver is supporting multi-threading, then return the access mutex. */ * if (txdmacontrol[spiindex].peripheralaccessmutex != NULL) { * xSemaphoreGiveFromISR( * txdmacontrol[spiindex].peripheralaccessmutex, * &higherprioritytask_woken); * } *...

I used "freertosspimaster.c" and FR 8.2.0 w/o any problems (having HIGH SPI volume) so: what is the danger here if I would deactivate the assertion (of course in a first step!); I will ask the Atmel team as well in parallel (or is s/o from Atmel listening here?)

Best and thanks, Stephan


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by rtel on April 7, 2015

Hmm. Are you using the version of FreeRTOS that came with the ASF?

Some changes were made to the mutexes to allow the priority inheritance to work better when more than one mutex was held. Also a new function was introduced specifically for giving semaphores in interrupts (for better performance). Probably the ASF code needs to be updated. I can talk with Atmel about this. In the mean time I would suggest updating the driver to use a binary semaphore created with xSemaphoreCreateBinary() rather than a mutex created with xSemaphoreCreateMutex().

Regards.


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by stephanhd on April 7, 2015

Are you using the version of FreeRTOS that came with the ASF? nope; the FreeRTOS Version that comes with ASF 3.21.0 is "8.0.1"...

I can talk with Atmel about this. That would be really nice!

Thanks and good night, Stephan


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by pugglewuggle on August 31, 2015

Richard, I appear to be having this issue as well with ASF 3.26.0 and FreeRTOS 8.2.2 except in the TWI service for FreeRTOS, I haven't tried with the SPI version yet. Are you aware of any resolution regarding this? For the time being it appears the FreeRTOS services in ASFwill not work with any FreeRTOS version newer than 8.1.2.


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by pugglewuggle on August 31, 2015

PS - also experiencing this with ASF 3.20.1


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by pugglewuggle on September 7, 2015

Anybody?


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by rtel on September 7, 2015

I think the only way around this is to update the code so it uses a binary semaphore instead of mutex.


8.2.1 "queue.c" vs ASF 3.21.0 "freertos_spi_master.c"

Posted by pugglewuggle on October 28, 2015

Do you have any specific recommendation on how to best accomplish this with the ASF examples?


[ 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