Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Execute Code in RAM?

2005-03-11 by 42Bastian Schick

Arvid

> My problem is, that i don't know how to declare a function, whose
> address can be changed during runtime.
> How is the syntax of a working code?

void wrapper(unsigned long addr)
{
   void (*func)();

   func = (void (*)())addr;
   func();
}

For the function itself, make sure to link it for its execution address

  .flasher 0x40000040 : AT(ADDR(.rodata)+SIZEOF(.rodata)
  {
	flasher.o(.text)
  }

This will place the code of flasher in Flash, but linked for 0x40000040.


-- 
42Bastian Schick

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.