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 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) 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