# FreeRTOS 18F452 Port

**URL:** <https://forums.freertos.org/t/freertos-18f452-port/3870>\
**Category:** Kernel\
**Created:** [March 4, 2008, 6:13pm UTC](https://forums.freertos.org/t/freertos-18f452-port/3870 "2008-03-04T18:13:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 4, 2008, 6:13pm UTC](https://forums.freertos.org/t/freertos-18f452-port/3870/1 "2008-03-04T18:13:26Z")

</div>

**[debrajdeb](https://sourceforge.net/u/debrajdeb/)** wrote on [Tuesday, March 04, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/ab852c15/#e121):

Hi,

I was trying out the port for 18F452 (MPLAB).

The code building works fine and the entire code fits in the Flash memory. I get the following info in "map" file: -  
-------------------------------------------------------------------------------------------  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Program Memory Usage  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------&nbsp;&nbsp; ---------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x000000&nbsp;&nbsp;&nbsp; 0x000005&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x000008&nbsp;&nbsp;&nbsp; 0x000025&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x00003a&nbsp;&nbsp;&nbsp; 0x0043be&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 17321 out of 33048 program addresses used, program memory utilization is 52%  
-------------------------------------------------------------------------------------------

But my final application is on 18F4520 (successor to 18F452). Hence I changed the device and linker script to 18F4520. But then, I get the following linker error: -  
-------------------------------------------------------------------------------------------  
MPLINK 4.15, Linker  
Copyright (c) 2007 Microchip Technology Inc.  
Error - section ‘.udata\_heap\_1.o’ can not fit the section. Section ‘.udata\_heap\_1.o’ length=0x00000404  
Errors&nbsp;&nbsp;&nbsp; : 1  
-------------------------------------------------------------------------------------------

I think, the error means that the code for "heap\_1.c" is too big to be fitted in the memory. Why is this error? I know that the memory of 18F4520 \>= memory of 18F452.

I also noticed that even if I revert the device and linker script back to 18F452 (same as original), the same linker error appears. Why is that?

Best regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 4, 2008, 6:29pm UTC](https://forums.freertos.org/t/freertos-18f452-port/3870/2 "2008-03-04T18:29:55Z")

</div>

**[picmeup](https://sourceforge.net/u/picmeup/)** wrote on [Tuesday, March 04, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/ab852c15/#e121/20fa):

The freertos heap in heap\_1.c is defined as one big array so is to big to fit in a small memory block as defined in the MPLAB linker scripts. Look at the 18f452.lkr file in the pic18\_mplab folder to see a mod to create one large bit of RAM called BIG\_BLOCK. This is the 18f452.lkr file in the pic18\_mplab folder of freertos not the file in the mplab folder.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 4, 2008, 7:03pm UTC](https://forums.freertos.org/t/freertos-18f452-port/3870/3 "2008-03-04T19:03:20Z")

</div>

**[debrajdeb](https://sourceforge.net/u/debrajdeb/)** wrote on [Tuesday, March 04, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/ab852c15/#e121/9fff):

Thanks. This information helps me immensely.

Best regards.
