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.

Hello world on Nios?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Activity points
9,442
Guys,

I tried to compile hello world on Nios II, but I got :
c:/altera/12.1sp1/nios2eds/bin/gnu/h-i686-mingw32/bin/../lib/gcc/nios2-elf/4.1.2/../../../../nios2-elf/bin/ld.exe: region `onchip_memory2_0' overflowed by 30672 bytes
Anything that I can fix ?
thanks
 

I remember you had the NiosII build problem where you were exceeding the RAM in the FPGA.

You really need to ask why you get the following message?
`onchip_memory2_0' overflowed by 30672 bytes

Well if you tried to build an image with stdio.h you would be adding a rather large amount of code via the linked library that performs the printf you used to compile your Hello World program. You must never have used a software compiler before.
 

The issue is, if I increase the memory to 65536, I can't build NIOS processor on SOPC, I have built some softwares before with different processors, but I'm beginner for this "soft" processor NIOS...

Any clues for increasing my memory ? thanks
 

I use EP4CE10F17, how can I increase the memory ? thanks
 

I use EP4CE10F17, how can I increase the memory
I presume you can read datasheets and know how much on-chip memory is available with EP4CE10?

I'm not presently using NIOS and don't know the stdio.h footprint. But I would read ads-ee's post in the way that you should try to code Hello world without using printf().
 

Do you mean : 3. Memory Blocks in Cyclone IV Devices ?
thanks

- - - Updated - - -

It has 414 Kbits of Embedded memory according to the datasheet...

- - - Updated - - -

51.75 Kbytes ...
 

Well then make a NiosII with 32KB of RAM.

FYI, Giving us these three tidbits of information in your first post would have saved a lot of time. Why is it that so many posters always have to be told what information is needed to help? Do these posters think forum members are psychic? Next time post with useful information that others can use to help you.

bianchi77 said:
I use EP4CE10F17
The issue is, if I increase the memory to 65536 (64KB)
Any clues for increasing my memory ? thanks
It has 414 Kbits of Embedded memory according to the datasheet...51.75 Kbytes ...
Hmm seems to me you had your answer sitting right there all along. 64KB > 51.75KB
If you are currently at 32KB of RAM then you:
a. get rid of the printf
b. use a bigger part
c. use external RAM as the processor memory and use block RAMs as cache RAM (NiosII build option)
 

I managed to compile SOPC for NIOS on 32Kb, but how can I compile "small hello world" in eclipse into the chip ?
thanks

- - - Updated - - -

Code:
/* 
 * "Small Hello World" example. 
 * 
 * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on
 * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example 
 * designs. It requires a STDOUT  device in your system's hardware. 
 *
 * The purpose of this example is to demonstrate the smallest possible Hello 
 * World application, using the Nios II HAL library.  The memory footprint
 * of this hosted application is ~332 bytes by default using the standard 
 * reference design.  For a more fully featured Hello World application
 * example, see the example titled "Hello World".
 *
 * The memory footprint of this example has been reduced by making the
 * following changes to the normal "Hello World" example.
 * Check in the Nios II Software Developers Manual for a more complete 
 * description.
 * 
 * In the SW Application project (small_hello_world):
 *
 *  - In the C/C++ Build page
 * 
 *    - Set the Optimization Level to -Os
 * 
 * In System Library project (small_hello_world_syslib):
 *  - In the C/C++ Build page
 * 
 *    - Set the Optimization Level to -Os
 * 
 *    - Define the preprocessor option ALT_NO_INSTRUCTION_EMULATION 
 *      This removes software exception handling, which means that you cannot 
 *      run code compiled for Nios II cpu with a hardware multiplier on a core 
 *      without a the multiply unit. Check the Nios II Software Developers 
 *      Manual for more details.
 *
 *  - In the System Library page:
 *    - Set Periodic system timer and Timestamp timer to none
 *      This prevents the automatic inclusion of the timer driver.
 *
 *    - Set Max file descriptors to 4
 *      This reduces the size of the file handle pool.
 *
 *    - Check Main function does not exit
 *    - Uncheck Clean exit (flush buffers)
 *      This removes the unneeded call to exit when main returns, since it
 *      won't.
 *
 *    - Check Don't use C++
 *      This builds without the C++ support code.
 *
 *    - Check Small C library
 *      This uses a reduced functionality C library, which lacks  
 *      support for buffering, file IO, floating point and getch(), etc. 
 *      Check the Nios II Software Developers Manual for a complete list.
 *
 *    - Check Reduced device drivers
 *      This uses reduced functionality drivers if they're available. For the
 *      standard design this means you get polled UART and JTAG UART drivers,
 *      no support for the LCD driver and you lose the ability to program 
 *      CFI compliant flash devices.
 *
 *    - Check Access device drivers directly
 *      This bypasses the device file system to access device drivers directly.
 *      This eliminates the space required for the device file system services.
 *      It also provides a HAL version of libc services that access the drivers
 *      directly, further reducing space. Only a limited number of libc
 *      functions are available in this configuration.
 *
 *    - Use ALT versions of stdio routines:
 *
 *           Function                  Description
 *        ===============  =====================================
 *        alt_printf       Only supports %s, %x, and %c ( < 1 Kbyte)
 *        alt_putstr       Smaller overhead than puts with direct drivers
 *                         Note this function doesn't add a newline.
 *        alt_putchar      Smaller overhead than putchar with direct drivers
 *        alt_getchar      Smaller overhead than getchar with direct drivers
 *
 */

#include "sys/alt_stdio.h"

int main()
{ 
  alt_putstr("Hello from Nios II!\n");

  /* Event loop never exits. */
  while (1);

  return 0;
}
 

I managed to compile SOPC for NIOS on 32Kb, but how can I compile "small hello world" in eclipse into the chip ?
thanks
Maybe you can try the same procedure that you used in your first post.
I tried to compile hello world on Nios II, but I got :
Anything that I can fix ?
thanks

Did you even READ what I posted in #7?

Maybe you just don't know how to ask a question: http://www.catb.org/esr/faqs/smart-questions.html

Maybe you're saying that the you can't fit "small hello world" into the 32Kb (kilo-bit) of RAM or did you mean 32KB (kilo-byte) of RAM? As you're questions are vague I can't be sure if that is your problem or not. You never told us what the configuration of the SOPC system was in post #1. Was it 16KByte, 16Kb, 8KB, 8Kb, or ... As you never said, we can only guess.

Why do I even bother trying to help people who write such unintelligible posts like you consistently do.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top