Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

c++ in Nios2 "Hello world" help!

Hi, I'm working with a DE2 board. I instantiate a Nios2 Core with the onboard Dram and all the other complementary hardware.

I did a simple software in C, with interruptions and everything, and it works fine.

The problem is that I need a code working in c++ to some capabilities I will need in the future.

For that i made a simpler Software proyect in Nios2eds using the Hello_World template, i test it, and everything work fine. Then i Rename the Main file "hello_world.c" to "hello_world.cpp" and i change the code to this:

#include <iostream>
using namespace std;
int main(void)
{
 cout << "Hello" << endl;
  return 0;
}

I recompile everything, no error message, I reprogram the FPGA and then download the software... at this point I only get an empty console...


$nios2-download -g hello_world.elf 
Using cable "USB-Blaster ", device 1, instance 0x00
Pausing target processor: OK
Initializing CPU cache (if present)
OK
Downloaded 344KB in 3.0s (114.6KB/s)
Verified OK                         
Starting processor at address 0x008001C4
$nios2-terminal 
nios2-terminal: connected to hardware target using JTAG UART on cable
nios2-terminal: "USB-Blaster ", device 1, instance 0
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)

I tried almost everything, i searched all the forum and i didn't find any working example... Can somebody help me despite of my awful English?
No RepliesBe the first to reply