-
Notifications
You must be signed in to change notification settings - Fork 21
JorgeAparicio edited this page Sep 15, 2012
·
6 revisions
(Check my blog post for a detailed version about the installation and usage.)
Clone this repository, and import the project to Eclipse.
- Go to Project>Properties.
- Select C/C++ Build. Click the "Manage Configurations" button to the right of the Configurations combo box.
- Select the Linux or Windows configuration and click "set active".
The Windows assumes the "make" utility is named "make", but in case your "make" utility is named otherwise, follow these steps.
- Go to Project>Properties.
- C/C++ Build
- On the "Builder Settings", type on the "Build command" text box the name of your "make" utility (e.g. mingw32-make).
- Go to Project>Properties.
- Select C/C++ Build>Settings.
- Under the Tool Settings tab, click on Target Processor.
- Configure the processor, endianess, float ABI and FPU type combo boxes properly, for FPU-less uC select "Toolchain default" on the Float ABI combo box, otherwise select "FP instructions" on the Float ABI combo box.
- Go to Project>Properties.
- Select C/C++ Build>Settings.
- Under the Tool Settings tab, click on the GCC C++ Linker>General.
- On the Script file(-T) text file, type the following text:
../linker/**.ld
- Replace the ** for a proper target device.
- Check the linker folder for a list of all the supported devices.
- Go to Run>External Tools>External Tools Configurations.
- Select Program>OpenOCD.
- Under the Main tab, and in the Location text box, type the following text:
path/to/openOCD/bin/openocd
- Go to Run>External Tools>External Tools Configurations.
- Select Program>OpenOCD.
- Under the Main tab, and in the Arguments text box, write the following text.
-f openocd/interface/**.cfg -f openocd/target/***.cfg
- Replace ** and *** for a proper interface (JTAG dongle) and a proper target device, respectively.
- Check the openocd/interface and openocd/target folders for a list of supported interfaces and devices.
- Go to Run>Debug Configurations.
- Select Zylin Embedded debug(native)>Flash and Debug.
- Under the Debugger tab, on the GDB command file write the following text.
gdb/**.script
- Replace ** for a proper target device.
- Check the gdb folder for a list of supported devices.
- Code up your application.
- Hit the build button (Icon: hammer).
- Click on the project name "bareCortexM" in the Project Explorer.
- Call openOCD as external tool. (Icon: play symbol with a small toolbox)
- You should see some red letters in the console saying something like this:
Info : JTAG tap: xyz.cpu tap/device found: 0x12345678 (mfg: 0x123, part: 0x1234, ver: 0x1) Info : JTAG tap: xyz.bs tap/device found: 0x12345678 (mfg: 0x123, part: 0x1234, ver: 0x1) Info : xyz.cpu: hardware has m breakpoints, n watchpoints
- Now start a gdb session using the debug>Flash and Debug. (Icon: bug)
- It might take a while to program the device.
- You should be taken to the debug perspective.
- Hit the play button (or hit the F5 key) and you should end in the resetHandler function or the main function.
- Debug your device.
- Repeat the process until you are satisfied.