EmbDev.net

Forum: ARM programming with GCC/GNU tools programming with OpenOCD


von Tony (Guest)


Rate this post
useful
not useful
Hi,

I made a board for AT91SAM7S64. I'm trying to flash this chip with this
example project:

http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html

I just changed the start code. DIV = 1, MUL = 8 since I'm using 8MHz
crystal.

OCD says:

"Programming with OPENOCD
C:\WinARM\utils\OpenOCD\openocd.exe -d2 -f oocd_flash_sam7_wig.cfg
Info:    openocd.c:73 main(): Open On-Chip Debugger (Revision 65)"

I have no response from this ARM so far but it seems that JTAG is at
least working.

Is there any better documents how to flash trough JTAG? Then I would at
least know that flashing works right? Somehow OpenOCD is too messy for
the first time...

Br. Tony

von Tony (Guest)


Rate this post
useful
not useful
It took me couple of days to really find out how OpenOCD works. :)

When I'm trying to flash I'm getting this response:

sleep 500
poll
target state: running
flash probe 0
unknown error when probing flash bank '#0' at 0x00000000
flash write 0 main.bin 0x0
failed writing file main.bin to flash bank 0 at offset 0x00000000
can't work with this flash while target is running
reset run
sleep 500

Also command prompt says:

Warning: at91sam7.c:681 at91sam7s_probe(): Cannot identify target as an
AT91SAM

Any idea what this might be?? I have been double checking everything.
Also did flash erase using ERASE pin. Maybe adding serial termination
resistor to TDO output? Signals looks good on oscilloscope.

Should I just trow my board to garbage and build a new one? :)

-Tony

von Dominic R. (dominic)


Rate this post
useful
not useful
First of all you should upgrade to a newer version of the OpenOCD. You
can find precompiled binaries of a recent version at www.yagarto.de
(thanks to Michael Fischer - he's doing an incredible job providing you
these things).

Before accessing the flash, you have to halt the target:
halt
<target should enter debug state>
flash probe 0
<you can only work with the flash if this completes>
...
...

Regards,

Dominic

von Tony (Guest)


Rate this post
useful
not useful
Dominic Rath wrote:
> First of all you should upgrade to a newer version of the OpenOCD. You
> can find precompiled binaries of a recent version at www.yagarto.de
> (thanks to Michael Fischer - he's doing an incredible job providing you
> these things).
>
> Before accessing the flash, you have to halt the target:
> halt
> <target should enter debug state>
> flash probe 0
> <you can only work with the flash if this completes>
> ...
> ...
>
> Regards,
>
> Dominic

Hi Dominic,

How big part reset is playing on halt mode? Maybe It's not resetting as
good as it should? I'm still trying to stay optimistic that may IC is
not burned. :)

halt
requesting target halt...
halt
requesting target halt...
halt
requesting target halt...
flash probe 0
flash 'lpc2000' found at 0x00000000
flash write 0 main.bin 0x0
failed writing file main.bin to flash bank 0 at offset 0x00000000
can't work with this flash while target is running
reset run
sleep 500

Br. Tony

von Martin Thomas (Guest)


Rate this post
useful
not useful
Tony:

In your first message you wrote:
> [...] I made a board for AT91SAM7S64. [...]

In the previous message you pasted the output:
> [...]
> flash 'lpc2000' found at 0x00000000
> [...]

It seems that you have some mismatch in your configuration. Check your
OpenOCD config file. Yes, that target has to be in "halt"-state to init
flahsing. I expect there is also a mistake in the setup for reset in
your config-file.

BTW: I have updated the "Write Flash with OpenOCD"-page
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html

Hope this helps
Martin Thomas

von Tony (Guest)


Rate this post
useful
not useful
Martin Thomas wrote:
> Tony:
>
> In your first message you wrote:
>> [...] I made a board for AT91SAM7S64. [...]
>
> In the previous message you pasted the output:
>> [...]
>> flash 'lpc2000' found at 0x00000000
>> [...]
>
> It seems that you have some mismatch in your configuration. Check your
> OpenOCD config file. Yes, that target has to be in "halt"-state to init
> flahsing. I expect there is also a mistake in the setup for reset in
> your config-file.
>
> BTW: I have updated the "Write Flash with OpenOCD"-page
> 
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html
>
> Hope this helps
> Martin Thomas

Hi Thomas,

In this case I tested flashing with cfg file that came with OOCD
(arm7_wig.cfg). I have also tested file that came with your example. Now
I now that something is wrong with my hardware. Not sure yet if It's my
wigler clone or my board. I will work on it later.

Thanks,

Tony

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.