ARM-USB-OCD

Hi all,

I would like to share my latest discoveries with my Olimex LPC-2378-STK board and my Olimex ARM-USB-OCD. After lots of trying searching and worying I finally seem to get things working correctly. I can debug and do whatever I wish for.

I never achieved this using all open source tools (Eclipse, openocd, gcc, …) and was getting quite desperate. I got JTAG connection with the board but I never succeeded in actually debugging. I always ended up with the first breakpoint being hit and the debugger was always stating : No source found for “”. I didn’t matter if I tried flashing the device with flash magic first.

I registered for an evaluation version of Rowley Crossworks for ARM 1.7. I got connection with my board relatively easy and within (literally) minutes I hit a breakpoint in the example code. I was thrilled!

The joy however was very short. I stepped through the code, everything worked fine. I removed the breakpoint and let the device run when all of a sudden the debugger crashed at some supervisor mode assembly lines (I don’t recall exactly). I didn’t matter what I tried afterwards, I couldn’t load nor debug anymore. I was always getting “Loader verify failed”

I flashed the device with flashmagic and everything went fine again. Untill the same crash happened again.

I continued playing around and trying and read somewhere about a tool call SILL : http://water.cse.unsw.edu.au/esdk/sill.html

I don’t recall where exactly but it must be with SILL or with Flash Magic that I had to power the board using USB and not the power cable from ARM-USB-OCD. I also read about the crossworks “loader verify failed” can be caused because of insufficient power supply.

I took an educated guess and powered the board using USB in stead of through ARM-USB-OCD (I removed also the small power cable between the board and the ARM-USB-OCD), but I kept the ARM-USB-OCD JTAG connected to debug.

Guess what? I now can do whatever I want.

It seems that the ARM-USB-OCD is not capable of delivering enough power long enough. If this is true then I’m quite sure that this was the solution to some other questions on this forum and also other users will have been struggling with this.

I didn’t make an exact measurement. I’m too fed up with trying to start debugging, I now want to play with the board.

Can anybody confirm this or is this just coincidence? Is this also the case with other boards using ARM-USB-OCD?

I hope this posting can be of help for other users.

kind regards,

Jef

I noticed the same thing about that ARMUSBOCD power supply feature, it seemed to always fail during flash programming.

I placed a warning about this in my tutorial “Using Open Surce Tools for AT91SAM Cross Development” over at the Atmel web site.

Seems that Olimex should admit that there’s a problem here and warn its customers.

Cheers,

Jim Lynch

You shouldn’t really be powering the device via the JTAG. It actually works OK for me with all of the boards I use with the Rowley CrossConnect, but I wouldn’t depend on it.

Leon

leon_heller:
You shouldn’t really be powering the device via the JTAG. It actually works OK for me with all of the boards I use with the Rowley CrossConnect, but I wouldn’t depend on it.

Leon

It’s not powered through the JTAG. Actually I haven’t tried that option. That’s the third jumper setting on the board (external supply, USB and JTAG) It was powered through the power supply connector on the ARM-USB-OCD which was then connected to the board and the jumper was set to external supply.

grtz, Jef

Olimex must be using some sort of boost converter in the ARM-USB-OCD. It looks as though it can’t supply enough current.

Leon

It can work or not work depending on how much current the USB port can supply. On my main PC I dont have problems using the LCP-P2148 through the JTAG, on the backup PC it has trouble and looks unstable while flashing.

Of course is not a good idea to attach the JTAG probe on a USB hub without its own power supply, all the devices and the hub itself would get current from the same port.

Well, all my findings are on the same computer, same USB connector, so internally in the PC it’s the same supply. I don’t think this can be an issue. Using the same port I can power the board using pure USB power but not ARM-USB-OCD power connector.

Also, correct me if I’m wrong, but I think each USB port needs to be able to supply high power 500mA or low power 100mA. This doesn’t change depending on the connected device.

Indeed, if using a hub you need to power it or it might go from high to low power. I think that’s also the reason there can only be 5 ports on one hub.

Jef

Jef Patat:
Well, all my findings are on the same computer, same USB connector, so internally in the PC it’s the same supply. I don’t think this can be an issue. Using the same port I can power the board using pure USB power but not ARM-USB-OCD power connector.

Also, correct me if I’m wrong, but I think each USB port needs to be able to supply high power 500mA or low power 100mA. This doesn’t change depending on the connected device.

Indeed, if using a hub you need to power it or it might go from high to low power. I think that’s also the reason there can only be 5 ports on one hub.

Jef

Is it possible that the USB port on your computer is conforming to the USB specifications ( Rev 2 para. 7.2.1 ) which allows only one unit load ( 100 ma) unless a greater amount is specifically requested by the USB slave via software? Perhaps the PC’s that are not having problems powering the ARM-USB-OCD are just automatically providing full power and not complying with the specification? Mine seems to do just that. Does ARM-USB-OCD request the maximum 5 unit loads from the host as it’s input current requirement? Here is a copy of the USB specification paragraph that I am refering to:

QUOTE USB SPEC REV 2.0********

7.2.1 Classes of Devices

The power source and sink requirements of different device classes can be simplified with the introduction of the concept of a unit load. A unit load is defined to be 100 mA. The number of unit loads a device can draw is an absolute maximum, not an average over time. A device may be either low-power at one unit load or highpower, consuming up to five unit loads. All devices default to low-power. The transition to high-power is under software control. It is the responsibility of software to ensure adequate power is available before allowing devices to consume high-power.

This indeed can also be the case. But I think there is no way to get to know this. If the board is powered through USB it is probably getting one unit because there is no software requesting for more.

If Olimex’s ARM-USB-OCD is in need of just a bit more than one unit load to power JTAG and the board and is not requesting more then indeed this might be the cause. But then again it is in the ARM-USB-OCD.

regards, Jef

I quickly add the docs of that device, so all can see how much current their board can maximally consume using only OLIMEX-ARM-USB power supply.

can be used as power supply to your target board with three jumper selectable power supplies: 5V 9V and 12VDC,

USB source current is limited with resetable fuse at 300mA, at the different output voltage the maximum current is

different: 5V/200mA, 9V/100mA, 12V/70mA, note that this also depend on your USB host current capabilities, if other

USB devices are attached to your computer or if the laptop is running on batteries these figures may be different and

depend on your computer USB host

I guess that the device internally asks the USB-port for a full load of 5 working units?

I have an adjustable external power supply adapter 230VAC-DC(3.3-12V).

But when I attach several cables with each having their own ground[/b] - (Thinking of the external power and the JTAG) - will ground of the external power conflict with the ground of the USB (which is ground of my Laptop, which is coming either from battery only, or from the 230VAC - 20VDC transformer)?

tverrbjelke:
I quickly add the docs of that device, so all can see how much current their board can maximally consume using only OLIMEX-ARM-USB power supply.

I guess that the device internally asks the USB-port for a full load of 5 working units?

The USB specification requires that a device request more than the 100ma one unit load via software if it needs more, but there seems to be devices that do not comply with the USB specification, and ARM-USB-OCD may be one of them?

tverrbjelke:
I have an adjustable external power supply adapter 230VAC-DC(3.3-12V).

But when I attach several cables with each having their own ground[/b] - (Thinking of the external power and the JTAG) - will ground of the external power conflict with the ground of the USB (which is ground of my Laptop, which is coming either from battery only, or from the 230VAC - 20VDC transformer)?

An old engineering aquaintence used to be fond of saying “ground is just the other wire”. Ground is ideally exactly zero volts, but currents through the ground connection can cause voltage to develop across the ground circuit resistance. That means that different circuit grounds can be at slightly different voltages with respect to true ground, so “ground loop currents” will develop when the different ground potentials are connected together. That appears as noise to the various circuits connected that way. If the noise is not excessive, then there should be no problem with your setup.

thanks tverrbjelke!

I guess I should have read the documentation more carefully :?

I hope that this post can be of use for other people because this is a nasty thing to find.

thanks all!