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

FreeRTOS+Trace with PIC32MX

Posted by chaabanemalki on May 9, 2014

Hello, I'm currently testing FreeRTOS+Trace with a PIC32MX, the tool doesn't support officially PIC32MX port yet. So i was hoping if someone here might have a clue of the error i'm having here. Basically I'm trying to open the ram dump into freeRTOS+Trace but i'm having this error :

"failed to load trace incomplete trace data (ended early) increase range of the ram dump"

I made sure to save the entire RAM into the mch file and i sill have this error

Any ideas how to fix this ?

Thank you


FreeRTOS+Trace with PIC32MX

Posted by rtel on May 10, 2014

Which version of FreeRTOS are you using? Version 8.x requires the latest FreeRTOS+Trace tool, whereas prior versions require a slightly older version. Is it possible you have a version mismatch?

Regards.


FreeRTOS+Trace with PIC32MX

Posted by chaabanemalki on May 10, 2014

I'm using FreeRTOS 8.0.0 and FreeRTOS+Trace 2.6


FreeRTOS+Trace with PIC32MX

Posted by davedoors on May 11, 2014

http://www.freertos.org/upgrading-to-FreeRTOS-V8.html#trace shows that is the right version. Are you sure you have a dump of the entire trace buffer. Try setting the trace buffer to a small size just to test. Can you open a trace when the buffer is really small, say 1.5K?


FreeRTOS+Trace with PIC32MX

Posted by chaabanemalki on May 13, 2014

I had a load/ifetch exception, so I tried to be smart and halt the debug before this error happens and check what FReeRTOS+TRace give me but i guess this didn't work that well.

In my code I have 2 tasks with only vTaskDelayUntil(). So far the exception seems to happen in random places and i'm finding it very hard to track it.

How can I track this kind of errors inside freeRTOS ?


FreeRTOS+Trace with PIC32MX

Posted by rtel on May 13, 2014

Where do you end up when the exception occurs? If it is in a fault handler then you can get some information from the CAUSE register and try and work backwards from that to find the (actual) cause, but...

...if you only have two tasks, and the only function you are calling is vTaskDelayUntil(), and the only interrupt is the RTOS's own tick interrupt, then there cannot be many things that could cause the problem.

Which heapx.c implementation are you using, and what do you have configTOTALHEAP_SIZE set to? (http://www.freertos.org/a00111.html)

Did you base your application on one the official demo for that part, or did you create it from scratch yourself? If you used the official demo as a start, but the part number you are using is not the same as used in the official demo, did you ensure the project was targeted to the new chip (things like the linker script is correctly describing the memory on the device, etc.).

What do you have configMINIMALSTACKSIZE and configIRQSTACKSIZE set to in FreeRTOSConfig.h?

Regards.


FreeRTOS+Trace with PIC32MX

Posted by chaabanemalki on May 13, 2014

->Where do you end up when the exception occurs? I use generalexception_handler provided along with the demo project and i didn't change the device part (PIC32MX795F512L).

The cause is "load or ifetch" or"load/store" exception and the adress is in the flash memory. when i look it up in the program memory window, it seemed to be filled with RRRR (empty !!) : i'm still looking for the meaning of this.

I'm using heap4.c and configMINIMALSTACKSIZE ( 190 ) configISRSTACKSIZE ( 250 ) configTOTALHEAPSIZE ( ( sizet ) 28000 )

Does FreeRTOS take the defined configTOTALHEAPSIZE amount from the predefined heap (in project properties) ?

And I didn't add any linker script yet.

I believe most likely the problem is in traceTASKDELAYUNTIL() function since when i disable trace option via configUSETRACEFACILITY, the program run with no problems. I coudln't go far yet.

I tried to used the official demo projet but i got the same error.


FreeRTOS+Trace with PIC32MX

Posted by rtel on May 13, 2014

Could it just be that the flash memory is not being programmed then? Can you do a 'validate' as part of the flash programming, or just read the program back to check it is as you expect?

Does FreeRTOS take the defined configTOTALHEAPSIZE amount from the predefined heap (in project properties) ?

No, the only time the predefined heap is used is if you include heap3.c in your project - in which case configTOTALHEAPSIZE has no effect. If you use heap1, heap2 or heap4 (recommended) then configTOTALHEAPSiZE dimensions an array that is used as the heap, and the predefined heap is not used at all.

traceTASKDELAYUNTIL()

Ah, ok, in which case I would guess you are trying to use the trace functions without first calling the trace library's init function. Have a look at how the demos in the FreeRTOS download use the vTraceInitTraceData(); function: https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS-Plus/Demo/FreeRTOSPlusCLIwithTraceWindowsSimulator/main.c#l174

Regards.

Regards.


FreeRTOS+Trace with PIC32MX

Posted by chaabanemalki on May 14, 2014

Could it just be that the flash memory is not being programmed then? I read the pic memory but had the same results.

I tried FreeRTOSPlusCLIwithTraceWindowsSimulator and it works just fine, as expected ofcourse.

I would guess you are trying to use the trace functions without first calling the trace library's init function

I called the vTraceInitTraceData() function before any call to FreeRTOS API functions, and I check the returned value of uiTraceStart() when I call it, to make sure that the recording started with no error which is the case.

I removed traceTASKDELAYUNTIL() yet I had the same exception. When debug step by step I coudln't find any exception, but when stepping over functions (inside vTaskDelayUntil() )I find myself into the exception handler. Maybe an interrupt handler has been called while stepping over the function ? an caused the exception !!!, the only interrupt is the timer1 which is used and handled by the kernel.

Not sure how to find debug this further

Any ideas ?


[ 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