Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,356 Views

DE2-115 Media Example

Hi all ,

I have been trying to run DE2-115 Media Computer example with no success. I tried to compile its Nios app in eclipse but i always get "Make elf error 1" . I have tried modifying i.e connecting a On-chip Ram in its SOC design with multiple sizes from 8k , 16k and 20K , but after successful HW compilation i still get " elf error1 " . 

 

I have even tried modifying SOC design with no GPIO , no UART and no USB , no success again ????

 

Any ideas why software compilation is not working ?

 

Regards , Ahmed

0 Kudos
20 Replies
Highlighted
14 Views

Hi Ahmed,

 

Can you attach the eclipse console log file?

May be memory size or syntax error causing the problem.

 

  1. Try to create a new eclipse project with small hello world template. or
  2. Increase on chip memory to size more than 32kb.

 

Best Regards,

ARS

0 Kudos
Highlighted
Novice
14 Views

Hi Anand ,

 

Please see attached nios project plus image of error output .

Regards , Ahmed

0 Kudos
Highlighted
Novice
14 Views

also see attached DE2-115 media computer quartus SOC project .

also i am using Quartus Prime 16.0 lite edition and Nios ide 16.0 .

0 Kudos
Highlighted
Employee
14 Views

Can you check the console log? It is in the Eclips as shown in the attachment here. Mainly it will be the memory size isn't enough. you have two ways to solve this issue:

Simply you can increase the memory size in Qsys and regenerate the HDL file then recompile the system again.

2- Right click the project>>properties>> NIOS II application properties>> Change the Debug level and optimization level. Then Right click your BSP project>>NIOS II>>BSP editor>>settings>> Enable small C library.

If the second option doesn't work then you must increase your memory (1st option).

 

0 Kudos
Highlighted
Employee
14 Views

As expected, The memory size is only 30 KB which is not enough for a system like this, please use a sufficient memory size.

 

0 Kudos
Highlighted
Novice
14 Views

Hi Embedded_guy ,

 

as suggested i increased the on-chip ram to 80k , no success .

 

see attached console output

 

0 Kudos
Highlighted
Novice
14 Views

incremented to 180k and the design does not fit in the fpga ???

tried it with 100k , but nios compilation failed again .

what is the magic number ?

0 Kudos
Highlighted
Highlighted
Novice
14 Views

nope even 32bit-by-128K didnt work , it fitted well in FPGA with 75% ram bits utilization , but nios project compilation failed

0 Kudos
Highlighted
Employee
14 Views

Hi,

Did you managed to check the console log? Can you share a screen shoot of the console log message?

in this log you can see the real cause of this message

0 Kudos
Highlighted
Novice
14 Views

tried it again with 32bit-by-140K, no success, see screen shot attached

0 Kudos
Highlighted
Novice
14 Views

is it ok to refresh the project and re-generate bsp again in nios ide , after a new Quartus project compilation or do i have to create new nios project altogether ???

0 Kudos
Highlighted
Employee
14 Views

I prefer to re-create a new project based on the new sopcinfo and copy the same code to it.

make sure that you download the new .sof file to the board

once you build the project please check the console if there is any error.

0 Kudos
Highlighted
Novice
14 Views

created a brand new nios-ii project as hello world which generated bsps , deleted the hello_world.c and included all the example .c files for test_computer , still the same results , NO SUCCESS

0 Kudos
Highlighted
Employee
14 Views

Do you see this error even with Hello World example (before adding your code)?

I've tested your files and working fine until printing  "Hello from Nios II"

Can you try this and see? If there is no error then we should run through the code and see. Maybe something went wrong.

else you can try the following (might help):

Right click the BSP project ... NIOS II... Edit BSP... check "Enable small C library"

Right click the project....properties....NIOS II application properties .... choose Debug Level "Level 2" .....Optimization Level "Level 2" .

 

Regards.

 

0 Kudos
Highlighted
Novice
14 Views

Yes simple "Hello World" works OK , see source files for the media example attached .

0 Kudos
Highlighted
Novice
14 Views

i dont see any option to attach files ???

0 Kudos
Highlighted
Novice
14 Views

 

 

// test SRAM

* SRAM_ptr = SRAM_write; 

SRAM_read = * SRAM_ptr; 

if (SRAM_read != SRAM_write)

{

memory_error = 1;

}

SRAM_ptr += 1;

};

SRAM_write = ~SRAM_write;

if ( eight_sec > 80 )

{

eight_sec = 0; // restart the 8-second delay counter

if ( display_toggle == 0 )

{

display_toggle = 1;

display_buffer[0] = 0xbA55Ed; // code for the word PASSEd

display_buffer[1] = 0x0;

display_buffer[2] = 0x0;

}

else

{

display_toggle = 0;

display_buffer[0] = 0xdE20115; // code for the word dE2 115

display_buffer[1] = 0x0;

display_buffer[2] = 0x0;

}

}

};

display_buffer[0] = 0xe7787; // code for the word Error

display_buffer[1] = 0x0;

display_buffer[2] = 0x0;

while ( 1 )

{

Update_HEX_display ( display_buffer[1] );

}

 

return 0;

}

 

/*******************************************************************************

 * Updates the value displayed on the hex display. The value is taken from the 

 * buffer.

********************************************************************************/

void Update_HEX_display( int buffer )

{

volatile int * HEX3_HEX0_ptr = (int *) HEX3_HEX0_BASE;

volatile int * HEX7_HEX4_ptr = (int *) HEX7_HEX4_BASE;

int shift_buffer, nibble;

char code;

int i;

 

shift_buffer = buffer;

for ( i = 0; i < 8; ++i )

{

nibble = shift_buffer & 0x0000000F; // character is in rightmost nibble

code = seven_seg_decode_table[nibble];

hex_segments[i] = code;

shift_buffer = shift_buffer >> 4;

}

*(HEX3_HEX0_ptr) = *(int *) hex_segments; // drive the hex displays

*(HEX7_HEX4_ptr) = *(int *) (hex_segments+4); // drive the hex displays

return;

}

 

/********************************************************************************

 * Updates the value displayed on the red LEDs. The value is taken from the 

 * slider switches.

********************************************************************************/

void Update_red_LED( void )

{

  volatile int * slider_switch_ptr = (int *) SW_BASE;

volatile int * red_LED_ptr = (int *) RED_LED_BASE;

 

int sw_values;

sw_values = *(slider_switch_ptr); // Read the SW slider switch values

   

  if(LED_toggle == 0)

    *(red_LED_ptr) = sw_values; // Light up the red LEDs

  else 

    *(red_LED_ptr) = ~sw_values; 

     

return;

}

 

/********************************************************************************

 * Reads characteres received from either JTAG or serial port UARTs, and echo

 * character to both ports.

********************************************************************************/

void Update_UARTs( void )

{

  volatile int * JTAG_UART_ptr = (int *) JTAG_UART_BASE;

volatile int * UART_ptr = (int *) SERIAL_PORT_BASE;

 

int JTAG_data_register, JTAG_control_register;

char JTAG_char;

int UART_data_register, UART_control_register;

char UART_char;

 

// check for char from JTAG, echo to both JTAG and serial port UARTs

JTAG_data_register = *(JTAG_UART_ptr); // bit 15 is RVALID, bits 7-0 is char data

if ( (JTAG_data_register & 0x8000) ) // have valid data to read?

{

JTAG_char = (char) (JTAG_data_register & 0xFF); // extract the character

JTAG_control_register = *(JTAG_UART_ptr + 1); // upper halfword is WSPACE

if ( (JTAG_control_register & 0xFFFF0000) != 0) // okay to echo char to JTAG?

{

*(JTAG_UART_ptr) = JTAG_char; // echo the character

}

UART_control_register = *(UART_ptr + 1); // upper halfword is WSPACE

if ( (UART_control_register & 0xFFFF0000) != 0) // okay to echo char to serial port?

{

*(UART_ptr) = JTAG_char; // echo the character

}

}

// check for char from serial port UART, echo to both serial port and JTAG UARTs

UART_data_register = *(UART_ptr); // bit 15 is RVALID, bits 7-0 is char data

if ( (UART_data_register & 0x8000) ) // have valid data to read?

{

UART_char = (char) (UART_data_register & 0xFF); // extract the character

UART_control_register = *(UART_ptr + 1); // upper halfword is WSPACE

if ( (UART_control_register & 0xFFFF0000) != 0) // okay to echo char to serial port?

{

*(UART_ptr) = UART_char; // echo the character

}

JTAG_control_register = *(JTAG_UART_ptr + 1); // upper halfword is WSPACE

if ( (JTAG_control_register & 0xFFFF0000) != 0) // okay to echo char to serial port?

{

*(JTAG_UART_ptr) = UART_char; // echo the character

}

}

return;

}

 

/********************************************************************************

 * This code tests the GPIO JP5 expansion port. The code requires one  

 * even-numbered data pin(e.g. D2) to be connected with one odd-numbered

 * pin in the port(e.g. D3), which would typically be done using a wire 

 * or a pin connector.

 * If the two pins work properly, the code will toggle the red LEDs. 

 

 * The 32 data pins' (D0 to D31) distribution on the 40-pin expansion port 

 * is shown at line 51 

********************************************************************************/

void Test_expansion_ports( void )

{

  volatile int * JP5_EXPANSION_ptr = (int *) EXPANSION_JP5_BASE;

   

  // set all pins to be outputs and restore 1 to all pins

  *(JP5_EXPANSION_ptr+1) = 0xffffffff;   

  *(JP5_EXPANSION_ptr) = 0xffffffff;   

   

  // set the even-numbered pins to be output pins and write 0 to all output pins

*(JP5_EXPANSION_ptr+1) = 0x55555555;   

  *(JP5_EXPANSION_ptr) = 0x0;   

   

  //read the input pins value

  volatile int odd_in = *(JP5_EXPANSION_ptr); 

   

   //if one input pin connected to one output pin, its value would be drawn to 0.

  int odd_correct = (odd_in != 0xaaaaaaaa) ? 1 : 0;  

                            

    

 

 

0 Kudos
Highlighted
Novice
14 Views

Hi Embedded_guy , did you looked at the files in folder "source_files" ?

0 Kudos