Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


PIC32 Problem

Posted by Bso on August 14, 2013

I use the version 7.5.2. PIC32MX-port on a
-DM320004-board, MPLABX-XC32,
-TIMER5 as tick-timer,
-5 tasks with queues5
-trace with DBPRINTF.
i have the following problem.
- I prepare trace messages from Tasks with va_xxx
- vPortMalloc space for the data
- send message with the pointer to the trace task.
- trace task, Output with DBPRINTF is ok
- then free the mem
this works about 3x, then
at the next xQueueReceive(p-> hQID, & m, portMAX_DELAY);

general_exception, _epc_code 0x800414
general_exception_ adr/code/ 0x9D0211C0 / 5
from map-file:
.text.MACMemCopyAsync 0x9d0210fc 0xa4 164
.text.uxListRemove 0x9d0211a0 0xa0 160
.rodata 0x9d021240 0xa0 160 Read-only const

in Tasks.c line 18622 if( uxListRemove( &( pxCurrentTCB->xGenericListItem ) ) == ( unsigned portBASE_TYPE ) 0 )

-sometimes the Problem occurs during the vPortFree
-sometimes after the first message DBPRINTF
-if I in the same Task: alloc - DBPRINTF - free , it works always.

anyone an idea ?

RE: PIC32 Problem

Posted by Richard on August 15, 2013
How does DBPRINTF work (through a serial port? semi-hosting, etc.)?

Does the code run if you comment out the calls to DBPRINTF (leaving the memory allocation and freeing, just not printing out the message)?

Does the code run if you use the "debug and run" option from the IDE?

Maybe using the MIPS manuals to decode the cause of the exception would help (possible).

Do you have configASSERT() defined?

Are you using stack overflow detection?


RE: PIC32 Problem

Posted by Bso on August 15, 2013
DBPRINTF works trough the PIC32MX440F512H USB microcontroller for on-board debugging.on the dm320004.board, MPLABx-ide debuger, usb

-does not run if i disable DBPRINT , compilerswitch

-exception-codes from pic-manual: sometimes 5:address error,store , or 4:address error load/instruction fetch

-configASSERT() defined

-configCHECK_FOR_STACK_OVERFLOW = 2, hook not called,


RE: PIC32 Problem

Posted by Marcel van Lieshout on August 16, 2013
You use TIMER5 as System Tick. Did you change the last lines in vPortIncrementTick() in file Source\portable\MPLAB\PIC32MX\port.c from
/* Clear timer 1 interrupt. */

/* Clear timer 5 interrupt. */

RE: PIC32 Problem

Posted by Bso on August 16, 2013
i use

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS