My dev system: PIC32MZ2048EFM064 processor on Microchip IoT eval board MpLab X v3.60 XC C compiler v1.43 MPLab Harmony v2.03b FreeRTOS9.0.0
I have a small project which requires Ethernet and UART interfaces with TCP/IP stack.
I've created a project using Harmony and configured it as I think looks reasonable. I've increased the total heap available to the RTOS to 200Kb and allocated 4kb to the interrupt stack. The system task stack has 8k words allocated, the main app task stack 4K words, the TCP/IP task stack 2K words.
I've generated code using MHC and added no user code to the project to keep things simple. I have 1 main app task and a second (currently empty) app task, driver libraries for USART, Ethernet and system timers in the system task, and a seperate task for TCP/IP stack. The system task is set as the highest priority (6), TCP/IP is 3 and the main app task is 2.
Every time I run the code it crashes according to the call stack at the start of SYSTasks() with a run time exception when run under the debugger.
To attempt to catch the cause I've added the configASSERT macro to FreeRTOSConfig.h and enabled the MallocFailed and CheckForStackOverfow hooks, but none of these traps the crash in the debugger.
I assume the problem must be caused by some sort of stack/ memory usage problem, but the exact cause is not obvious and I can't trace the call sequence to the crash other than by single stepping to find that the initialisation completes, and as soon as multitasking starts the exception occurs.
Is there something obvious that I've configured incorrectly?
Are there any other tricks I can use to catch the cause of the problem?
My FreeRTOSConfig.h config below: ~~~
/* Hook function related definitions. */
/* Run time and task stats gathering related definitions. */
/* Co-routine related definitions. */
/* Software timer related definitions. */
/* Misc */
/* Interrupt nesting behaviour configuration. */
/* The priority at which the tick interrupt runs. This should probably be kept at 1. */
/* The maximum interrupt priority from which FreeRTOS.org API functions can be called.
Only API functions that end in ...FromISR() can be used within interrupts. */
/* Define configASSERT() to disable interrupts and sit in a loop. */
I'm afraid I'm not familiar enough with the code generated by Harmony. If you have done nothing other than use Harmony to create a project that has not been edited, and that project is failing, then you might be best posting to the Microchip support forum as others may have seen the issue before. If on the other hand you have added your own interrupt service routines, or application code, then perhaps posting some of that code would help identify the issue.