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:
*BaseType_t xQueueGiveFromISR( QueueHandle_t 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 == queueQUEUE_IS_MUTEX ) && ( pxQueue->pxMutexHolder != NULL ) ) );
*…
unfortunately, Atmels ASF “freertos_spi_master.c” (3.21.0) uses this and the assertion fails:
*static void local_spi_handler(const portBASE_TYPE spi_index)
*… / If the driver is supporting multi-threading, then return the access mutex. */
if (tx_dma_control[spi_index].peripheral_access_mutex != NULL) {
I used “freertos_spi_master.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?)
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().
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.