Quality RTOS & Embedded Software

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


Loading

PIC32 Problem

Posted by Bso on August 14, 2013
Hi,

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?

Regards.

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,

Regards

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. */
IFS0CLR = _IFS0_T1IF_MASK;

to
/* Clear timer 5 interrupt. */
IFS0CLR = _IFS0_T5IF_MASK;

RE: PIC32 Problem

Posted by Bso on August 16, 2013
i use
mT5ClearIntFlag();


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner