Free Eclipse ARM GCC OpenOCD Toolchain for Windows– Component 4: GDB/ OpenOCD Debugger

In this component of the tutorial we will certainly be establishing eclipse to release a complete debug session where the cpu can be blinked with the application, and also ran. When this component is effectively finished you will certainly have the ability to establish breakpoints and also sight memory, much like any type of pricey toolchain. This component of the tutorial was one of the most challenging for me to solve. Ideally you will certainly have less issues than I did.

Components

  1. Component 1: Intro
  2. Component 2: ARM GCC
  3. Component 3: Eclipse IDE
  4. Component 4: GDB/ OpenOCD Debugger

Download And Install OpenOCD

Begin by downloading and install OpenOCD from Freddie Chopin’s internet site by complying with the web link listed below.

http://www.freddiechopin.info/en/download/category/4-openocd

When you have actually downloaded and install OpenOCD, remove the 7zip data. Next off, include the removed OpenOCD folder to the ARMTC folder. Below is what my ARMTC folder currently appears like.

Debug_ARMTC_Folder_With_OpenOCD

Currently, as we provided for the ARMGCC, include the course to the OpenOCD container folder to your COURSE atmosphere variable. If you are unsure exactly how to do this, refer back to the Component 2 blog post. My course to OpenOCD is:

C: ARMTCopenocd-0.7.0 container

Currently evaluate the course to OpenOCD by inputting the command listed below in the command home window.

openocd-0.7.0 -v

You must obtain outcomes comparable to what is revealed listed below.

Debug_OpenOCD_version_path_test

Mount the Olimex ARM JTAG

Currently we require to mount the vehicle drivers for the Olimex JTAG tool. I made use of the directions for mounting the vehicle drivers that are consisted of in the README data in the OlimexODS vehicle drivers folder. Begin by connecting in your JTAG tool. You must after that be motivated to either immediately mount the vehicle drivers, or offer an area. Select mount from a details place, and also if you have actually downloaded and install the OlimexODS, pick the olimex-libusb-1.2.2.0 folder consisted of in the vehicle drivers folder. If you do not have OlimexODS, the browse to the OpenOCD vehicle drivers folder, remove the libusb-win32 _ feet2232 _ motorist-120229 zip data, and also factor the motorist installer to this folder. I advise making use of the vehicle drivers supplied by Olimex, if you can, considering that I have not attempted the vehicle drivers supplied by OpenOCD. Please comment if you have actually effectively made use of the OpenOCD FEET232 vehicle drivers with the Olimex JTAG tool.

Following, we can better evaluate OpenOCD by introducing it from a command home window. Open up a brand-new command home window generally folder of the task. My course is revealed listed below.

C: ProjectsE407 BlinkerSTM32- E407 _ blink_FLASH

Currently, go into the command revealed listed below adjusting any place essential to match your task setup. The outcomes I obtained are revealed listed below. If the photo is as well tiny to see in your web browser home window, the click it to available to complete dimension.

openocd-0.7.0 -f C: ARMopenocd-0.7.0 scriptsinterfaceolimex-arm-usb-tiny-h. cfg -f project.cfg

Debug_Launch_OpenOCD_first_try

As you can see, this fell short for me. The variation of OpenOCD that I downloaded and install really did not have the olimex_stm32 _ e407 cfg data. To obtain this to function, I needed to duplicate this data from the OlimexODS folder tree, and also paste it in to my OpenOCD scripts/boards folder. After replicating the manuscript in to my OpenOCD directory site, I attempted the command once again. Below is the outcome.

Debug_Launch_OpenOCD

This time around you can see that OpenOCD was effectively released. The last line informs you that you have 6 breakpoints and also 4 watchpoints.

Likewise, home windows will likely ask if you wish to permit accessibility to OpenOCD. I proceeded and also provided it complete gain access to.

Debug_Launch_OpenOCD_Block_OpenOCD

Currently we will certainly incorporate OpenOCD, GDB, and also Eclipse. If it isn’t currently running, begin Eclipse and also pick the work space that we produced partly 3.

Install GDB Equipment Debugging Plugin

Click Aid after that Install New Software Application.

Debug_Install_New_Software

In the Collaborate with message box, pick Kepler. Await the choices to pack in the Name box. When the Name box is booming, increase the Mobile and also Gadget Growth group. location a check beside C/C++ GDB Equipment Debugging, and also click following.

Debug_Install_GDB_Hardware_Debugging

Once more click Following.

Debug_Install_GDB_Hardware_Debugging_Next

Approve the permit arrangement, and also click coating.

Debug_Install_GDB_Hardware_Debugging_Accept_License

Reactivate Eclipse.

Debug_Install_GDB_Hardware_Debugging_Restart

Configure GDB Customer

At this moment, we will certainly set up the GDB customer. Begin by clicking the down arrowhead beside the pest sign, after that click Debug Configurations.

Debug_Debug_Configurations

Begin by providing this setup a special name in the Name message box. Click the radio switch beside Disable vehicle construct.

Debug_Config_GDBHW_Main

In the Debugger tab, alter the GDB Command to arm-none-eabi-gdb. Make Certain that Common TCP/IP is chosen for the JTAG Gadget, which the Host name is localhost. Kind 3333 for the Port number.

Debug_Config_GDBHW_Debugger

In the Start-up tab, make sure that Reset and also Stop are not inspected. Go into screen reset stop in the Initialization Commands message box. Make sure that the Tons photo and also Tons signs boxes are inspected.

Debug_Config_GDBHW_Startup

Likewise in the Start-up tab, make sure that the continuing to be boxes are unattended. Unless you recognize of any type of run regulates that would certainly serve, after that it must be secure to leave this message box vacant.

Debug_Config_GDBHW_Startup2

There must be absolutely nothing to do in the Resource tab.

Debug_Config_GDBHW_Source

In the Typical tab, position a check beside Debug to make sure that this setup will certainly be included in the faves food selection.

Debug_Config_GDBHW_Common

Click the Apply switch, after that the Close switch in the meantime.

OpenOCD Web Server Launcher

Currently we will certainly establish a method to release OpenOCD from Eclipse. Do this by clicking the down arrowhead beside the External Equipments symbol, after that pick External Devices Configurations.

Debug_ExtTool

In the Place message box of the primary tab, include the course to the OpenOCD executable adjusting where essential to fit your task.

$ {eclipse_home}. openocd-0.7.0 binopenocd-0.7.0. exe

To include the task place as the functioning directory site, click the Variables tab, scroll to projcet_loc, and also click Ok.

Include the line listed below to your disagreements listing.

– f./ scripts/interface/olimex-arm-usb- tiny-h. cfg -f project.cfg

Debug_ExtTool_Main

The refresh tab must currently be established.

Debug_ExtTool_Refresh

In the construct tab, make sure that the Build prior to launch check box is vacant.

Debug_ExtTool_Build

The Setting tab must currently be correctly established.

Debug_ExtTool_Environment

In the usual tab, make sure that a check is included beside the alternative to present this setup in the exterior devices food selection.

Debug_ExtTool_Common

When you are ended up, click Apply and after that Shut.

Release OpenOCD Web Server

Click the down arrowhead beside the exterior devices symbol, and after that click the OpenOCD Web Server Launcher that we produced in the previous actions.

Debug_Launch_OpenOCD_Server

In the console home window you must have the ability to see someting comparable to what is revealed listed below where it informs you the amount of breakpoints, and also the amount of view factors you have readily available.

Debug_Launch_OpenOCD_Server_Console_Output

Release GDB Customer

Currently it is time to really run the examination program on the board. Make sure that your JTAG is attached to your computer system with USB, that the JTAG is correctly attached to your board, which the target board is powered. Release the GDB customer by clicking the down arrowhead beside the debug sign and also clicking the recently produced launch setup.

Debug_Run_Launch_1

At this moment the application must be packed, and also the cpu must be stopped. Next off, click the return to switch.

Debug_Run_Resume_2

This will certainly begin the application and also you must be seeing the LED blinking. When you are done shouting like a lady with enjoyment, due to the fact that you have actually made what at one factor seemed like the difficult, really occur, click the put on hold switch to quit the cpu.

Debug_Run_Suspend_3

Currently include break factors by dual clicking the location to the left of the hold-up lines as revealed listed below. When you have actually included the break factors repeadedly click the return to switch. This must at the same time quit on each break factor toggling the standing of the BAITED and also off at each break factor.

Debug_Run_Breakpoints_4

Verdict

This brings us to a quiting factor in the guide collection. When establishing with the ARM GCC, Eclipse, and also OpenOCD it appears like there are unrestricted opportunities, yet likewise equally as lots of challenges. Ideally we can share info, and also make this procedure easier in the future.

Zylin Choice GDB Customer

Additionally you can mount the Zylin Eclipse Plugin. I have actually utilized this effectively in the past, yet had not been able to obtain it to deal with this variation of Eclipse. To include the Zylin Eclipse plugin. Begin by clicking the Aid tab, and also choosing Install New Software application.

Debug_Install_New_Software

Paste the address of the Zylin upgrade website listed below in to the deal with message box, and also click the include switch.

http://opensource.zylin.com/zylincdt

Debug_Add_Update_Site

Kind Zylin in the name message box of the resulting Include Repository dialog and also click OK.

Debug_Add_Repository

Once the plugin tons, press the Select All Switch, and also click following

Debug_Add_ZylinCDT

Click following on the Install Particulars dialog.

Debug_Install_Details

Approve the permit, and also click Following.

Debug_License

Click Ok to the cautioning regarding anonymous web content. Next off, you will certainly be motivated to reboot eclipse. Click Ok, and also permit Eclipse to reboot. When Eclipse reactivates, once more pick the work space from Component 3, and also click OK.

Currently we require to develop a brand-new debug configuratoin. Click the down arrowhead to the right of the pest sign and also pick Debug Configurations as is revealed listed below.

Debug_Debug_Configurations

In the resulting debug setups dialog, dual click the Zylin Installed Debug (Indigenous) alternative.

Debug_Zylin_Embedded_Debug_Native

This produces a brand-new debug setup. Generally tab, relabel your debug setup to whatever you desire. I simply transformed words Default to Debug.

Debug_Config_Main_Tab

In the debugger tab, make sure that the Installed GDB debugger is chosen. Adjustment the name of the GDB debugger to arm-none-eabi-gdb. Likewise, make sure that the GDB command data message box is empty.

Debug_Config_Debugger_Tab

Include the Initialize regulates listed below to the commands tab.

  • target remote localhost: 3333
  • screen reset stop
  • screen wait_halt
  • screen rest 100
  • screen survey
  • screen flash write_image eliminate main.bin 0x08000000

Include the run regulates listed below.

  • screen soft_reset_halt
  • screen wait_halt
  • screen survey
  • thbreak primary
  • proceed

Debug_Config_Commands_Tab

I really did not alter anything in the Resource or Setting tabs.

Debug_Config_Source_Tab

Debug_Config_Environment_Tab

In the Typical tab, inspect package to include this to the debug faves food selection. Make sure to click the use switch, and after that the close switch.

Debug_Config_Common_Tab

If you click the down arrowhead beside the pest sign, you must have the ability to see the brand-new debug setup.

Debug_New_Debug_Config

Components

  1. Component 1: Intro
  2. Component 2: ARM GCC
  3. Component 3: Eclipse IDE
  4. Component 4: GDB/ OpenOCD Debugger
You May Also Like