EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

what should I do to port freertos form lpc2129 to lpc2468

Started by mee April 30, 2008
hi all:
After a few attempted porting freertos to lpc2468, I belivev that I do
need somebody a help here.

Here is my story. Download lpc2129 porting(IAR IDE) from freertos
websit. and demo board (lpc2468) from IAR too. Made a few changing:
1. changed processor to lpc2468 option in IAR IDE setting.
2. changed processor header file from lpc2129 to lpc2468
3. notice there are some differenc in PLL area, made some changed there.

what I can run now:
1. can turn LED on and off without OS start creat tasks.
2. afer running into OS code, has data or undefine abort.
3. the abort happen after schedulor start.

I am thinking that I am facing a configuraton problem. Have tried
to modify code in startup.s and freertosconfig.h and others which
freertos suggest to take a look. Well, I am still no lucky to let
it running.

Thanks in advance for all people who spend their value time here.

An Engineer's Guide to the LPC2100 Series

> Here is my story. Download lpc2129 porting(IAR IDE) from freertos
> websit.
So you are starting with a working project. This is good as it means you
will have the correct setup and things should compile straight off.
However, it might be that you need to change the configuration of the timer
that generates the RTOS tick, as it is likely to be a bit different on the
2468 compared to the 2129.

The timer configuration is contained in a function called
prvSetupTimerInterrupt() which can be found in port.c. For GCC there are
two different versions, one can be found in
Source\portable\GCC\ARM7_LPC2000\port.c, and the other in
Source\portable\GCC\ARM7_LPC23xx\port.c. I have not checked the data sheet
but it is likely that you will require the latter version. You can copy the
changes from the referenced GCC version into your IAR files.

> and demo board (lpc2468) from IAR too. Made a few changing:
> 1. changed processor to lpc2468 option in IAR IDE setting.
> 2. changed processor header file from lpc2129 to lpc2468
> 3. notice there are some differenc in PLL area, made some
> changed there.
>
> what I can run now:
> 1. can turn LED on and off without OS start creat tasks.

That is encouraging, so there is a good chance that the linker script and
processor configuration are good.

> 2. afer running into OS code, has data or undefine abort.
> 3. the abort happen after schedulor start.
Do you ever hit the first task? Put a break point at the beginning of the
highest priority task to see if you ever reach it. If not then it is likely
that the MCU is in the wrong mode when you start the scheduler.

Also check that the call to xTaskStartScheduler() never returns, to do so
would be indicative of having too smaller heap to allow the idle task to be
created.

> I am thinking that I am facing a configuraton problem. Have tried
> to modify code in startup.s and freertosconfig.h and others which
> freertos suggest to take a look. Well, I am still no lucky to let
> it running.

What did you change in startup.s? Can you check that the MCU is in
Supervisor mode when main() is called? This is the most likely cause of the
problem.

Startup.s should also allocate stacks for IRQ mode, FIQ only if used, and
Supervisor modes. If using the 2129 project as a base you should also setup
the VIC to vector directly to an ISR handlers as well as making sure that
the vPortYieldProcessor is installed as the SWI handler. If you are using
the demo project startup file then this should all be done already.
Regards,
Richard.

+ http://www.FreeRTOS.org
17 official architecture ports, more than 5000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.


The 2024 Embedded Online Conference