1 Reply Latest reply on Jul 14, 2017 1:50 PM by Intel Corporation

    Not able to debug intel galileo gen2 board using OpenOCD and GDB

    drashti

      Hello,

       

      I am trying to debug application through openOCD and gdb on intel galileo gen2 board.

      I am able to set the software break point but, program running on hardware is not stopping at that break point.

      And If I set the hardware break point then I am sometimes able to stop the code on hardware but not always. Success rate is once in ~10 trial.

      I am using below board and architecture:

       

      Hardware: intel galileo gen2 board

      processor: Quark X1000

      debugger: ARM-USB-OCD-H

       

      Steps I follow is as below:

      Create a simple application in the local machine for ex. counter.c:

      #include <stdio.h>
      #include <stdlib.h>
      
      
      int main(void){
         int num ;
         while(1)
         {
         sleep(2);
         num=num+1;
         printf("number = %d\n", num);
         }
         return 0;
      }
      

      Compile it with the sdk generated by bitbake using below command:

       

      ${CC} -g -O0 counter.c -o counter_app
      

       

      Copy this binary to board

      Run application on board by simply running ./counte_app

      Run openOCD by running below command:

      openocd -f ./tcl/interface/ftdi/olimex-arm-usb-ocd-h.cfg -f ./tcl/target/quark_x10xx.cfg
      

      Open GDB and connect GDB to openOCD

      halt the board and load the symbolic information of application in gdb by below command:

      symbol-file <PATH TO DEBUG BINARY>/counter_app
      

      After that I have set the break point on line 11 by

      hbreak counter.c:11
      

       

      Still i hardly able to break the execution on board using above steps.

      But even if I hit the hardware break point, I am not allowed to step into the code! If I step into/free run the code I get below error!

       

      Could you please help me solve the issue? What could be the reason for this inconsistent behaviour? Am I missing out any step or It is the expected behaviour?

       

      Thanks and regards,

      Drashti