Forums

CTL (tasks) + bootloader

Started by Jakub Szumacher May 6, 2009
Hello,

I'm using LPC2366 on CrossStudio with CTL library.
When program (with threads, using ctl) is placed at the begining of memory everything works fine. However, I must use bootloader so I've moved program by modify MemoryMap file. I've placed empty program at the beginig (something like while(1); - only for test, planing place bootloader there) and placed my program over 0x4000 adress. Now my program does not work properly - goes into 0x30C when executing ctl_task_run(...) instruction.

Additional:
I've noticed if I place the similar program to my program using ctl (changing only blinking led) at the begining and my program over 0x4000 it works (!).

What is important to remember placing two or more programs in one chip using CrossStudio MemoryMap?
Are additional changes in program code needed?
Thanks
JS

----- Original Message -----
From: rtstofer
To: l...
Sent: Tuesday, April 07, 2009 5:06 PM
Subject: [lpc2000] Re: Secondary Bootloader
--- In l..., asvini_rb@... wrote:
>
> Hello,
>
> I had question releated to program startup.
> I am using LPC2106, when I press reset, Primary bootloader get called. Then my secondary bootloader comes in picture. It will download the hex file from UART and burn the flash. Now I need to call new application.
> Whether I jump to main function of new downloaded code or to cstartup function.
>
> Thanks
>

C startup involves clearing all uninitialized RAM (.bss) and setting all initialized RAM (.data). To do this, crt.s (or whatever it is called, it's the startup code) gets symbols from the linker and uses them to figure out where these memory blocks are located.

So, the startup code knows very well where the .bss and .data segments are for your secondary bootloader but it knows nothing about the memory requirements for the downloaded program.

It looks to me like your downloaded program also needs to have some kind of startup code and this would be the entry point, not main().

You also need to deal with the interrupt vectors. Perhaps remap them into RAM from the startup code of the downloaded program.

I don't see the purpose of the secondary loader if all it does is what the built-in loader already does.

Richard



An Engineer's Guide to the LPC2100 Series

Hi,

> What is important to remember placing two or more programs in one chip
> using CrossStudio MemoryMap?

Why ask for help at our helpdesk while "evaluating" in Aug 08 and then end
up here in 09? :-(

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

Ha! Big Brother strikes again . ;-)

Nice catch, Paul.

From: l... [mailto:l...] On Behalf Of
Paul Curtis
Sent: Wednesday, May 06, 2009 9:08 AM
To: l...
Subject: RE: [lpc2000] CTL (tasks) + bootloader

Hi,

> What is important to remember placing two or more programs in one chip
> using CrossStudio MemoryMap?

Why ask for help at our helpdesk while "evaluating" in Aug 08 and then end
up here in 09? :-(

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors



> Ha! Big Brother strikes again . ;-)

I'll have you know I'm watching my weight. However, there could be an
innocent explanation--you never know. There may be something valid at the
end of the chain of domain names...

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

--- In l..., "Paul Curtis" wrote:
>
> Hi,
>
> > What is important to remember placing two or more programs in one chip
> > using CrossStudio MemoryMap?
>
> Why ask for help at our helpdesk while "evaluating" in Aug 08 and then end
> up here in 09? :-(
>

Don't give up just yet. I recently bought some software that I
started evaluating in 1995. Some of us take a while to make up our
minds ;-)

Always best to give the benefit of the doubt - I recently provided
support for a potential (hopefully) customer that has been using a
free copy of an earlier version of my recording software that he got
from a computer magazine cover CD several years ago. You never know
how many friends he may have ...

--
Chris Burrows
Armaide: LPC2000 Oberon-07 Development System
http://www.cfbsoftware.com/armaide