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

vPortValidateInterruptPriority fails with any DMA priority

Posted by ajcurtis84 on June 26, 2015

Hello,

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:

:::C
#!NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
#.
#.
#/* 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;
#NVIC_Init(&NVIC_InitStructure);
#/* 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;
#NVIC_Init(&NVIC_InitStructure);
#.
#.
#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_Cmd(sEE_I2C_DMA_CHANNEL_TX, DISABLE);
#        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.

Thoughts?

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