Essential functions of FreeRTOS crash the system.

mikroC, mikroBasic and mikroPascal for PRO ARM® MCUs, supporting STM32, Tiva, Kinetis, & CEC devices
Post Reply
Author
Message
Val Gretchev
Posts: 19
Joined: 16 Apr 2012 22:01
Location: Whitby, Ontario, Canada

Essential functions of FreeRTOS crash the system.

#1 Post by Val Gretchev » 10 Jul 2018 14:29

Functions xSemaphoreGiveFromISR() and xQueueSendToBackFromISR() called in an ISR cause a system crash and never return. Here is a simple program that illustrates this condition. It is based on your demo code “Blank” and uses the EasyMx PRO v7 for STM32 board with STM32F407VGT6. All explanations and switch settings are given in the example.

These 2 functions are essential to FreeRTOS and should be fixed quickly.
Attachments
FreeRTOS_STM32F407_Blank.zip
(348.64 KiB) Downloaded 151 times

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Essential functions of FreeRTOS crash the system.

#2 Post by petar.suknjaja » 11 Jul 2018 16:11

Hi Val,
I will review it.
Kind regards,
Petar

Val Gretchev
Posts: 19
Joined: 16 Apr 2012 22:01
Location: Whitby, Ontario, Canada

Re: Essential functions of FreeRTOS crash the system.

#3 Post by Val Gretchev » 18 Jul 2018 19:50

Hello Petar
Is there any news with respect to this problem in FreeRTOS? I know this software does not generate any revenue for Mikroelektronika but it may result in additional hardware purchases. I, and the user community would like an answer soon.
Val Gretchev

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Essential functions of FreeRTOS crash the system.

#4 Post by petar.suknjaja » 19 Jul 2018 16:11

Hi Val,
I'm sorry, I haven't had time to review it, but I promise I will do it as soon as I finish some previous projects and assignments.
Kind regards,
Petar

Val Gretchev
Posts: 19
Joined: 16 Apr 2012 22:01
Location: Whitby, Ontario, Canada

Re: Essential functions of FreeRTOS crash the system.

#5 Post by Val Gretchev » 19 Jul 2018 19:51

OK Petar
Thanks for the update
Val

Val Gretchev
Posts: 19
Joined: 16 Apr 2012 22:01
Location: Whitby, Ontario, Canada

Re: Essential functions of FreeRTOS crash the system.

#6 Post by Val Gretchev » 03 Aug 2018 14:48

Hi Petar
I believe I found the problem. It appears that FreeRTOSConfig.h file has a trap that checks for interrupt priority 0. See:
#define configASSERT(x) if ((x) == 0) { taskDISABLE_INTERRUPTS(); while (1); }
If you don’t set the priority of an interrupt vector, it defaults to 0.

Solving this problem can be done in 2 ways:
Set the interrupt priority to a non-zero value:
e.g. –
// Set up interrupt vector
NVIC_IntEnable(IVT_INT_EXTI0); // Enable EXTI0 interrupt vector
// Set interrupt priority other than 0
NVIC_SetIntPriority(IVT_INT_EXTI0,_NVIC_INT_PRIORITY_LVL1);
Or, remove the trap in the configASSERT(x) statement.
e.g. –
#define configASSERT(x) if ((x) == 0) {}

Now I can proceed with writing more complicated code. Thanks,
Val

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Essential functions of FreeRTOS crash the system.

#7 Post by petar.suknjaja » 07 Aug 2018 07:40

Hi Val,
Thank you for letting us know!
Kind regards,
Petar

Post Reply

Return to “ARM PRO Compilers”