FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2014 Threads] pvPortMalloc failure on first create - Cortex r4 - TMS570LS1227Posted by ronemcd on February 11, 2014 I am using the CORTEX-R4TICCS5 port with v8.0.0 FreeRTOS. This is Demo for cortex R4 processors and the TMS570 series. The port uses heap_4.c and appears to never initialize the heap. When the first call to pvPortMalloc is called, the pvReturn var is never accessed. Obviously I am missing something. Any help would be appreciated.
Thanks,
Ron M.
pvPortMalloc failure on first create - Cortex r4 - TMS570LS1227Posted by davedoors on February 11, 2014 The heap is initialized if pxEnd is found to be NULL, which it should be the first time pvPortMalloc is called because it is initialized to NULL where it is declared. If you find it is not NULL then I guess you have a start up code or linker script problem which is either not setting it to NULL before main() is called or clobbering the value after main() is called.
pvPortMalloc failure on first create - Cortex r4 - TMS570LS1227Posted by ronemcd on February 11, 2014 Thanks Dave, That does appear to be the case, the pxEnd is never being set to Null. Looking at the value, I don't think it is being clobbered but don't know for sure. Do you have any idea how to make sure all the necessary initialization is taking place before the first call from main?
Thanks,
Ron
pvPortMalloc failure on first create - Cortex r4 - TMS570LS1227Posted by rtel on February 11, 2014 NULL is zero, so the variable should get allocated by the linker into the bss section, then cleared to zero by the compiler or chip vendor supplied C start up code before main() is called. This is a normal part of setting up the C run time environment.
The C start up code is normally called something like boot.s or crt0.s - but can have any name and may even have a different file extension (such as .asm). If you set your debug interface to break on entry rather than breaking on the first instruction of main() then you will be able to step through the C start up code and see why it is not working as would be expected.
Regards.
pvPortMalloc failure on first create - Cortex r4 - TMS570LS1227Posted by ronemcd on February 11, 2014 First, thanks for the help. I'm not sure exactly how to set the debugger in CCS to break on entry but I will figure it out. There was a similar problem with an MSP430 application some time back and there was a function you could invoke that assured the initialization completed before the WD timer hit. Perhaps there is something like that going on here. Thanks again - I'll keep after it.
Ron
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|