Re: [Openocd-development] [PATCH] STM32 flash erase timeout fix

2010-05-03 Thread Øyvind Harboe
Merged.

Thanks!




-- 
Meet Zylin at ESC 2010 San Jose
April 26 - 30. 2010
http://www.zylin.com/events_esc2010.html


Øyvind Harboe
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] [PATCH] STM32 flash erase timeout fix

2010-05-02 Thread Øyvind Harboe
2010/4/30 Tobias Ringström tob...@ringis.se:
 The current timeout for STM32 flash block erase and flash mass erase is
 10 (ms), which is too tight, and fails around 50% of the time for me.
 The data sheet for STM32F107VC specifies a maximum erase time of 40 ms
 (for both operations).

 I'd also consider it a bug that the code does not detect a timeout, but
 just assumes that the operation has completed.  The attached patch does
 not address this bug.

 The attached patch increases the timeouts from 10 to 100 ms.  Please apply.

Sounds sensible to me.

Any objections to merging?




-- 
Meet Zylin at ESC 2010 San Jose
April 26 - 30. 2010
http://www.zylin.com/events_esc2010.html


Øyvind Harboe
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] [PATCH] STM32 flash erase timeout fix

2010-05-02 Thread Tobias Ringström

On 2010-05-02 18:52, Øyvind Harboe wrote:

2010/4/30 Tobias Ringströmtob...@ringis.se:
   

The current timeout for STM32 flash block erase and flash mass erase is
10 (ms), which is too tight, and fails around 50% of the time for me.
The data sheet for STM32F107VC specifies a maximum erase time of 40 ms
(for both operations).

I'd also consider it a bug that the code does not detect a timeout, but
just assumes that the operation has completed.  The attached patch does
not address this bug.

The attached patch increases the timeouts from 10 to 100 ms.  Please apply.
 

Sounds sensible to me.

Any objections to merging?
   


What do you mean?

/Tobias

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


Re: [Openocd-development] [PATCH] STM32 flash erase timeout fix

2010-05-02 Thread Tobias Ringström

On 2010-04-30 14:20, freddie_cho...@op.pl wrote:

Użytkownik Tobias Ringströmtob...@ringis.se  napisał:
   

The current timeout for STM32 flash block erase and flash mass erase is
10 (ms), which is too tight, and fails around 50% of the time for me.
The data sheet for STM32F107VC specifies a maximum erase time of 40 ms
(for both operations).
 

Never happened for me in a few different designs...
   


The delay value of 10 was just at the edge for me as it failed for about 
50% of the blocks. I guess you have a slower JTAG and/or computer. 
Nevertheless, if the specification says it can take 40 ms, openocd 
should certain allow for that much time. It's also only a timeout, so 
increasing it will not have any effect on performance.


Also note that erase didn't complain at all. It was flash write_image 
that complained later on that not all blocks were erased.


/Tobias

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


Re: [Openocd-development] [PATCH] STM32 flash erase timeout fix

2010-05-02 Thread Øyvind Harboe
 Any objections to merging?


 What do you mean?

It was a call for comments from others on the list.

I thought you made a convincing argument and if I don't hear anything
real soon, I'll merge the patch.


-- 
Meet Zylin at ESC 2010 San Jose
April 26 - 30. 2010
http://www.zylin.com/events_esc2010.html


Øyvind Harboe
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] [PATCH] STM32 flash erase timeout fix

2010-04-30 Thread Tobias Ringström
The current timeout for STM32 flash block erase and flash mass erase is
10 (ms), which is too tight, and fails around 50% of the time for me.
The data sheet for STM32F107VC specifies a maximum erase time of 40 ms
(for both operations).

I'd also consider it a bug that the code does not detect a timeout, but
just assumes that the operation has completed.  The attached patch does
not address this bug.

The attached patch increases the timeouts from 10 to 100 ms.  Please apply.

/Tobias
diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c
index 818c474..0fdd148 100644
--- a/src/flash/nor/stm32x.c
+++ b/src/flash/nor/stm32x.c
@@ -331,7 +331,7 @@ static int stm32x_erase(struct flash_bank *bank, int first, 
int last)
target_write_u32(target, STM32_FLASH_AR, bank-base + 
bank-sectors[i].offset);
target_write_u32(target, STM32_FLASH_CR, FLASH_PER | 
FLASH_STRT);
 
-   status = stm32x_wait_status_busy(bank, 10);
+   status = stm32x_wait_status_busy(bank, 100);
 
if (status  FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
@@ -1183,7 +1183,7 @@ static int stm32x_mass_erase(struct flash_bank *bank)
target_write_u32(target, STM32_FLASH_CR, FLASH_MER);
target_write_u32(target, STM32_FLASH_CR, FLASH_MER | FLASH_STRT);
 
-   status = stm32x_wait_status_busy(bank, 10);
+   status = stm32x_wait_status_busy(bank, 100);
 
target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);
 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [PATCH] STM32 flash erase timeout fix

2010-04-30 Thread freddie_chopin
Użytkownik Tobias Ringström tob...@ringis.se napisał:
The current timeout for STM32 flash block erase and flash mass erase is
10 (ms), which is too tight, and fails around 50% of the time for me.
The data sheet for STM32F107VC specifies a maximum erase time of 40 ms
(for both operations).

Never happened for me in a few different designs...

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