I'm trying to use ADS1.2. The FIQ code is very short, so i would like
to gain the time, needed for MAM to load his buffers.
I was trying to do it like this:(it works for IRQ(T0) but not for FIQ
(SPI))
unsigned long t0_irq_ram[400/4];
unsigned long spi_irq_ram[600/4];
__irq void spi_irq()
{
//bla bla bla
}
__irq void t0_irq()
{
//bla bla bla
}
int i;
for(i=0;i<100;i++){
t0_irq_ram[i]=((unsigned int *)t0_irq)[i];
}
for(i=0;i<(600>>2);i++){
spi_irq_ram[i]=((unsigned int *)spi_irq)[i];
}
Vectors LDR PC, Reset_Addr
LDR PC, Undef_Addr
LDR PC, SWI_Addr
LDR PC, PAbt_Addr
LDR PC, DAbt_Addr
NOP ; Reserved Vector
LDR pc,[pc,#-0xFF0] ;irq
LDR PC,=spi_irq_ram ;fiq
/Pero
---
Tuesday, March 16, 2004, 7:48:03 AM, si napisal:
> --- In lpc2000@yahoogroups.com, Peter Kuhar <peter.kuhar@g...> wrote:
>> Hello,
>>
>> I would like to copy FIQ code from flash to ram a startup and then
> run
>> FIQ code from RAM(better response). How can i do that in C.
>>
>> /Pero
> On an LPC210x with MAM enabled, it isn't that obvious that you will
> get a huge performance kick from running an FIQ from RAM. This might
> be a case where assembler is the way to go to tweak the code )if it is
> small.
> Anyway, back to your question....The way you do this is very compiler
> dependent. You will need to link/locate the code to use RAM adresses.
> Typically, the copy-to-ram is done by the assembler start-up code that
> executes before main. The concept involved is very similar to the
> initilaisation of your data segment (ie. the segment's imnitialisation
> data gets coipied from flash into RAM). Depending on your compiler,
> this might be as easy as setting a pragma or such or might need some
> manual effort.
> -- Charles
> Yahoo! Groups LinksMessage
Re: [lpc2000] Re: running FIQ code from ram?
2004-03-16 by Peter Kuhar
Attachments
- No local attachments were found for this message.