On 24 September 2013 21:20,  <[email protected]> wrote:
> Hi all,
>
> I have a problem with using OpenOCD to access flash memory in STM32F4
> discovery MB997C. The same setup and commands work perfectly well with
> the older revision of the board (i.e. MB997B). When using flash
> autodetection, OpenOCD detects 8192kB of flash (the MCU has 1024kB
> according to the specification) contained into over 60 sectors of which
> only 12 first sectors are consistent with the datasheet. Moreover, the
> 'stm32f2x unlock 0' and 'flash protect 0 0 last off' commands success
> most times, but then writing to flash fails in the erase phase with
> 'stm32x device protected' message.
>

I do not have access to the newer version but should be no reason why
it would not work.

At a guess ST have not correctly programmed the flash size register,
not uncommon - this is the reason you can manually override the bank
size.

>
> I tried setting the flash memory size to a fixed value of 1024kB. It
> shows only the proper sectors then, but I'm still unable to access the
> flash.
>

I would suggest you first manually override the bank size then unlock
the target.
Looking at your logs you are not doing this successfully, also power
cycle after the unlock and check it is unlocked before attempting
anything else. Try something like

reset init
stm32f4x unlock 0
 - power cycle here then
reset init
flash info 0

And provide a full debug log (-d3) if possible.

Unless you are using the write protection i would not use unlock as
part of the flash write_image as you will be writing to the option
bytes.

Cheers
Spen

------------------------------------------------------------------------------
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=60133471&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to