Quality RTOS & Embedded Software

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


vPortValidateInterruptPriority fails with any DMA priority

Posted by ajcurtis84 on June 26, 2015


I am trying to use the I2C functions found in stm32f10xi2c.c. The one exception is that I am trying to unlock a semaphore from within the DMA IRQ handlers for synchronization. Even setting the IRQ priority to configLIBRARYLOWESTINTERRUPTPRIORITY fails.

Here are the pertinent snippets of code:

#/* Configure and enable I2C DMA TX Channel interrupt */
#NVIC_InitStructure.NVIC_IRQChannel = DMA1_Channel6;
#NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_LOWEST_INTERRUPT_PRIORITY;
#NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
#NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
#/* Configure and enable I2C DMA RX Channel interrupt */
#NVIC_InitStructure.NVIC_IRQChannel = DMA1_Channel7;
#NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configLIBRARY_LOWEST_INTERRUPT_PRIORITY;
#NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
#void sEE_I2C_DMA_TX_IRQHandler(void) {
#    BaseType_t HigherPriorityWoken = pdFALSE;
#    /* Check if the DMA transfer is complete */
#    if (DMA_GetFlagStatus(sEE_I2C_DMA_FLAG_TX_TC) != RESET) {
#        /* Disable the DMA Tx Channel and Clear all its Flags */
#        DMA_ClearFlag(sEE_I2C_DMA_FLAG_TX_GL);
#        /*!< Wait till all data have been physically transferred on the bus */
#        sEETimeout = sEE_LONG_TIMEOUT;
#        while (!I2C_GetFlagStatus(sEE_I2C, I2C_FLAG_BTF)) {
#            if ((sEETimeout--) == 0)
#            sEE_TIMEOUT_UserCallback();
#        }
#        /*!< Send STOP condition */
#        I2C_GenerateSTOP(sEE_I2C, ENABLE);
#        /* Perform a read on SR1 and SR2 register to clear eventually pending flags */
#        (void) sEE_I2C->SR1;
#        (void) sEE_I2C->SR2;
#        /* Reset the variable holding the number of data to be written */
#        *sEEDataWritePointer = 0;
#        xSemaphoreGiveFromISR(EepromDoneCondition,&HigherPriorityWoken);
#        portYIELD_FROM_ISR(HigherPriorityWoken);
#    }

I am only having this problem with DMA. GPIO EXTI works fine.


  • Allen

vPortValidateInterruptPriority fails with any DMA priority

Posted by rtel on June 26, 2015

Hmm. First look seems to indicate you have done everything necessary. Probably a stupid question, but are you sure the interrupt you are setting the priority for is the one that is actually executing - and more likely - that nothing in the ST drivers is resetting the priority after you have set it?

The other thing to check would be that the number of priority bits is set correctly in FreeRTOSConfig.h - although if you are using FreeRTOS V8.2.1 then I think that is done automatically for you using another assert(), worth checking though.

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

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.


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


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