Quality RTOS & Embedded Software

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


Loading

freeRTOS dsPIC demo : what files can I remove

Posted by John Baker on August 10, 2009
On the dsPIC demo, what files can I remove? I want to replace the demo files with my own files but can't figure out which ones can be removed. The manual says to "strip out the source files that define the demo tasks" but I don't know which ones I can remove. I started removing files and then got into a mess with lots of errors that some functions couldn't be found. Is there a list of the files that are required?

RE: freeRTOS dsPIC demo : what files can I remove

Posted by John Baker on August 10, 2009
Grumble grumble. It looks like I can safely remove blocktim, crflash, lcd, ParTest, serial and timertest but when I add one (1) of my C files and a header, I start getting errors: ..\..\compile_rules.o: Link Error: Could not allocate section .nbss, size = 2194 bytes, attributes = bss near
Link Error: Could not allocate data memory

So this doesn't look promising. Is there any way to fix this up? Thanks for any help!

RE: freeRTOS dsPIC demo : what files can I re

Posted by Richard on August 10, 2009
See http://www.freertos.org/a00017.html - anything that is in the FreeRTOS/Source directory is part of FreeRTOS and required - anything that is in the FreeRTOS/Demo directory is part of the demo app and is not required.

A quick and simple way is to remove anything that is in the FreeRTOS/Demo directory other than main(), then delete the whole of main() other than vTaskStartScheduler(), finally create your own tasks before vTaskStartScheduler() is called.

If you run out of RAM then reduce configTOTAL_HEAP_SIZE in FreeRTOSConfig.h. I think this is an FAQ.

Regards.

RE: freeRTOS dsPIC demo : what files can I remove

Posted by John Baker on August 10, 2009
Thanks Richard. Unfortunately, when I remove blocktim, crflash, lcd, ParTest, serial and timertest and add one (1) of my C files and a header, I start getting the Link errors: "..\..\compile_rules.o: Link Error: Could not allocate section .nbss, size = 2194 bytes, attributes = bss near Link Error: Could not allocate data memory." I haven't removed any header files and still have croutine.c and .h, heap_1.c, list.c, main.c, port.c, portasm_dsPIC.s, queue.c and .h, tasks.c, FreeRTOSConfig.h, semphr.h and task.h in addition to my .c and .h files. Is that correct?

RE: freeRTOS dsPIC demo : what files can I re

Posted by Richard on August 10, 2009
Did you try the suggestion from my previous post of decreasing the configTOTAL_HEAP_SIZE setting?

Regards.

RE: freeRTOS dsPIC demo : what files can I remove

Posted by John Baker on August 11, 2009
No, I missed that about the configTOTAL_HEAP_SIZE. I didn't see that in the FAQ. I have made a guess at decreasing it and now have another error for my function that I call only one time on start up and right now, it's the only function that I've included in the project:
c:\program files\microchip\mplab c30\bin\bin\pic30-coff-ld.exe Error: A heap is required, but has not been specified.
It looks like I've gotten in over my head on this as I have no idea what to do. I see chapter 5 in the eBook and I see heap_1.c. Is the kernel expecting to find and call pvPortMalloc to do the memory allocation or do I have to call it from my function?

RE: freeRTOS dsPIC demo : what files can I re

Posted by Dave on August 11, 2009
The linker will require a heap if functions you have added use calls to malloc(). FreeRTOS does not call malloc but instead calls pvPortMalloc(). This allows the malloc implementation to be replaced and this is what heap_1, heap_2 and heap_3 do. Does your code call malloc()? If so try replacing it with pvPortMalloc() instead.

RE: freeRTOS dsPIC demo : what files can I remove

Posted by John Baker on August 11, 2009
No, my code doesn't call malloc. My code so far is just a function that will be called from main on startup but I don't have the call in main yet for this function. Maybe that's my problem?

RE: freeRTOS dsPIC demo : what files can I remove

Posted by John Baker on August 13, 2009
Ah, my mistake. I didn't have the heap setup in the Linker and needed it for some printf's. I had forgotten that a heap is required for printf's. I found the answer in http://www.microchip.com/forums/tm.aspx?m=250151&mpage=1&key=&#250151. So now can compile and link. Thanks Richard.


[ 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