Hi Andreas,
Thanks for your suggestions, we have good news and bad news. As you
expected the real issue is in the sector erase at the boundary of the first
12 sectors (1024K total). Sorry for lengthy email, but i wanted to properly
document the findings as my contribution as a user, so everyone will be
able to do these steps for debugging purposes.
Cheers.
The good news:
******************** Session 2 **************************
* Using "stm32f2x mass_erase 0" worked fine and
* loading the .elf file >1MB also run OK. All is happy
***********************************************************
> stm32f2x mass_erase 0
stm32x mass erase complete
> flash erase_check 0
successfully checked erase state
# 0: 0x00000000 (0x4000 16kB) erased
# 1: 0x00004000 (0x4000 16kB) erased
# 2: 0x00008000 (0x4000 16kB) erased
# 3: 0x0000c000 (0x4000 16kB) erased
# 4: 0x00010000 (0x10000 64kB) erased
# 5: 0x00020000 (0x20000 128kB) erased
# 6: 0x00040000 (0x20000 128kB) erased
# 7: 0x00060000 (0x20000 128kB) erased
# 8: 0x00080000 (0x20000 128kB) erased
# 9: 0x000a0000 (0x20000 128kB) erased
# 10: 0x000c0000 (0x20000 128kB) erased
# 11: 0x000e0000 (0x20000 128kB) erased
# 12: 0x00100000 (0x4000 16kB) erased
# 13: 0x00104000 (0x4000 16kB) erased
# 14: 0x00108000 (0x4000 16kB) erased
# 15: 0x0010c000 (0x4000 16kB) erased
# 16: 0x00110000 (0x10000 64kB) erased
# 17: 0x00120000 (0x20000 128kB) erased
# 18: 0x00140000 (0x20000 128kB) erased
# 19: 0x00160000 (0x20000 128kB) erased
# 20: 0x00180000 (0x20000 128kB) erased
# 21: 0x001a0000 (0x20000 128kB) erased
# 22: 0x001c0000 (0x20000 128kB) erased
# 23: 0x001e0000 (0x20000 128kB) erased
> flash write_image test.elf
wrote 1168136 bytes from file test.elf in 29.132666s (39.157 KiB/s)
> verify_image test.elf
verified 1168136 bytes in 8.734500s (130.604 KiB/s)
> reset run
>
********************************************************
The BAD News :
******************** Session 1 **************************
* Using sectors batch erase, notice it breaks at sector 12
* which is the boundary of 1024K (check sector info below)
***********************************************************
> reset halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08001b10 msp: 0x20030000
> flash erase_sector 0 0 16
stm32x device protected
failed erasing sectors 0 to 16
> flash erase_sector 0 0 1
erased sectors 0 through 1 on flash bank 0 in 0.794046s
> flash erase_sector 0 0 2
erased sectors 0 through 2 on flash bank 0 in 1.224070s
> flash erase_sector 0 0 3
erased sectors 0 through 3 on flash bank 0 in 1.614093s
> flash erase_sector 0 0 4
erased sectors 0 through 4 on flash bank 0 in 2.710155s
> flash erase_sector 0 0 5
erased sectors 0 through 5 on flash bank 0 in 4.760272s
> flash erase_sector 0 0 6
erased sectors 0 through 6 on flash bank 0 in 6.815390s
> flash erase_sector 0 0 7
erased sectors 0 through 7 on flash bank 0 in 8.854506s
> flash erase_sector 0 0 8
erased sectors 0 through 8 on flash bank 0 in 10.850620s
> flash erase_sector 0 0 9
erased sectors 0 through 9 on flash bank 0 in 13.038746s
> flash erase_sector 0 0 10
erased sectors 0 through 10 on flash bank 0 in 15.055861s
> flash erase_sector 0 0 11
erased sectors 0 through 11 on flash bank 0 in 17.206984s
> flash erase_sector 0 0 12
stm32x device protected
failed erasing sectors 0 to 12
> flash erase_sector 0 0 13
stm32x device protected
failed erasing sectors 0 to 13
> flash erase_sector 0 0 14
stm32x device protected
failed erasing sectors 0 to 14
> flash erase_sector 0 0 15
stm32x device protected
failed erasing sectors 0 to 15
> flash erase_sector 0 0 16
stm32x device protected
failed erasing sectors 0 to 16
>
************************************************************************
***************** My sectors info ***********************************
# 0: 0x00000000 (0x4000 16kB) not protected
# 1: 0x00004000 (0x4000 16kB) not protected
# 2: 0x00008000 (0x4000 16kB) not protected
# 3: 0x0000c000 (0x4000 16kB) not protected
# 4: 0x00010000 (0x10000 64kB) not protected
# 5: 0x00020000 (0x20000 128kB) not protected
# 6: 0x00040000 (0x20000 128kB) not protected
# 7: 0x00060000 (0x20000 128kB) not protected
# 8: 0x00080000 (0x20000 128kB) not protected
# 9: 0x000a0000 (0x20000 128kB) not protected
# 10: 0x000c0000 (0x20000 128kB) not protected
# 11: 0x000e0000 (0x20000 128kB) not protected
# 12: 0x00100000 (0x4000 16kB) not protected >>>>> boundary of 1024K
# 13: 0x00104000 (0x4000 16kB) not protected
# 14: 0x00108000 (0x4000 16kB) not protected
# 15: 0x0010c000 (0x4000 16kB) not protected
# 16: 0x00110000 (0x10000 64kB) not protected
# 17: 0x00120000 (0x20000 128kB) not protected
# 18: 0x00140000 (0x20000 128kB) not protected
# 19: 0x00160000 (0x20000 128kB) not protected
# 20: 0x00180000 (0x20000 128kB) not protected
# 21: 0x001a0000 (0x20000 128kB) not protected
# 22: 0x001c0000 (0x20000 128kB) not protected
# 23: 0x001e0000 (0x20000 128kB) not protected
STM32F4xx - Rev: unknown (0x1003)
*****************************************************************************
On Mon, Oct 7, 2013 at 12:03 AM, Andreas Fritiofson <
[email protected]> wrote:
>
>
>
> On Mon, Oct 7, 2013 at 5:50 AM, Nader <[email protected]> wrote:
>
>> Hi Guys,
>>
>> I was able to compile the latest dirty version, and just a feedback,
>> the errors still there for my case .
>>
>> I am willing to try anything you throw on me ... :)
>>
>
> Ok, lets try the following steps, <file.elf> is the >1MB file you're
> having problems with.
>
> Have you tried erasing/programming from the OpenOCD telnet prompt to rule
> out GDB related problems? You can then try to do a mass erase instead of a
> sector-by-sector erase (I think the stm32f2x driver has that feature,
> should be smth like 'stm32f2x mass_erase 0'). Any errors?
>
> Then check if it was erased ok with 'flash erase_check 0'. Was it?
>
> Next step, program the image using 'flash write_image <file.elf>'. Key
> point here, don't specify 'erase' as an option, we've already done that
> step. Any errors?
>
> Finish off with 'verify_image <file.elf>'. Success?
>
> If this works it might be a problem with the sector erase function. Check
> that with 'flash write_image erase <file.elf>' which should be similar to
> what happens during GDB load.
>
> Another observation about the xPSR info:
>> xPSR: 0x01000000 pc: 0x08001b10 msp: 0x20030000 (when it is working ok)
>> xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc (when it is NOT)
>>
>> Both PC and SP are bogus.
>>
>
> Because at least the first sector was erased successfully and the erase
> probably failed when crossing the bank boundary.
>
> /Andreas
>
--
Nader Shehayed
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel