Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Problem while compiling NIOSII application to be loaded into DRAM from FLASH

Altera_Forum
Honored Contributor II
1,414 Views

Hi, 

 

I am writing a custom boot loader + an application. The bootloader will run from onchip-ram and will copy application,which needs to be stored in CFI flash, to DRAM. 

 

Reset & exception vectors in SOPC points to onchip-ram. 

 

I am able to compile the bootloader with no error. But the problem is that I am not able to compile application code. 

 

While compiling code, linker gives following error: 

alt_irq_handler.c:96: relocation truncated to fit: r_nios2_call26 osintenter 

 

I have to use customized bootloader because it also performs some additional tasks apart from loading application from FLASH to DRAM. 

 

Any idea ?? 

 

FYI: 

I am using Altera Embedded Dev. Kit (3c120). 

 

Thanks in advance 

 

Sanjay
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
484 Views

The error is a call instruction that needs to change the highest 4 bits of the address - probably a call from on-chip memory to SDRAM. 

You can make the code work by using an indirect call. 

But you probably want to have the irq entry point into the 'bootloader' and have the application register it's own function. 

That means you probably don't want the code from alt_irq_handler.c in your application.
0 Kudos
Altera_Forum
Honored Contributor II
484 Views

from this post: 

 

http://www.alteraforum.com/forum/showthread.php?t=18932 

 

I got the similar problem when using Quartus II 9.1 and 

I fixed it by changing the setting of Nios II processor in SOPC Builder. 

 

As shown in attached picture, the memory segment for "Reset Vector" should be the same as that in the property of system library "Program memory (.text)". 

 

Also, I found that memory segment for "Exception Vector" would be put together within segment for .text from the linker script that is automatically generated by Nios II tools. Therefore, I think this memory should be set as the same as "Reset Vector". 

 

You can see this linker script from path: 

\software\XXX_syslib\Debug\system_description\gene rated.x
0 Kudos
Reply