# Using ARM7 port for LPC2129 and GCC

**URL:** <https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573>\
**Category:** Kernel\
**Created:** [November 24, 2004, 9:26am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573 "2004-11-24T09:26:46Z")\
**Posts on this page:** 15\
**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:** [November 24, 2004, 9:26am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/1 "2004-11-24T09:26:46Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9):

Hi

Have anyone done an application with GCC and the LPC2129 processor, I can get it to run correctly on my MCB2100 demoboard. I have tried to use the keil-port and convert it for gcc with help of the arm7-gcc port… but it wont run… I dont know what im doing wrong, its like the mcu wont run, or like it wont start to run or someting…&nbsp;  
Some makefiles would be great…

Thanks…  
BR  
/Fredrik Martinsson, Sweden

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 9:47am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/2 "2004-11-24T09:47:25Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/9dde):

Are trying to run from ROM or RAM?&nbsp;

Have you updated the MEMORY section of the linker script to account for the different memory maps of the two devices?&nbsp; See the top of lpc2106-rom.ld.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 10:09am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/3 "2004-11-24T10:09:45Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/9dde/6d40):

I quess not…

I’ll check this right know and come back for result…

Thanks…  
/Fredrik

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 10:14am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/4 "2004-11-24T10:14:35Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/17fb):

It might be easier to do it the other way around.&nbsp; Take the GCC port and convert it to run on the keil platform by using the keil port as a guide.

Assuming the register locations are the same for both ports if you take the GCC port then cut it down to its minimum it should work.

Change the linker script file as per previous post.&nbsp;&nbsp; Change the portTOTAL\_HEAP\_SIZE macro for different RAM size.  
The portMINIMAL\_STACK\_SIZE macro may also need changing.  
Change the partest.c file so you access the IO pins for the LED’s as per the keil platform.

Try starting with the minimum functionality - take out all the functions in main that start tasks other than the flash tasks, also remove these all the demo task files from the makefile other than the flash task file.&nbsp; This way you will get the smallest exe file and the simplest application.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 10:16am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/5 "2004-11-24T10:16:14Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/9dde/1b5a):

One question:

the LENGHT define… is it in bytes or bits?

Is it right to define ram LENGHT to 16K for the LPC2129 ?&nbsp; The ram memory has size 16 Kbyte from address 0x40000000 - 0x40003FFF  
The rom memory is from 0x00000000 - 0x0001FFFF = 128 Kbyte

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 10:25am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/6 "2004-11-24T10:25:19Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/9dde/1b5a/3b22):

The lpc2106 has 64K Bytes of RAM and 128K Byte flash.

The linker script for the 2106 contains;

MEMORY  
{  
&nbsp;&nbsp;&nbsp; flash&nbsp;&nbsp;&nbsp; : ORIGIN = 0, LENGTH = 120K  
&nbsp;&nbsp;&nbsp; ram&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ORIGIN = 0x40000000, LENGTH = 64K  
}

so it looks like length is in bytes.&nbsp; I’m not sure why 120 is shown instead of 128 though.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 10:39am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/7 "2004-11-24T10:39:10Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/17fb/eb0a):

Still something wrong… Its just like the scheduler wont start…

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 10:47am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/8 "2004-11-24T10:47:37Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/17fb/dc4d):

Hey…

I got it to work… but i only have one task, and the only thing it does it so delay for 1000 ticks and then enter a critical section to send "hello task" string on serial port… but this works very good…  
What is the portTOTAL\_HEAP\_SIZE for?  
how small should portMINIMAL\_STACK\_SIZE be?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 24, 2004, 11:05am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/9 "2004-11-24T11:05:45Z")

</div>

**nobody** wrote on [Wednesday, November 24, 2004](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/17fb/dc4d/f74f):

portTOTAL\_HEAP\_SIZE sets the amout of RAM the scheduler can use when allocating TCB’s, stacks, queue’s, etc.&nbsp; See:

[http://www.freertos.org/a00111.html](http://www.freertos.org/a00111.html)

portMINIMAL\_STACK\_SIZE seems to be set differently for the two ARM ports.&nbsp; The GCC port uses 128.&nbsp; The best setting for this parameter is dependent on your own application.

Do you have a debugger?&nbsp; If so then step through the main() function and you will see how the memory is allocated as tasks are created.&nbsp; You will probably find where the old problem was occurring.

The setuphardware function in main does more in the GCC port than the keil.&nbsp; I presume you have copied the setup routines from the GCC port.&nbsp; [the Keil port does the setup automatically in the startup routine].

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 11, 2006, 12:39pm UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/10 "2006-07-11T12:39:54Z")

</div>

**nobody** wrote on [Tuesday, July 11, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/17fb/dc4d/f74f/4597):

i am using lpc2106 port on lpc2138 and it did’nt work. it will not show the blinking of led at all. i have question that do i use lpc2106 port on 2138? becuase both have same pheripharal address. please help me&nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 11, 2006, 12:47pm UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/11 "2006-07-11T12:47:56Z")

</div>

**nobody** wrote on [Tuesday, July 11, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/17fb/dc4d/f74f/4597/dcaf):

You are using the LPC2106 GCC port and want to get this working on an LPC2138.&nbsp; You have not said what you have done to achieve this.&nbsp; People cannot provide help unless you provide more information.

Have you changed the heap size to fit in the LPC2138 RAM.

Have you changed the functions to write to the LED’s to be correct for your hardware.

Have you successfully compiled the code?

Etc.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 12, 2006, 11:25am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/12 "2006-07-12T11:25:10Z")

</div>

**nobody** wrote on [Wednesday, July 12, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/20c6):

Dear Sir,  
I am using LPC2138based hardware target board with on-chip flash of 512kb and RAM of 32kb. I am currently using the LPC2106 GCC port and as mentioned in the demo program of LED blinking, I have arranged for the hardware.  
I have successfully compiled the program using the provided batch file and tried to download the HEX file to the mentioned target. But the results are not available as required.  
I would therefore like to know what changes I have to make (either procedural or code changes) so that I can use the demo program for the 2106 port with my target system.  
I would be glad to receive your suggestions!!

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [July 13, 2006, 5:50am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/13 "2006-07-13T05:50:52Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, July 13, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/20c6/0585):

\>Dear Sir,  
\>I am using LPC2138based hardware target board with on-chip flash of 512kb and  
\>RAM of 32kb.

Have you changed the size of the heap in FreeRTOSConfig.h to take into account the smaller amount of RAM available?

\>I am currently using the LPC2106 GCC port and as mentioned in the  
\>demo program of LED blinking, I have arranged for the hardware.  
\>I have successfully compiled the program using the provided batch file and  
\>tried  
\>to download the HEX file to the mentioned target. But the results are not  
\>available  
\>as required.

Does this mean you cannot download the file?&nbsp; Do you get an error in the download?&nbsp; If so, what?

\>I would therefore like to know what changes I have to make (either procedural  
\>or code changes) so that I can use the demo program for the 2106 port with my  
\>target system.  
\>I would be glad to receive your suggestions!!

First get a program running that flashes the LED’s without using [FreeRTOS.org](http://FreeRTOS.org).&nbsp; You can do this by having a loop in main() to flash some LED’s before any tasks are created and without starting the scheduler.&nbsp; Once you have this working, then try creating just the LED flash tasks and nothing else.&nbsp; Then build up from there.

Have you read the section on the [FreeRTOS.org](http://FreeRTOS.org) WEB site for the LPC2106 port titled "Using a part other than an LPC2106?".&nbsp; This gives more information too.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 13, 2006, 6:53am UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/14 "2006-07-13T06:53:46Z")

</div>

**nobody** wrote on [Thursday, July 13, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/20c6/0585/3ed6):

sir  
&nbsp; lpc2106 has 64k of ram and in the freertosconfig.h heap size is 23k i dont understand that how to change the heap size for lpc2138. is there any calclulation for writing the heap size?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 13, 2006, 6:32pm UTC](https://forums.freertos.org/t/using-arm7-port-for-lpc2129-and-gcc/5573/15 "2006-07-13T18:32:50Z")

</div>

**nobody** wrote on [Thursday, July 13, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/f8920b7d/#65c9/20c6/0585/3ed6/4f54):

That should be fine then.
