Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists