Hello,
I also explained my problem to the altera support and they came up with the following solution:
# include <stdio.h># include "altera_avalon_pio_regs.h"# include "system.h"# include "sys/alt_load.h"
extern void hello (void) __attribute__ ((section (".onchip_ram_64_kbytes")));
void hello()
{
printf("hello from Nios II!\n");
}
int main()
{
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, 0x11);
printf("hi\n");
ALT_LOAD_SECTION_BY_NAME(onchip_ram_64_kbytes);
hello();
return 0;
}
I've tried it and it works fine. By doing this I don't need to study the linker script.
thanks for your help,
Dolphin