Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12409 Discussions

Baremetal DS-5 Debugging ARM hangs after a few seconds

Honored Contributor II




I'm having a problem with the baremetal debugging mode from DS-5. In every case the arm processor hangs after a few seconds. I'm using the Altera-SoCFPGA-HelloWorld-BareMetal example and I add a simple endless while loop with a wait time. 


# include <stdio.h> int main(int argc, char** argv) { int i; int j; int n=0; while(1) { printf("Hello from Semi-Hosted ARMCC Baremetal Altera SoC-FPGA!\n"); printf("Loops! = %d\n",n); n=n+1; for (i = 0; i < 4000; ++i) for (j = 0; j < 800; ++j) {} } return 0; }  




When I'm now start the code i can see this on the app console:  


What is fine but after some seconds of execution the console stops and nothing happens. The Debug-Control still says the processor is running when I manually stop the execution the Disassembly Windows says the processor works now around address 0x00002FA0 (My main is around 0xFFFF00A4). I don't get any error messages which makes it difficult to find the bug.  


I'm using the SoCKit and I also tested it with the DE1 and i had the same problem. 


Someone have a hint what I'm doing wrong or where could be the problem? 


Best regards, 

0 Kudos
2 Replies
Honored Contributor II

Did you solve this? Do some experimentation to see if the problem actually has anything to do with the content of your code. For example, use just one loop instead of two. If necessary, put some math operation inside the loop to take up time. Use just one printf that is shorter, like just the "loops" one. Try removing the printf. Use while() instead of for(). FYI, n++ would commonly be used in C instead of n=n+1. 

Honored Contributor II

Bare metal application does not come with task /scheduler management. such a massive printf operation and just with a unknown delay maybe too short to me..