Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-05 Thread Antonio Borneo
On Sun, Dec 5, 2010 at 6:42 PM, Starkeeper  wrote:
> Just to let you know, I still have the problem, that I can not program the
> external flash ;)
>
> I am wondering that most of the other non cfi flash drivers require the
> correct clock rate as parameter. How does the cfi driver computes the
> timings without knowledge of the current clock?

As far as I know, CFI driver issues commands to flash and waits the
flash itself replies that the command is completed.
There isn't any clock nor specific time tick.
Only concept of time is for timeout; if flash does not reply after a
specific timeout, the operation is aborted.

Best Regards
Antonio
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-05 Thread Starkeeper
Just to let you know, I still have the problem, that I can not program the
external flash ;)

I am wondering that most of the other non cfi flash drivers require the
correct clock rate as parameter. How does the cfi driver computes the
timings without knowledge of the current clock?


-Ursprüngliche Nachricht-
Von: openocd-development-boun...@lists.berlios.de
[mailto:openocd-development-boun...@lists.berlios.de] Im Auftrag von Michael
Schwingen
Gesendet: Donnerstag, 2. Dezember 2010 00:20
An: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

On 11/30/2010 08:36 PM, Starkeeper wrote:
> Indeed it works without the wokring area!
OK. That means at least the flash is working, and the bus setup is probably
also OK.

OpenOCD tried to download code + data to RAM on the target, and something in
that process goes wrong. I don't know the LPC internals, so I can't check if
the memory setup really enables working RAM at 0x4000.

cu
Michael

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-02 Thread Starkeeper
Ok, the RAM seems to work correct. With the mww and mdw command I am able to
write the RAM and to read back the written values.
 

-Ursprüngliche Nachricht-
Von: Øyvind Harboe [mailto:oyvind.har...@zylin.com] 
Gesendet: Donnerstag, 2. Dezember 2010 18:52
An: starkee...@gmx.at
Cc: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

On Thu, Dec 2, 2010 at 6:21 PM, Starkeeper  wrote:
> How can I test if the working area is correct?
> The memorymap of my controller tells me that at address 0x4000  is 
> a 64KB RAM.

mww + mdw?

--
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-02 Thread Øyvind Harboe
On Thu, Dec 2, 2010 at 6:21 PM, Starkeeper  wrote:
> How can I test if the working area is correct?
> The memorymap of my controller tells me that at address 0x4000  is a
> 64KB RAM.

mww + mdw?

-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-02 Thread Starkeeper
How can I test if the working area is correct?
The memorymap of my controller tells me that at address 0x4000  is a
64KB RAM.

-Ursprüngliche Nachricht-
Von: openocd-development-boun...@lists.berlios.de
[mailto:openocd-development-boun...@lists.berlios.de] Im Auftrag von Michael
Schwingen
Gesendet: Donnerstag, 2. Dezember 2010 00:20
An: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

On 11/30/2010 08:36 PM, Starkeeper wrote:
> Indeed it works without the wokring area!
OK. That means at least the flash is working, and the bus setup is probably
also OK.

OpenOCD tried to download code + data to RAM on the target, and something in
that process goes wrong. I don't know the LPC internals, so I can't check if
the memory setup really enables working RAM at 0x4000.

cu
Michael

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-01 Thread Michael Schwingen
On 11/30/2010 08:36 PM, Starkeeper wrote:
> Indeed it works without the wokring area!
OK. That means at least the flash is working, and the bus setup is
probably also OK.

OpenOCD tried to download code + data to RAM on the target, and
something in that process goes wrong. I don't know the LPC internals, so
I can't check if the memory setup really enables working RAM at 0x4000.

cu
Michael

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-01 Thread Starkeeper
The load command produces the same error for the external flash region.. I
see no difference in the flash commands and the load command.

-Ursprüngliche Nachricht-
Von: Øyvind Harboe [mailto:oyvind.har...@zylin.com] 
Gesendet: Mittwoch, 1. Dezember 2010 09:02
An: Star Keeper
Cc: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

On Wed, Dec 1, 2010 at 8:58 AM, Star Keeper  wrote:
> The image I want to flash is not my program code. It is a resource file
with image data.
> As i understand, the "load" command normally loads a program into RAM 
>and does not program a flash. Is that right, or should the load command 
>notice that the target address is in Flash and start the flash programming?

That's right. "load" will look at the configuration and if the memory range
is flash, then the flash is erased and programmed.

--
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-12-01 Thread Øyvind Harboe
On Wed, Dec 1, 2010 at 8:58 AM, Star Keeper  wrote:
> The image I want to flash is not my program code. It is a resource file with 
> image data.
> As i understand, the "load" command normally loads a program into RAM and
>does not program a flash. Is that right, or should the load command notice that
>the target address is in Flash and start the flash programming?

That's right. "load" will look at the configuration and if the memory range is
flash, then the flash is erased and programmed.

-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Star Keeper
The image I want to flash is not my program code. It is a resource file with 
image data.
As i understand, the "load" command normally loads a program into RAM and does 
not program a flash. Is that right, or should the load command notice that the 
target address is in Flash and start the flash programming?

 Original-Nachricht 
> Datum: Wed, 1 Dec 2010 08:43:28 +0100
> Von: "Øyvind Harboe" 
> An: starkee...@gmx.at
> CC: openocd-development@lists.berlios.de
> Betreff: Re: [Openocd-development] Programming external flash with OpenOCD 
> fails

> Normally you should be able to connect and flash by:
> 
> target remote localhost:
> monitor reset init
> load
> stepi
> 
> 
> 
> -- 
> Øyvind Harboe
> 
> Can Zylin Consulting help on your project?
> 
> US toll free 1-866-980-3434 / International +47 51 63 25 00
> 
> http://www.zylin.com/zy1000.html
> ARM7 ARM9 ARM11 XScale Cortex
> JTAG debugger and flash programmer

-- 
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Øyvind Harboe
Normally you should be able to connect and flash by:

target remote localhost:
monitor reset init
load
stepi



-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Starkeeper
Well here are my configuration files..

openocd.exe -f ./OpenOCD-0.5.0/oocdlink.cfg -f
./OpenOCD-0.5.0/lpc2478-ExtFlash.cfg
arm-none-eabi-gdb -x GDB-ExternFlash.gdb

-Ursprüngliche Nachricht-
Von: Øyvind Harboe [mailto:oyvind.har...@zylin.com] 
Gesendet: Dienstag, 30. November 2010 21:56
An: starkee...@gmx.at
Cc: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

Did you try "reset init" and then flash programming?

Perhaps there is some memory parameters that have to be set up.

You did not provide a complete configuration file...

--
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer


oocdlink.cfg
Description: Binary data


lpc2478-ExtFlash.cfg
Description: Binary data


GDB-ExternFlash.gdb
Description: Binary data
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Øyvind Harboe
Did you try "reset init" and then flash programming?

Perhaps there is some memory parameters that have to be
set up.

You did not provide a complete configuration file...

-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Starkeeper
Indeed it works without the wokring area!
Here is the log file:

Open On-Chip Debugger 0.5.0-dev-00622-g9a04974 (2010-11-30-17:39)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
5 kHz
adapter_nsrst_delay: 300
jtag_ntrst_delay: 300
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
RCLK - adaptive
Info : device: 4 "2232C"
Info : deviceID: 67353336
Info : SerialNumber: FTR5CYBEA
Info : Description: OOCDLink A
Info : RCLK (adaptive clock speed) not supported - fallback to 500 kHz
Info : JTAG tap: lpc2478.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part:
0xf1f0, ver: 0x4)
Info : Embedded ICE version 7
Error: EmbeddedICE v7 handling might be broken
Info : lpc2478.cpu: hardware has 2 breakpoint/watchpoint units
Info : accepting 'gdb' connection from 
Info : Flash Manufacturer/Device: 0x0001 0x227e
Warn : acknowledgment received, but no packet pending
Info : JTAG tap: lpc2478.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part:
0xf1f0, ver: 0x4)
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after
reset.
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x80d3 pc: 0x5230
core state: ARM
Warn : NOTE! DCC downloads have not been enabled, defaulting to slow memory
writes. Type 'help dcc'.
Warn : NOTE! Severe performance degradation without working memory enabled.
Warn : NOTE! Severe performance degradation without fast memory access
enabled. Type 'help fast'.
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x80d3 pc: 0x
Info : Flash Manufacturer/Device: 0x0001 0x227e
flash 'cfi' found at 0x8000
auto erase enabled
Error: No working memory available. Specify -work-area-phys to target.
Warn : not enough working area available(requested 96)
Info : Programming at 8000, count 0008 bytes remaining
Info : Programming at 8100, count 0007ff00 bytes remaining
Info : Programming at 8200, count 0007fe00 bytes remaining
Info : Programming at 8300, count 0007fd00 bytes remaining
...
...
Info : Programming at 8007fc00, count 0400 bytes remaining
Info : Programming at 8007fd00, count 0300 bytes remaining
Info : Programming at 8007fe00, count 0200 bytes remaining
Info : Programming at 8007ff00, count 0100 bytes remaining
wrote 524288 bytes from file ./bin/Debug/WePi-Res.hex in 1276.454102s (0.401
KiB/s)


It takes some time but it works!
This was the work area I had defined previously:
$_TARGETNAME configure -work-area-phys 0x4000 -work-area-size 0x1
-work-area-backup 0


-Ursprüngliche Nachricht-
Von: openocd-development-boun...@lists.berlios.de
[mailto:openocd-development-boun...@lists.berlios.de] Im Auftrag von Michael
Schwingen
Gesendet: Dienstag, 30. November 2010 20:01
An: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

On 11/30/2010 07:06 PM, Starkeeper wrote:
> Hi there,
> I have an external flash (Spansion S29GL128N90) connected to a NXP 
> LPC2478 microcontroller. Everytime when I try to flash this external 
> flash I get the following error from OpenOCD (Version 0.4.0 and self
compiled 0.5.0):
>
> Flash Manufacturer/Device: 0x0001 0x227e error writing to flash at 
> address 0x8000 at offset 0x (-902) Command handler 
> execution failed in procedure 'flash' called at file "command.c", line 
> 650 called at file "command.c", line 361
>
> Command used:
> monitor flash write_image erase ./bin/Debug/We-Res.hex 0x00 ihex
>
>
> The flash is connected to the EMI and seems to works fine. OpenOCD is 
> able to erase the flash and I am able to read the data, that I have 
> written previously with the following commands:
> monitor flash erase_sector 1 0 10
> monitor flash fillw 0x8000 0x12345678 0x1000
Could you try what happens if you disable the work-area in the CPU config?

If it works, it will be dead slow, but we might get more diagnostics if the
offending code runs on the PC instead of the target. If it fails, too,
please provide a log of the failing operation that shows the bus cycles.

BTW: you *did* set up the work area to point to an area where you have
working memory?

cu
Michael

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Michael Schwingen
On 11/30/2010 07:06 PM, Starkeeper wrote:
> Hi there,
> I have an external flash (Spansion S29GL128N90) connected to a NXP LPC2478
> microcontroller. Everytime when I try to flash this external flash I get the
> following error from OpenOCD (Version 0.4.0 and self compiled 0.5.0):
>
> Flash Manufacturer/Device: 0x0001 0x227e
> error writing to flash at address 0x8000 at offset 0x (-902)
> Command handler execution failed in procedure 'flash' called at file
> "command.c", line 650 called at file "command.c", line 361
>
> Command used:
> monitor flash write_image erase ./bin/Debug/We-Res.hex 0x00 ihex
>
>
> The flash is connected to the EMI and seems to works fine. OpenOCD is able
> to erase the flash and I am able to read the data, that I have written
> previously with the following commands:
> monitor flash erase_sector 1 0 10
> monitor flash fillw 0x8000 0x12345678 0x1000
Could you try what happens if you disable the work-area in the CPU config?

If it works, it will be dead slow, but we might get more diagnostics if
the offending code runs on the PC instead of the target. If it fails,
too, please provide a log of the failing operation that shows the bus
cycles.

BTW: you *did* set up the work area to point to an area where you have
working memory?

cu
Michael

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Starkeeper
Sure I can provide a log. Here it is, or do you need a logfile with debug
option enabled?


Open On-Chip Debugger 0.5.0-dev-00622-g9a04974 (2010-11-30-17:39)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
5 kHz
adapter_nsrst_delay: 300
jtag_ntrst_delay: 300
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
RCLK - adaptive
Info : device: 4 "2232C"
Info : deviceID: 67353336
Info : SerialNumber: FTR5CYBEA
Info : Description: OOCDLink A
Info : RCLK (adaptive clock speed) not supported - fallback to 500 kHz
Info : JTAG tap: lpc2478.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part:
0xf1f0, ver: 0x4)
Info : Embedded ICE version 7
Error: EmbeddedICE v7 handling might be broken
Info : lpc2478.cpu: hardware has 2 breakpoint/watchpoint units
Info : accepting 'gdb' connection from 
Info : Flash Manufacturer/Device: 0x0001 0x227e
Warn : acknowledgment received, but no packet pending
Info : JTAG tap: lpc2478.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part:
0xf1f0, ver: 0x4)
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after
reset.
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x80d3 pc: 0x5238
core state: ARM
Warn : NOTE! DCC downloads have not been enabled, defaulting to slow memory
writes. Type 'help dcc'.
Warn : NOTE! Severe performance degradation without fast memory access
enabled. Type 'help fast'.
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x80d3 pc: 0x
Info : Flash Manufacturer/Device: 0x0001 0x227e
flash 'cfi' found at 0x8000
auto erase enabled
Error: flash write block failed status: 0x0
Error: error writing to flash at address 0x8000 at offset 0x
(-902)
Command handler execution failed
in procedure 'flash'


-Ursprüngliche Nachricht-
Von: Øyvind Harboe [mailto:oyvind.har...@zylin.com] 
Gesendet: Dienstag, 30. November 2010 19:10
An: starkee...@gmx.at
Cc: openocd-development@lists.berlios.de
Betreff: Re: [Openocd-development] Programming external flash with OpenOCD
fails

Could you provide a log?


--
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Øyvind Harboe
Could you provide a log?


-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] Programming external flash with OpenOCD fails

2010-11-30 Thread Starkeeper
Hi there,
I have an external flash (Spansion S29GL128N90) connected to a NXP LPC2478
microcontroller. Everytime when I try to flash this external flash I get the
following error from OpenOCD (Version 0.4.0 and self compiled 0.5.0):

Flash Manufacturer/Device: 0x0001 0x227e
error writing to flash at address 0x8000 at offset 0x (-902)
Command handler execution failed in procedure 'flash' called at file
"command.c", line 650 called at file "command.c", line 361

Command used:
monitor flash write_image erase ./bin/Debug/We-Res.hex 0x00 ihex


The flash is connected to the EMI and seems to works fine. OpenOCD is able
to erase the flash and I am able to read the data, that I have written
previously with the following commands:
monitor flash erase_sector 1 0 10
monitor flash fillw 0x8000 0x12345678 0x1000

This is the flash configuration that I have added to the original OpenOCD
LP2478 config file:
Code:
flash bank $_FLASHNAME2 cfi 0x8000 0x100 2 2 $_TARGETNAME


So what is wrong with the write_image command?

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development