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

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 ]    [ 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