I'm new to working with both freeRTOS and Harmony and have run into a problem that is causing me some issues;
Im using MPLAB 3.20, and Harmony 1.06
I'm trying to get the TCP/IP stack + freeRTOS working together in the same stack. It just doe'snt want to play for me..
I created a new project, based around a PIC32MX795P512-L ( using an ethernet Starter Kit 2 ), and set up the TCP/IP etc, used the appropriate BSP files, added a file system. and it all works without any issues..
Then go back and add FreeRTOS into the mix using the Harmony Configurator;
Memory management Type is Heap5
The Tick Rate is 1000Hz
Total Heap Size is 10240
There were no changes in any code when it was generated. The code compiles ands installs on the Starter Kit 2, but does not seem to operate correctly. When i debug the code, i end up in the
vApplicationMallocFailedHook() loop, when the tasks are created ( before starting the scheduler ).
This is my SYS_Task.. It doesnt get past the first part.
void SYS_Tasks ( void )
/* Create OS Thread for Sys Tasks. */
1024, NULL, 1, NULL);
/* Create OS Thread for APP Tasks. */
1024, NULL, 1, NULL);
* Start RTOS *
vTaskStartScheduler(); / This function never returns. */
any pointers woud be greater appreicated.
Stepping through the debug, vApplicationMallocFailedHook() is being called by *pvPortMalloc.
Im at a loss to know why pvReturn == NULL
Have a look at http://www.freertos.org/a00111.html - it sounds like you
need to increase the size of configTOTALHEAPSIZE, but it is also
likely you could decrease the size of the stacks allocated to the tasks too.
Once the tasks are running you can use uxTaskGetStackHighWaterMark()
to see how much stack the tasks are actually using, and then reduce the
amount of stack (which can be done in the configuration) accordingly so
memory is used efficiently.
I increased TOTALHEAPSIZE to 100240 ( from 10024 ) and reduced the size of the stacks, but got the same result.
changed things to heap4 and its working! Seems that heap5 needs some extra configuraion.
The link sent previously provides information on the initialisation
required for heap_5.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.