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


PIC32 Application hanging in vListInsert

Posted by Scott Olson on November 7, 2012
Hello, I have an application running on a PIC32 and is hanging in the vListInsert, right by the big comment with suggestions for fixing issues :)

The application will run for a while, and work fine, until it seems to somewhat randomly hang in this function.

Here is my summary:

* Micro: PIC32MX795F51L
* Compiler: C32
* Version: v7.1.1
* Standard Demos work

Steps I have taken:
*Made sure configCHECK_FOR_STACK_OVERFLOW = 2 and I have provided the vApplicationStackOverflowHook function, nothing ends up in there
* Checked the uxTaskGetStackHighWaterMark for all of the tasks, they seem to have plenty of stack space left
* Checked the interrupt priorities, as far as I understand, they look OK to me. Here is what they are set at:


This application uses interrupts for CAN communication, here is their priority settings:


When it hangs, the call stack can be traced back out to this line:

CANMessage_STR * message_PTR;
portBASE_TYPE status;

status = xQueueReceive(xQueueHandleCANSend, (const void *) &message_PTR, (2/portTICK_RATE_MS));

RE: PIC32 Application hanging in vListInsert

Posted by Scott Olson on November 7, 2012
Sorry I forgot to ask an actual question... Does the interrupt priority setting look OK? What would be my next thing to check? From reading other posts regarding this issue, it looks like some corruption of memory could be to blame somewhere in the application?

RE: PIC32 Application hanging in vListInsert

Posted by MEdwards on November 7, 2012
I'm looking at serial.c in the standard demo as a reference. The function it calls to set the interrupt looks quite different to the one you are using so I guess the microchip API has changed since the demo was written. I would say though that if INT_PRIORITY_LEVEL_4 sets the interrupt priority to 4 then that could be your problem. If the CAN interrupt calls FreeRTOS functions then the priority needs to be 3 or lower. I have no idea what the sub priority is.

Also, are you entering the interrupt through the assembly code wrapper as described on the web page, and shown in the example I'm looking at?

RE: PIC32 Application hanging in vListInsert

Posted by Scott Olson on November 7, 2012
Thanks, that did the trick. I have read and re-read the page talking about the interrupt priority, but I somehow got my head turned around reading about the Cortex M3 inverted priority order and thought 4 was lower than 3.... Thanks again!

[ 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