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

Low priority tasks stop getting scheduled despite idle activity on LPC1517 (Cortex M3)

Posted by jdupre on March 24, 2016

System is NXP LPC1517 running FreeRTOS V8.0.1. I got the base code from the LPCOpen library. Using LPCXpresso IDE (GCC). Chip running at 72MHz, FreeRTOS tick is 1ms interval.

I have 3 tasks:

TaskSystem: priority 0 This is the first task to run. It loads user settings from eeprom, then creates the additional tasks. vTaskDelay() pauses it for 10 seconds then checks for for changes to the user settings and saves if necessary.

TaskSerial: priority 1 Serial ISR gives semaphore via xSemaphoreGiveFromISR() to task when data frame is recieved. The task then updates an LED display if data has changed, and calculates a value to set a match point for a timer. This happens about 40 times per second when active. When inactive, xSemaphoreTake() times out after 1250ms to signal inactivity by changing the display.

TaskUI: Priority 2 ISR is triggered when any 1 of 3 buttons is pressed or released. The ISR detects which button(s) were pressed or released, does some debouncing, uses xTaskGetTickCountFromISR() to measure how long button was held down, and then xSemaphoreGiveFromISR() signals task to process the button activity. When there is no button activity, xSemaphoreTake() times out after 5 seconds and prints out high water marks for each task. (Except the idle task-- not sure how to do that.)

Independent of the OS is a counter-timer peripheral ISR that is set at the highest IRQ priority. It is triggered at 60Hz.

Under "normal" operation everything appears to operate as expected. However, when I do a "monkey test" (randomly pressing the buttons rapidly), the lower priority tasks stop running. Even after the buttons are no longer pressed, and the TaskUI's xSemaphoreTake() times out, the other tasks do not get scheduled. There may well be logical errors in how my ISR handles the button presses, but that shouldn't affect other tasks should it?

I have verified that the IRQ for TaskSerial is still getting called, but giving the semaphore to the task does nothing.

I moved the high water mark test to the UI Task, and no task reports less than 17.

I have watermarked all 12K of RAM at startup, and it appears there is still at least 7K of untouched RAM after the low priority tasks stop running.

Any ideas why this is happening? What else can I test for?

Thanks,

  • Joe

Low priority tasks stop getting scheduled despite idle activity on LPC1517 (Cortex M3)

Posted by richard_damon on March 25, 2016

Have you defined configASSERT()? You say that you have an ISR at the 'highest' priority. I don't know about the LPC port, but many ports define a max priority that a interrupt may have and still be able to call FreeRTOS API functions, and having an interrupt higher than that can cause the sort of thing you describe (the too high priority ISR bypasses critical sections and corrupts some of FreeRTOS's internal state)


[ 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