Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

NIOS2 EDS make error

Status
Not open for further replies.

yupina-chan

Member level 2
Joined
Nov 27, 2013
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
397
I studied using the SOPC builder and NIOS2. I made the projects in both tutorials provided by altera. Along the way, I encountered errors but I searched about them and found solutions. I made the tutorials worked on my board so I decided to try on the tutorial on sd card interface using SOPC builder. At the end part, for the software, I used the HAL device driver but when I compiled it, there were errors.



the last lines in my console are as follows:
C:\Users\Jackie\Desktop\sdcard\nios\software\sdcard_bsp/HAL/src/alt_main.c:154: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [sdcard.elf] Error 1

Do you have any idea on how to solve this? I already tried running my nios 2 eds as an administrator (from another forum’s answer) but it didn’t help me.
THANKS IN ADVANCE!
 

I studied using the SOPC builder and NIOS2. I made the projects in both tutorials provided by altera. Along the way, I encountered errors but I searched about them and found solutions. I made the tutorials worked on my board so I decided to try on the tutorial on sd card interface using SOPC builder. At the end part, for the software, I used the HAL device driver but when I compiled it, there were errors.



the last lines in my console are as follows:


Do you have any idea on how to solve this? I already tried running my nios 2 eds as an administrator (from another forum’s answer) but it didn’t help me.
THANKS IN ADVANCE!

i guess it is linkage problem. bassically you need first to build (clean build) your bsp library (i see there is an x mark there) only then your project.
 

i did the clean build in my bsp library and it turned an error:

make: *** [sdcard.elf] Error 1
 

i did the clean build in my bsp library and it turned an error:

make: *** [sdcard.elf] Error 1

1. check if the main program signiture main(argc,argv ) ... is the same.

2. post your code.
 

hi. thanks for the reply.
i used the altera monitor program for the software program instead of nios2 for eclipse.when compiled, i got the errors:

c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x106a8 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.rwdata' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.bss' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.onchip_memory2_0' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x106a8 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.rwdata' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.bss' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.onchip_memory2_0' is not within region `onchip_memory2_0'


my onchip-memory is 32kb. could you identify the problem here? does this have something to do with the address? im not really familiar with this since im a beginner but i really need to finish this. thanks again.
 

hi. thanks for the reply.
i used the altera monitor program for the software program instead of nios2 for eclipse.when compiled, i got the errors:

c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x106a8 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.rwdata' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.bss' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.onchip_memory2_0' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x106a8 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.rwdata' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.bss' is not within region `onchip_memory2_0'
c:/altera/11.1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: address 0x12808 of C:/Users/Jackie/Desktop/sdcard/altera_up_sd_card_avalon_interface.elf section `.onchip_memory2_0' is not within region `onchip_memory2_0'


my onchip-memory is 32kb. could you identify the problem here? does this have something to do with the address? im not really familiar with this since im a beginner but i really need to finish this. thanks again.


your program is to large to fit the OCm, you better run it from DDR memory, or optimise your code.
 

thank you for replying. i found a way to make it work though. i remade it in nios2 and this time, i used the hello world small template. it worked! i was able to write a txt file in my sd card now! thanks again for the reply. i don't know what are the differences between these templates though, i just got this suggestion from other threads.

my next problem would be reading a bitmap image from sd card and store it to sdram. it seems this is c programming and a problem for me coz i only know basic c. can you give me references on this?
 
Last edited:
thank you for replying. i found a way to make it work though. i remade it in nios2 and this time, i used the hello world small template. it worked! i was able to write a txt file in my sd card now! thanks again for the reply. i don't know what are the differences between these templates though, i just got this suggestion from other threads.

my next problem would be reading a bitmap image from sd card and store it to sdram. it seems this is c programming and a problem for me coz i only know basic c. can you give me references on this?

that's very good. you probebly now used a project that uses minimal drivers or set "enable_reduced_device_drivers"
in the bsp, and use alt_log_printf instead printf().

you should have examples in your documentation, depends on which driver of sd you are using.

also you might want to look for the following book/ebook :
EMBEDDED SOPC DESIGN WITH NIOS II PROCESSOR AND VHDL EXAMPLES
it got lot of information and examples, about what you want to do.
 

thank you for replying. i found a way to make it work though. i remade it in nios2 and this time, i used the hello world small template. it worked! i was able to write a txt file in my sd card now! thanks again for the reply. i don't know what are the differences between these templates though, i just got this suggestion from other threads.
You don't have .c file with main function in your sdcard project. Simply add sdcard.c file with
Code:
#include <stdio.h>

int main()
{
  printf("Hello from Nios II!\n");
  return 0;
}

and check that this file is enabled for building with your project (after right clicking on this file you should see 'Remove from Nios2 build' string in the second position from bottom menu, else click to 'Add to Niod2 build'.

May be this can help you in your work.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top