2 Replies Latest reply on Jan 25, 2016 12:38 PM by tberkau_1483251

    Issue setting up Eclipse with FX3 and Olimex

    tberkau_1483251

      Hi guys,

         

      Almost finished setting up our Eclipse debug setup, however we're running into an issue during the final debug step. First off, basic specs:

         

      -Windows 7 64-bit

         

      -OpenOCD 0.9.0

         

      -FX3 SDK 1.3

         

      -WinUSB driver for Olimex ARM-USB-OCD-H

         

      Running OpenOCD with script yields the following output:

         
          

      Open On-Chip Debugger 0.9.0-rc1 (2015-04-24-22:09)
      Licensed under GNU GPL v2
      For bug reports, read
          http://openocd.org/doc/doxygen/bugs.html
      adapter_nsrst_delay: 200
      Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
      jtag_ntrst_delay: 200
      adapter speed: 1000 kHz
      adapter speed: 1000 kHz
      trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
      RCLK - adaptive
      adapter speed: 1000 kHz
      Info : clock speed 1000 kHz
      Info : JTAG tap: fx3.cpu tap/device found: 0x07926069 (mfg: 0x034, part: 0x7926, ver: 0x0)
      Info : Embedded ICE version 6
      Info : fx3.cpu: hardware has 2 breakpoint/watchpoint units

         
         

      Which looks good as far as I can tell. However running gdb afterwards yields the following result:

         
          

      91-gdb-set confirm off
      91^done
      (gdb)
      92-gdb-set width 0
      92^done
      (gdb)
      93-gdb-set height 0
      93^done
      (gdb)
      94-interpreter-exec console echo
      94^done
      (gdb)
      95-gdb-show prompt
      95^done,value="(gdb) "
      (gdb)
      96 Set prompt (arm-gdb)
      &"Set prompt (arm-gdb)\n"
      =cmd-param-changed,param="prompt",value="(arm-gdb)"
      Set prompt (arm-gdb)
      96^done
      (gdb)
      97 target remote localhost:3333
      &"target remote localhost:3333\n"
      target remote localhost:3333
      ~"Remote debugging using localhost:3333\n"
      Remote debugging using localhost:3333
      =thread-group-started,id="i1",pid="42000"
      =thread-created,id="1",group-id="i1"
      ~"0x00000000 in ?? ()\n"
      0x00000000 in ?? ()
      *stopped,frame={addr="0x00000000",func="??",args=[]},thread-id="1",stopped-threads="all"
      97^done
      (gdb)
      98 monitor speed 1000
      &"monitor speed 1000\n"
      monitor speed 1000
      @"invalid command name \"speed\"\n"
      invalid command name "speed"
      98^done
      (gdb)
      99 monitor endian little
      &"monitor endian little\n"
      monitor endian little
      @"invalid command name \"endian\"\n"
      invalid command name "endian"
      99^done
      (gdb)
      100 set endian little
      &"set endian little\n"
      set endian little
      ~"The target is assumed to be little endian\n"
      The target is assumed to be little endian
      =cmd-param-changed,param="endian",value="little"
      100^done
      (gdb)
      101 monitor reset
      &"monitor reset\n"
      monitor reset
      @"JTAG tap: fx3.cpu tap/device found: 0x07926069 (mfg: 0x034, part: 0x7926, ver: 0x0)\n"
      JTAG tap: fx3.cpu tap/device found: 0x07926069 (mfg: 0x034, part: 0x7926, ver: 0x0)
      @"NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.\n"
      NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.
      @"NOTE! Severe performance degradation without working memory enabled.\n"
      NOTE! Severe performance degradation without working memory enabled.
      @"NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.\n"
      NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.
      101^done
      (gdb)
      102 monitor reg cpsr =0xd3
      &"monitor reg cpsr =0xd3\n"
      monitor reg cpsr =0xd3
      @"Target not halted\n"
      Target not halted
      @"cpsr (/32): 0x00000000\n"
      cpsr (/32): 0x00000000
      102^done
      (gdb)
      103 monitor memU32 0xFFFFF014 =0xFFFFFFFF
      &"monitor memU32 0xFFFFF014 =0xFFFFFFFF\n"
      monitor memU32 0xFFFFF014 =0xFFFFFFFF
      @"invalid command name \"memU32\"\n"
      invalid command name "memU32"
      103^done
      (gdb)
      104 monitor memU32 0x40000000 =0xE3A00015
      &"monitor memU32 0x40000000 =0xE3A00015\n"
      monitor memU32 0x40000000 =0xE3A00015
      @"invalid command name \"memU32\"\n"
      invalid command name "memU32"
      104^done
      (gdb)
      105 monitor memU32 0x40000004 =0xEE090F31
      &"monitor memU32 0x40000004 =0xEE090F31\n"
      monitor memU32 0x40000004 =0xEE090F31
      @"invalid command name \"memU32\"\n"
      invalid command name "memU32"
      105^done
      (gdb)
      106 monitor memU32 0x40000008 =0xE240024F
      &"monitor memU32 0x40000008 =0xE240024F\n"
      monitor memU32 0x40000008 =0xE240024F
      @"invalid command name \"memU32\"\n"
      invalid command name "memU32"
      106^done
      (gdb)
      107 monitor memU32 0x4000000C =0xEE090F11
      &"monitor memU32 0x4000000C =0xEE090F11\n"
      monitor memU32 0x4000000C =0xEE090F11
      @"invalid command name \"memU32\"\n"
      invalid command name "memU32"
      107^done
      (gdb)
      108 monitor memU32 0xE0052000 = 0x00080015
      &"monitor memU32 0xE0052000 = 0x00080015\n"
      monitor memU32 0xE0052000 = 0x00080015
      @"invalid command name \"memU32\"\n"
      invalid command name "memU32"
      108^done
      (gdb)
      109 monitor sleep 1000
      &"monitor sleep 1000\n"
      monitor sleep 1000
      109^done
      (gdb)
      110 set $pc =0x40000000
      &"set $pc =0x40000000\n"
      set $pc =0x40000000
      110^done
      (gdb)
      111 si
      &"si\n"
      si
      111^running
      *running,thread-id="all"
      (gdb)
      @"WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt.\n"
      WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt.
      @"Halt timed out, wake up GDB.\n"
      Halt timed out, wake up GDB.
      ~"\nProgram received signal "

         
         
          

      Program received signal ~"SIGINT, Interrupt.\n"
      SIGINT, Interrupt.
      ~"0x00000000 in ?? ()\n"
      0x00000000 in ?? ()
      *stopped,frame={addr="0x00000000",func="??",args=[]},thread-id="1",stopped-threads="all"
      (gdb)
      112-break-insert cyfxslfifosync.c:733
      112^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x40003e7c",func="CyFxBillCounterStart",file="../cyfxslfifosync.c",fullname="c:\\users\\ssd\\desktop\\new files\\slavefifosync\\slavefifosync\\cyfxslfifosync.c",line="733",thread-groups=["i1"],times="0",original-location="cyfxslfifosync.c:733"}
      (gdb)
      113-exec-continue
      113^error,msg="Warning:\nCannot insert breakpoint 1.\nError accessing memory address 0x40003e7c: (undocumented errno -1).\n"
      (gdb)
      114-break-insert cyfxslfifosync.c:3666
      114^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x40009694",func="GpioInputMenualThread_Entry",file="../cyfxslfifosync.c",fullname="c:\\users\\ssd\\desktop\\new files\\slavefifosync\\slavefifosync\\cyfxslfifosync.c",line="3666",thread-groups=["i1"],times="0",original-location="cyfxslfifosync.c:3666"}
      (gdb)
      115-break-insert -t main
      115^done,bkpt={number="3",type="breakpoint",disp="del",enabled="y",addr="0x40009a38",func="main",file="../cyfxslfifosync.c",fullname="c:\\users\\ssd\\desktop\\new files\\slavefifosync\\slavefifosync\\cyfxslfifosync.c",line="3920",thread-groups=["i1"],times="0",original-location="main"}
      (gdb)
      116-stack-list-frames
      116^done,stack=[frame={level="0",addr="0x00000000",func="??"},frame={level="1",addr="0x00000000",func="??"}]
      (gdb)
      117 load
      &"load\n"
      load
      ~"Loading section .vectors, size 0x2320 lma 0x100\n"
      Loading section .vectors, size 0x2320 lma 0x100
      117+download,{section=".vectors",section-size="8992",total-size="761283"}
      ~"Loading section .text, size 0x9a70 lma 0x40003000\n"
      Loading section .text, size 0x9a70 lma 0x40003000
      &"Load failed\n"
      117^error,msg="Load failed"
      Load failed
      (gdb)

         
         

      I used the initialize commands as shown in the FX3 Programmers Manual. I noticed several of the initialize commands aren't found, were they deprecated or something? Any thoughts?

        • 1. Re: Issue setting up Eclipse with FX3 and Olimex
          nikhil.naik

          You are missing "monitor halt" command "remote localhost"

             

           

             


          set prompt (arm-gdb)
          # This connects to a target via netsiliconLibRemote
          # listening for commands on a TCP port on the local machine.
          # 2331 if the Segger J-Link GDB Server is being used
          # 3333 if OpenOCD is being used
          # If OpenOCD is being used, the CPU should be halted
          # using the "monitor halt" command.
          # Uncomment the appropriate line below:
          # target remote localhost:2331
          target remote localhost:3333
          monitor halt
          monitor speed 1000
          monitor endian little
          set endian little
          monitor reset
          # Set the processor to SVC mode
          monitor reg cpsr =0xd3
          # Disable all interrupts
          monitor memU32 0xFFFFF014 =0xFFFFFFFF
          # Enable the TCMs
          monitor memU32 0x40000000 =0xE3A00015
          monitor memU32 0x40000004 =0xEE090F31
          monitor memU32 0x40000008 =0xE240024F
          monitor memU32 0x4000000C =0xEE090F11
          # Change the FX3 SYSCLK setting based on
          # input clock frequency. Update with
          # correct value from list below.
          # Clock input is 19.2 MHz: Value = 0x00080015
          # Clock input is 26.0 MHz: Value = 0x00080010
          # Clock input is 38.4 MHz: Value = 0x00080115
          # Clock input is 52.0 MHz: Value = 0x00080110
          monitor memU32 0xE0052000 = 0x00080015
          # Add a delay to let the clock stabilize.
          monitor sleep 1000
          set $pc =0x40000000
          si
          si
          si
          si

          • 2. Re: Issue setting up Eclipse with FX3 and Olimex
            tberkau_1483251

            Thanks that did the trick!