2016-01-30 04:43 AM
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.2016-01-30 08:47 AM
Doesn't it permit some block level protection via a bit vector?
2016-02-01 11:05 PM
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.2016-02-02 01:25 AM
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.
2016-02-03 03:32 AM
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.
2016-02-03 04:07 AM
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.2016-02-18 03:14 AM
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). 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.