cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 bootloader erase command issues

andrewlucas9
Associate II
Posted on September 09, 2013 at 18:09

I am attempting to erase just flash pages 0x1fc and 0x1fd.  

See the attached logic analyzer screen shots.  They indicate to me that I am sending the commands correctly and the bootloader is responding with ACKs correctly.  My problem is that the flash pages are not actually getting erased, and if I read those locations they return the un-erased data.  What am I doing wrong?

Thanks

#bootloader
6 REPLIES 6
Posted on September 09, 2013 at 19:26

Assume for a second that don't know what part you're using, the address you think you're erasing, and the block/page size in question.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
andrewlucas9
Associate II
Posted on September 09, 2013 at 19:47

Here is the missing information. The part is the STM32F205, with 128K flash.  The page size is 256bytes.  I am attempting to erase pages  508 and 509 which correspond to addresses' 0x0801fc00 - 0x0801fcff  and

0x0801fd00 - 0x0801fdff

Cheers

Posted on September 09, 2013 at 21:47

Yeah, I don't think you have any 256 byte pages on the F2

I think the number here has range 0-11 for 1MB die devices, 0-4 covers the 128KB you have

0 0x08000000 (16KB)

1 0x08004000 (16KB)

2 0x08008000 (16KB)

3 0x0800C000 (16KB)

4 0x08010000 (64KB)

..

5 0x08020000 (128KB)

6 0x08040000 (128KB)

..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
andrewlucas9
Associate II
Posted on September 09, 2013 at 22:16

Thanks for that, my confusion comes from the fact that the bootloader documentation refers to ''pages'' and since all the read/write instructions only read or write up to 256 bytes, I assumed this was the page size.  

Strangely ST uses the term ''sector'' in their reference manual to refer to the same thing as 'pages' in the bootloader manual.  Poor choice of working in my opinion, especially since they don't correlate the two terms anywhere.

To further confuse things their bootloader ''acks'' when the sectors don't exist.

I can see that the technical writers, the hardware designers and the application engineers need to do better at working from the same script.

Cheers,

Andrew

andrewlucas9
Associate II
Posted on September 09, 2013 at 22:17

Posted on September 09, 2013 at 22:37

The Pages were smaller on the F1 devices, but dependent on the flash size, 512-2048 bytes as I recall. You had to read the flash size to figure out which to use.

The read/write routines are limited by the BYTE nature of the protocol in the System Loader. The original F1 loader was implemented in 2KB, and rather simple as a result.

There is definitely a lack of consistency and coherency across the documentation of the various STM32 series parts. They are also difficult to find on the site, and fractured (Data Manual, Reference Manual, Programming (Flash) Manual)

Confusing things more, your part really has 1 MB of FLASH, and 128 KB of SRAM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..