EclipseArmebs4/FirstSteps

From UIT
Revision as of 07:57, 22 September 2014 by Pim (Talk | contribs)
Jump to: navigation, search

Contents

If you're here, you should have already followed the setup (for windows/for linux). Please have a look at the troubleshooting page before asking for help.

Before the first project

Eclipse is somewhat complicated to configure, so there is a preconfigured workspace in your setup, probably in C:\Programs\ARMEBS4\___VERSION___\tools\default_workspace_to_be_copied.

  • Copy the default_workspace_to_be_copied to a convenient place, for instance your desktop.
  • Run Eclipse (Programs/Eclipse for ARMEBS4)
  • Import the libheivs_stm32 library
    • Right-click in the "Project explorer" -> import... > Project from SVN > Importlib 1.pngImportlib 2.png
    • > Next
      • Browse... > select armebs4/trunk/libheivs_stm32 > OK Importlib 4.png
      • Finish
      • Finish Importlib 5.png

The leds project

  • Import the leds project
    • Right-click in the "Project explorer" -> import... > Project from SVN >
    • Use existing repository (armebs4) > Next Importleds 1.png
      • Browse... > select armebs4/trunk/demos/leds > OK Importleds 2.png
      • Finish > Finish Importleds 3.png
  • Build the code (ctrl-B)
  • Run it
    • Run > Debug configuration ... select "GDB OpenOCD Debugging"/leds > Debug
    • The program will be programmed in flash, this can take some time
    • If eclipse ask for switching to the debug perspective > OK
  • The program is now stopped at the beginning of main, start it with "run > resume" or the corresponding button.
    • The 4 red leds should blink
  • Add a breakpoint by double-clicking in the left (blue) margin, at the "counter++" line.
    • The program is stopped.

Debugger buttons

Eclipse debug buttons.png

Optimisation and debugging

The variable window will show you some unexpected result :


Debug optimized.png


This is caused by the optimization. To disable optimization, go to the project manager (perhaps in the c/c++ view), right-click on the project > properties > c/c++ build > settings > optimisation and set optimization to 0.


Disable opt.png

Re-debug the software, now the variables should be shown :

Debug no opt.png

The stdio project

Now that you're familiarized with the Eclipse IDE, let's have a look at the stdio project. The stdio are routed through the USB, here is a view of the device manager, with the "Device by connection" view :


Usb com.png

The port on which the stdio are redirected is the first serial port of the ARMEBS4 board. On the image shown this is the ARMEBS4 stdio is connected to COM4.

This port number will be used in Eclipse when connecting the console. To show the console in eclipse, window > show view > others > Terminal/terminal. It should be configured for using the right COM port (in my case COM4), with 115200 bauds, 8 data bits, 1 Stop bit, no parity bit and no flow control.

Import the stdio project, run it and watch for the console (the stdio project is near the leds project, you can use the same procedure as described in the leds project.

Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox