cancel
Showing results for 
Search instead for 
Did you mean: 

IAP: Boot Loader Write Protection

pkumar1883
Associate II
Posted on January 30, 2016 at 13:43

Dear Forum Members,

I am using STM32f103 custom board. I have divided my flash into 2 parts, one for custom bootloader and other for application(as explained in ST IAP example). Now I want to made boot loader section write protected. So that there will be no possibility of boot loader corruption during any write process. But I dont want to make application area write protected.

So during application firmware update can I update application area without touching the boot loader section write protection.

6 REPLIES 6
Posted on January 30, 2016 at 17:47

Doesn't it permit some block level protection via a bit vector?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pkumar1883
Associate II
Posted on February 02, 2016 at 08:05

Dear Clive1,

Thank you for your support. Yes it supports block level write protection. But when I apply write protection only on Bootloader section. It does not allow me to update application until I remove write protection.

re.wolff9
Senior
Posted on February 02, 2016 at 10:25

Maybe the bootloader section is larger than you think? Basically the write protection works as documented in the datasheet. So you should be able to protect part of the flash.  On smaller devices the steps might be ''large'', i.e. each quarter of the flash is either  protected or not. 

gmate1
Associate II
Posted on February 03, 2016 at 12:32

According to the STM32F0 Reference manual (RM0091):

If a program or an erase operation is performed on a protected sector, the Flash memory returns a WRPRTERR protection error flag in the Flash memory Status Register (FLASH_SR).

 

 

Silly, it may sound but I'm wondering If I enable write protect for a particular region (say for bootloader), Will a subsequent flashing of bootloader area using ICP (using SWD interface) fail ? If it is correct, then the only option would be to disable write protect for bootloader area (say 0x0800 0000 - 0x0800 4000) by having an application F/W (say loaded at 0x0800 4000) disable it in software by programming FLASH_CR register. Please confirm.

pkumar1883
Associate II
Posted on February 03, 2016 at 13:07

Dear wolf.roger,

I have checked my bootloader size carefully. It is within the size limit allotted to it.

When I try to update Application area, I get error due to write protection of memory. Then I need to disable this to update application. Dont know why it is so. While as per application note the block level protection should work.  

pkumar1883
Associate II
Posted on February 18, 2016 at 12:14

Dear All,

Please have a look. I have write protected area from 0x08000000 - 0x08004000 after  boot loader flashing. Now I flashes my application at 0x08005000(atarting address for my application, 0x080040000 - 0x08005000 (2KB)left blank intentionally ) using ST Link V2. Dont know why ST Link V2 removes the write protection (as shown in image below).

 0690X000006037YQAQ.jpg

So this has puzzled me how to make my bootloader fully write protected. Because in field application I don't want my bootloader section to edited/corrupted/updated by any means.

Please guys give your ideas/ suggestions. Thank you so much in advance.