User Tools

Site Tools


eclipse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
eclipse [2012/07/16 00:14]
duggle
eclipse [2012/07/17 00:19] (current)
duggle
Line 115: Line 115:
 The following is used in this section:\\ The following is used in this section:\\
 **core:​**................STM32\\ **core:​**................STM32\\
-**OS:​**..................windows 7 x64\\ +**OS:​**..................windows 7 x64 **//WinXP should work the same use with OpenOCD 0.5.0 (non x64)//**\\ 
-**toolchain:​**......mios32_toolchain (wiki)\\ +**toolchain:​**......mios32_toolchain (mentioned in the wiki). **//Ensure that workspace environment PATH includes e.g C:​\mios32_toolchain\bin//​**\\ 
-**IDE:​**.................Eclipse (Indigo)\\+**IDE:​**.................Eclipse (Indigo) ​**//later versions will probably not work at this point//**\\
 **OpenOCD:​**.......0.5.0 x64 [[http://​www.freddiechopin.info/​en/​download/​category/​4-openocd|Download]]\\ **OpenOCD:​**.......0.5.0 x64 [[http://​www.freddiechopin.info/​en/​download/​category/​4-openocd|Download]]\\
-**GDB:​**.................Yagarto (gdb version 7.3.1)\\ +**GDB:​**.................Yagarto (gdb version 7.3.1) ​**//later versions should work//​**[[http://​http://​www.yagarto.de/#​download|download]] ​\\ 
-**JTAG:​**................Amontec JTAGkey-tiny\\+**JTAG:​**................Amontec JTAGkey-tiny ​ ​**//​many other brands and types of JTAG interface are supported by OpenOCD//**\\
  
 ===== OpenOCD ===== ===== OpenOCD =====
Line 154: Line 154:
  
 ==== Debug Configuration ==== ==== Debug Configuration ====
-Open Debug configurations (click pulldown on button pictured below)\\+This config will have the function of simply running the debugger with a project that is already flashed in the midibox core (it may have been flashed using MIOS Studio in the usual way). It does not actually build the program or flash it. Frequently you'll want to run the debugger for various test cases without changing the program. This does it quickest.\\ 
 +  * Open Debug configurations (click pulldown on button pictured below)\\
 {{:​eclipse:​debugconfigbutton.png|}} {{:​eclipse:​debugconfigbutton.png|}}
-  - Select "Debug Configurations..."​ +  ​* Select "Debug Configurations..."​ 
-  - +  * **Name:** type "//​YourProjectName//​ debug" appropriately. 
 +  * To the left of the "​Apply"​ button is a link: **"​Select other.."​** click it. 
 +  * Make sure "​Standard GDB Hardware Debugging Launcher"​ is selected. Click "​Ok"​. 
 +  * Beside the link it should say "Using Standard Hardware Debugging Launcher"​ 
 +  * **Main** tab:-
 +  * **C/C++ Application:​** e.g. "​W:​\sw\aMyProj\project_build\project.elf"​ (i.e full path to project *.elf file) 
 +  * **Project:​** click browse button and select from list of workspace project names 
 +  * Select "​Disable auto build" on this tab, to suppress the Make operation. 
 +  * **Debugger** tab:-> 
 +  * **GDB Command:** "​C:​\yagarto\bin\arm-none-eabi-gdb.exe"​ (i.e full path to gdb executable) 
 +  * **Command Set:** select "​Standard(Windows)"​. 
 +  * **Protocol Version:** select "​mi"​. 
 +  * Check "​Verbose console mode"​. 
 +  * Uncheck "Use remote target"​ 
 +  * **Startup** tab:-> 
 +  * "Reset and Delay" is checked, "​Halt"​ is checked  
 +  * Text box in the "​Initialization Commands"​ section: 
 +''​target extended-remote localhost:​3333\\ 
 +b main\\  
 +monitor soft_reset_halt \\ 
 +monitor sleep 500\\ 
 +continue \\ 
 +clear main''​ 
 +  * "Load Image" unchecked 
 +  * "Load symbols"​ checked 
 +  * "Use project binary"​ selected. Should show path to project.elf 
 +  * **Source** and  **Common** tabs are not altered. 
 +  * Click "​Apply"​ to save the configuration. 
 + 
 +==== Running the Debug Configuration ==== 
 +In this procedure we will debug by building the application and flashing it into the core using MIOS Studio, do this first then... 
 +  * Make sure OpenOCD process is running: 
 +{{:​eclipse:​exttool_config.png|}} 
 +  * Click pulldown on button pictured above and click on "​OpenOCD 0.5 (x64)" item. 
 +  {{:​eclipse:​consoleopenocd1.png|}} 
 +  * Open Debug configurations (click pulldown on button pictured below)\\ 
 +{{:​eclipse:​debugconfigbutton.png|}} 
 +  * Select "//​MyProject//​ debug"​ 
 +  * Cursor will stop at main() shown below. There will be all sorts of esoteric messages in the console relating to the workings of GDB. 
 +  * Run menu has all sorts of commands Resume,​Suspend,​Step Into,etc, etc. 
 +  * Experiment by placing a breakpoint in a routine that you know should execute: right click->​Toggle Breakpoint. 
 +  * Resume execution, until cursor stops at the line of code where the breakpoint is: The Variables frame shows the values of local variables.  
 + 
 +==== Flash/Debug Configuration ==== 
 +In this configuration the app will be built, then flashed into the core, then loaded ready to execute. 
 +  * Open Debug configurations (click pulldown on button pictured below)\\ 
 +{{:​eclipse:​debugconfigbutton.png|}} 
 +  * Select "Debug Configurations..."​ 
 +  ​* Copy the previous debug only configuration from the last section: 
 +  * (re)Name it "//​MyProject//​ flash,​debug"​ 
 +  * Main tab->select "​Enable auto build"​ 
 +  * Debugger tab-> same as before. 
 +  * Startup tab-> same except for contents of Initialization Commands text box: 
 +''​target extended-remote localhost:​3333\\ 
 +monitor reset halt\\ 
 +monitor wait_halt\\ 
 +monitor poll\\ 
 +''​ 
 + 
 +as well as in the "Run Commands"​ text box: 
 + 
 +''​monitor flash probe 0\\ 
 +monitor stm32f1x mass_erase 0\\ 
 +monitor flash write_image MyProjectFolder/​project_build/​project.bin 0x08000000 bin\\ 
 +disconnect\\ 
 +target remote localhost:​3333\\ 
 +monitor soft_reset_halt\\ 
 +''​ 
 +  * Click apply to save configuration settings 
 + 
 +==== Running the Flash/Debug Configuration ==== 
 +  * Make sure OpenOCD is running (see previously) 
 +{{:​eclipse:​debugconfigbutton.png|}} 
 +  * Click the pull down and select the item "//​MyProject//​ flash,​debug"​  
 +  * Project will build 
 +  * GDB diagnostics will appear (black, commands are in red).  
 +  * There will be a significant pause during the actual flash programming operation (see pictured below, in a project called AqCntSVN) 
 +{{:​eclipse:​consoledebugflashing.png|}} 
 +  * The program will halt. Activate "​Resume"​ from the run menu or debug toolbar and the program will run from as if hard reset, that is the bootloader pulsing of the LED will happen followed by execution of the app. 
 +  * You are now debugging and the program will halt on break points, allow single stepping, inspection of variables, etc, etc.   
 + 
 +==== The FreeRTOS StateViewer Plugin ====
eclipse.1342397666.txt.gz · Last modified: 2012/07/16 00:14 by duggle