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

ARM M4 Interrupt and list.c stuck

Posted by holyhope on April 17, 2015

Goodmorning to all. I'm developing with FreeRTOS 8.0.2 for uP FreeScale K20 I'm using KDS 2.0.0 for developing firmware and Processor Expert to install FreeRtos. I suppose that is an official version (8.0.2) of FreeRTOS and not modified. I have not directly downloaded form this site but it was generated from ProcesorExpert I'm using "Cross ARM GCC" compiler, I not see the version

I read the guide for arm-cortex-M4 about priority and I have this problem... But I can't resolve it, or understand perfectly the problem.

I have several task, the problem origin when I use 2 task; the first is used for manage external device (and speach to ModBus task for low level communication) and the second is used for manage the internal ADC of uP.

I have 2 interrupt for the 2 ADC-Conv inside the uP. After some conversion, inside TIMER interrupt (not ADC interupt but timer interrupt) I do a xQueuePutFromISR that that awake ADC tast (that is waiting in xQueueReceive )

The task for manage external device communicate via ModBus task via some semaphoreGive and some queue.

If I enable All two task, after a deterministic number of iteration, I see my code stuck in void vListInsert( Listt * const pxList, ListItemt * const pxNewListItem ) where there is an explanation that say: 1) Stack overflow - see http://www.freertos.org/Stacks-and-stack-overflow-checking.html 2) Incorrect interrupt priority assignment, especially on Cortex-M parts where numerically high priority values denote low actual interrupt priorities, which can seem counter intuitive. See http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition of configMAXSYSCALLINTERRUPT_PRIORITY on http://www.freertos.org/a00110.html 3) Calling an API function from within a critical section or when the scheduler is suspended, or calling an API function that does not end in "FromISR" from an interrupt. 4) Using a queue or semaphore before it has been initialised or before the scheduler has been started (are interrupts firing before vTaskStartScheduler() has been called?). I try to do: -check StackOverflow: I have enabled stackoverflowhook via FreeRtos but seems do not enter here my code... - Priority: I modify some interrupt priority and task priority. Modifing them I see change in duration time of my code before it stuck but never resolved my problem

Due my code execute very well many times before it stuck I exclude the 3 and 4 case...

i suppose that there is something wrong with priority: and I read the literature about it but i can't resolve my problem (maybe I do not understand very well...)

What I can do?

Many thanks, Massimiliano


ARM M4 Interrupt and list.c stuck

Posted by rtel on April 17, 2015

I'm using KDS 2.0.0 for developing firmware and Processor Expert to install FreeRtos

Which compiler are you using? Are you using an official FreeRTOS version, be it from the FreeRTOS download or obtained from another source?

I read the guide for arm-cortex-M4 about priority and I have this problem... But I can't resolve it, or understand perfectly the problem.

I can assure you you are not the only person to be confused by the interrupt priority mechanisms on the Cortex-M.

Do you have configASSERT() defined? If not please define it and it may show you where the problem is right away. http://www.freertos.org/a00110.html#configASSERT

Regards.


ARM M4 Interrupt and list.c stuck

Posted by holyhope on April 17, 2015

Goodmorning, many thanks for you answer. I have dited first topic for adding the information required. I cann tell you that:

-I suppose that is an official version (8.0.2) of FreeRTOS and not modified. I have not directly downloaded form this site but it was generated from ProcesorExpert - for problem on interrupt.. yes I see that there are many person that are very very very confused! :-( I do not know if priority is linked to priority of task or interrupt priority. I supposte that there is a problem if I use maxsyscall of a number less then priority of one interrupt that I use with xMessagePutFromISR (or more than, because priority are in reverse ordeer...) - configASSERT I suppose I use that, because sometime my code stuck here and it is verey simple understand problem! (in this case, no one of configASSERT was reach...)

What I can do? Many thanks for answer! Massimiliano

edit: I'm using internal "cross arm GCC" compiler (gived with KDS


[ 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