On Thu, Nov 7, 2013 at 9:39 PM, Greg Hutchins <ghutch...@gmail.com> wrote:

> *From:* Greg Hutchins [mailto:ghutch...@gmail.com <ghutch...@gmail.com>]
> *Sent:* Thursday, October 24, 2013 2:22 PM
> *To:* Greg DAVIS
> *Cc:* seton.kas...@hitemengineering.com
> *Subject:* openocd.0.7.0 issue with stm32f407vet6
>
>
>
> Works with the stm32f407vgt6 (1Mbyte flash part), fails with the
> smt32f407vet6 (512Kbyte flash part).
>
> Following are the screen dumps and the file where I think the error is
> logged.  The confusing part is the
>
> Device id should be 0x413 for both parts, so I am not sure how the 0x411
> code was executed.
>

But I don't see an error in the second screenshot, only an informational
message that the erratum was detected. Or is it simply crashing? Then it's
not related to the "error" message, see further down.

Geez that's a lot of unrelated code, you could have cut out the important
part. :P


>
>         *if* ((***device_id *&* 0xfff) *==* 0x411) {
>
>                 */* read CPUID reg to check core type */*
>
>                 retval *=* target_read_u32(target, 0xE000ED00, *&*cpuid);
>
>                 *if* (retval *!=* ERROR_OK)
>
>                         *return* retval;
>
>
>
>                 */* check for cortex_m4 */*
>
>                 *if* (((cpuid *>>* 4) *&* 0xFFF) *==* 0xC24) {
>
>                         ***device_id *&=* *~*((0xFFFF *<<* 16) *|* 0xfff);
>
>                         ***device_id *|=* (0x1000 *<<* 16) *|* 0x413;
>
>                         LOG_INFO("stm32f4x errata detected - fixing
> incorrect MCU_IDCODE"); // ß here is the error that is printed out!!!!
>
>                 }
>
>         }
>
>         *return* retval;
>
> }
>
>
>
Since you end up at the highlighted line, the 512k variant obviously
suffers from the erratum mentioned. I.e. it's a F40x that is mislabeled
with id 0x411, even though we know it's not a F20x because it has a
Cortex-M4.

Anyhoo, this is not related to your issue which instead is caused by a bug
in the calculation of the number of sectors for parts < 1024K. It was fixed
after 0.7.0, in commit 9f1616d2b5ea.

/Andreas
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to