Quality RTOS & Embedded Software

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


Loading

TCP/IP STACK + freeRTOS Harmony / PIC32MX32 combination, wont' glue together for me.

Posted by andrewfrazer on February 22, 2016

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;

Selected FreeRTOS_V8.x.x 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. */ xTaskCreate((TaskFunctiont) _SYSTasks, "Sys Tasks", 1024, NULL, 1, NULL);

/* Create OS Thread for APP Tasks. */ xTaskCreate((TaskFunctiont) _APPTasks, "APP Tasks", 1024, NULL, 1, NULL);

/************** * Start RTOS * *************/ vTaskStartScheduler(); / This function never returns. */ ~~~~ }

~~~~ ~~~~

any pointers woud be greater appreicated.


TCP/IP STACK + freeRTOS Harmony / PIC32MX32 combination, wont' glue together for me.

Posted by andrewfrazer on February 22, 2016

Stepping through the debug, vApplicationMallocFailedHook() is being called by *pvPortMalloc.

Im at a loss to know why pvReturn == NULL


TCP/IP STACK + freeRTOS Harmony / PIC32MX32 combination, wont' glue together for me.

Posted by rtel on February 22, 2016

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.

Regards.


TCP/IP STACK + freeRTOS Harmony / PIC32MX32 combination, wont' glue together for me.

Posted by andrewfrazer on February 22, 2016

I increased TOTALHEAPSIZE to 100240 ( from 10024 ) and reduced the size of the stacks, but got the same result.


TCP/IP STACK + freeRTOS Harmony / PIC32MX32 combination, wont' glue together for me.

Posted by andrewfrazer on February 22, 2016

changed things to heap4 and its working! Seems that heap5 needs some extra configuraion.


TCP/IP STACK + freeRTOS Harmony / PIC32MX32 combination, wont' glue together for me.

Posted by rtel on February 22, 2016

The link sent previously provides information on the initialisation required for heap_5.


[ 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