SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By fll-freak
#144340
Forum members,

I am an embedded engineer with 30 years of experience. Five of those with ARM processors like the LPC2468 using the IAR IDE and J-Link pods. I am currently putting together a bid for the 2013 AVC competition (there will be one right???). My entry uses some technology that is way above the ability of a simple Arduino. I am looking to use one or more ARM processors for the design, but I simply can't afford the costs of the professional tools like IAR.

Surfing the web over the last few months, I came across the OPENOCD/GNU tool chain for ARM processors. I have spend many hours trying to figure this all out and what I should be purchasing. At the start of today I had a plan and after spending hours on the computer trying to download and install tools, I now am even more confused.

My plan was as follows:
-Install the GNU tool chain and using borrowed work assets (LPC2468 dev board and J-LINK pods) test the tool chain.
-Once this was proven, purchase an Olimex SAM3-H256 based on the ATSAM3S4BA processor as well as the Olimex ARM-USB-OCD-H pod.

This two stage plan prevented me from expending my own funds till such time as I had a proven test suite!

So the first problem came when reading some of the install tutorials, I had to decide to install the GDB server to support J-LINK. Order seemed very important. Instructions were contradictory and confusing. I realize that this has a steep learning curve and I am willing to do my own homework, but a little guidance would be most welcome.

Questions:
- If I install GDB Server for J-LINK support, can I switch to ARM-USB-OCD later without too much pain?
- Can I switch from ARM7 to M3 with the same tool chain?
- Is YAGARTO the way to go? Various documents have rather different install procedures.
- What is the current best document/approach to take to get an ARM GNU cross compiler up and running?

Hope to see you in 2013 in Boulder Colorado!
By prpplague
#144547
greetings,

it seems you have a couple of different questions. generally speaking getting a tool chain is very easy. that is separate from the OpenOCD. OpenOCD can easily switch between using the J-Link and the ARM-USB-OCD dongle with a simple change of configuration file. the rest of your questions about cross compiling are more generic ARM questions and are independent of the OpenOCD aspect.

if you need specific help with OpenOCD, feel free to check out the elinux.org wiki pages:

http://elinux.org/OpenOCD

or post on the user support mailing list for OpenOCD:

http://openocd.sourceforge.net/discussi ... ing-lists/

thanks
Dave
By nickma
#148851
Hi,
any further progresses?

I'm working with the same hardware setup and are a little bit further:
+) gcc up and runing
+) gnu make also up and running
+) openocd up an running
Programming works so-so (with plugging on-off... and so on)
BUT:
-) led won't light up

co-op?
Best, Nick
By samus8zero2x
#150183
I just got a setup running using Eclipse Juno + CDT, CodeSourcery GCC compiler, and Olimex ARM-USB-OCD-H.

There are so many old/varying how-tos on this it is easy to see how it can be hard. It took me a few hours to figure it out as well.

To install Olimex drivers (at least for Olimex):
1) Go to Olimex Website and download latest drivers: https://www.olimex.com/Products/ARM/JTA ... e_v1.1.zip
2) Unpack the package somewhere on your PC (you will only use the drivers if using the below instructions)
3) Plug in your ARM-USB-OCD-H
4) After windows fails at installing drivers, follow the Olimex instructions. Generally, install the libusb version for the first device in device manager (CDM driver for JTAG) and use the FTDI driver for the second driver (FTDI driver for Serial Port).

If you are using Windows/Eclipse, these steps should pretty much work to get the IDE up and running:
1) Install CodeSourcery ARM compiler (Yagarto or Cygwin should work, but I have been using CodeSourcery for a while and am familiar with its layout). This will require web registration. And be sure to add it to your PATH (check box in installer).
2) Download and unpack Eclipse Juno for C/C++ Developers (I used 32-bit).
3) Go to Freddie Chopin's site and download your favorite flavor of OpenOCD (I'm using 0.6.0 currently, I recommend to use 32-bit for everything, by the way): http://www.freddiechopin.info/en/downlo ... /4-openocd.
4) unpack the zip file wherever you want (I unpacked inside the eclipse folder)
5) While at that web site, find some source code examples. I think there are some for LPC as well as STM32 targets. These examples come with debug/run configurations preset for OpenOCD 0.5.0.
6) After installing Eclipse, open it up and click Help->Install new software. Click the "Available Software Sites" link in blue to open the default site list. Click the "CDT" entry and then click edit. You need to edit the URL to the following: http://download.eclipse.org/tools/cdt/releases/juno. Then click OK.
7) In the "Work With" field back at the install page, type CDT and the URL you just edited should pop up. Double-click the entry to select it. Eclipse should now populate the list of software.
8) Check to include CDT and it's support tools (you don't need all the support tools if you want to be choosy, but be sure to install GDB Hardware Debugging).
9) Click Finish and proceed to install the CDT plugin.
10) Now, import one of the example projects to your workspace (unpack, then choose File->Import, then General->Existing Projects..., and follow instructions).
11) Now view the debug and run configurations to see how the examples are setup. You can tweak the parameters for OpenOCD for various debug adapters and targets.
12) If you want, you can test that OpenOCD detects your JTAG dongle and target using the command line initially to be sure you have the parameters right.

I did this yesterday for STM32F and ARM-USB-OCD-H and got it working, but it takes a while to get used to where to find everything in Eclipse (debugging configuration seems a bit cluttered...too many options!).

Hope this helps somehow :)
By samus8zero2x
#150190
OK, I did the above at work, but for some reason I cannot make this work on my home PC.

So when installing the CDT Hardware Debugging plugin, instead of what I had in steps 6-8, you can instead use the generic Juno repository (already in the available site list) and search for "hardware". The plugin you need is available this way as well and works fine on my home PC.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]