EmbDev.net

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


Author: Tony (Guest)
Posted on:

Rate this post
0 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...

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

Author: Tony (Guest)
Posted on:

Rate this post
0 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

Author: Dominic R. (dominic)
Posted on:

Rate this post
0 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

Author: Tony (Guest)
Posted on:

Rate this post
0 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

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 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...

Hope this helps
Martin Thomas

Author: Tony (Guest)
Posted on:

Rate this post
0 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...
>
> 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.