[freertos - Open Discussion and Support] FreeRTOS for PIC18F4550

91 views
Skip to first unread message

SourceForge.net

unread,
Jun 1, 2010, 5:37:48 PM6/1/10
to nor...@sourceforge.net

Read and respond to this message at:
https://sourceforge.net/projects/freertos/forums/forum/382005/topic/3728207
By: kelrayes

Hi All

I'm trying to modify FreeRTOS for Microchip PIC18F family to work with PIC18F4550
microcontroller, I got error message concerning udata_heap_1.o file, seems to
me the error in the linker script that the heap is too large and can't fit within
the memory allocated to in the PIC18F4550, please if anyone faced similar problem
and was able to solve it let me know.
Thanks

_____________________________________________________________________________________
You are receiving this email because you elected to monitor this topic or entire forum.
To stop monitoring this topic visit:
https://sourceforge.net/projects/freertos/forums/forum/382005/topic/3728207/unmonitor
To stop monitoring this forum visit:
https://sourceforge.net/projects/freertos/forums/forum/382005/unmonitor

SourceForge.net

unread,
Sep 25, 2010, 12:06:16 PM9/25/10
to nor...@sourceforge.net
By: kpettit1

Hi kelrayes,

Did you ever resolve this porting issue? I have FreeRTOS running on a PIC18F4682
(which has more RAM), but I have also used the 18F4550 before.

Ken

SourceForge.net

unread,
Sep 25, 2010, 12:11:22 PM9/25/10
to nor...@sourceforge.net
By: kelrayes

Hi Ken

Actually no, I moved to another RTOS called PICos18, there is a port of it for
the PIC18F4550.
However I will be interested to know how did you solve the FreeRTOS issue with
the PIC18F4550.

Thanks

SourceForge.net

unread,
Sep 27, 2010, 11:54:19 AM9/27/10
to nor...@sourceforge.net
By: kpettit1

The heap_1.c, heap_2.c, etc. files have a statically defined variable called
xHeap with a big portCHAR array in them. This is where the "heap" is located.
The size of the portCHAR array is determined by the configTOTAL_HEAP_SIZE (plus
4 or 8 based on portBYTE_ALIGNMENT). The static variable xHeap will be located
somewhere in RAM by the linker, and must be small enough to fit in the available
ram on the PIC.

The PIC18F4550 has 2048 bytes of RAM. Assuming you want to reserve bank zero
for fast-access variables, Bank 1 for your stack and Bank 2 for global variables,
this would leave 1280 bytes for "heap" (probably less because the PicKIT2 probably
wants 10 bytes for debugging). So your configTOTAL_HEAP_SIZE should be something
like 1260 or less (or much less if you have a lot of global variables).

I typically copy the default linker script (18f4550_e.lkr, etc.) into my project
directory and make custom modifications to control the link process. I create
a DATABANK NAME=freertos_heap and give it a specific RAM range in the linker
script. Then in the heap_2.c file, just before the static declaration of xHeap,
I add a line like: #pragma udata freertos_heap = 0x300 (or whatever).

Ken

ep.hob...@gmail.com

unread,
Aug 16, 2015, 12:06:06 AM8/16/15
to osdeve.mirror.rtos.FreeRTOS-Discussion, nor...@sourceforge.net
Hi can i get the working code.

i m new to rtos and i don't know where to change and where not.
Reply all
Reply to author
Forward
0 new messages