Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
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.
21615 Discussions

c++ in Nios2 "Hello world" help!

Altera_Forum
Honored Contributor II
938 Views

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?
0 Kudos
0 Replies
Reply