Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

HELP assigning function to specific address

Hi there.

I have coded my own bootloader and i need to assign the loaded applications main function and a variable to a specific address that my bootloader calls.

Is there a way to force the linker/compiler to place a variable or function at a specific memory address by using the __attribute__ command in my c code.

I know that :

__attribute__ ((section (".my_mem_name.rwdata")));

assigns the varable or function to a specific memory section, but not a memory specific address.

And I have jet another question

My bootloader app is placed in internal memory so it executes every time I reset the nois, then it loads a user app into sdram. This works fine but when I jump to "entry" (as defined in the objdump file) nothing happens. If I jump to "main" it seems to work and starts the user program, but if I do this, the user program still uses the exceptions table, heap and stack asignments from the bootloader app.

How do I init the assignments from user program?

Hopes this makes sense to someone.

12 Replies