Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

Baremetal DS-5 Debugging ARM hangs after a few seconds

Altera_Forum
Honored Contributor II
1,222 Views

Hi, 

 

 

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: 

 

http://www.alteraforum.com/forum/attachment.php?attachmentid=10974&stc=1  

 

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. 

 

http://www.alteraforum.com/forum/attachment.php?attachmentid=10975&stc=1  

 

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, 

Jonas
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
430 Views

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. 

Ron
0 Kudos
Altera_Forum
Honored Contributor II
430 Views

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..

0 Kudos
Reply