FreeRTOS+Trace with PIC32MX

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

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

I’m using FreeRTOS 8.0.0 and FreeRTOS+Trace 2.6

FreeRTOS+Trace with PIC32MX

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

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

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

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

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

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 ?