Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

Baremetal DS-5 Debugging ARM hangs after a few seconds




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 I

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 I

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