在做bootload时发现UBC选项字节和手册上的差别甚大,
不知道是手册错误还是设置问题
datasheet:
UBC[7:0] User boot code area
0x00: no UBC, no write-protection
0x01: Page 0 to 1 defined as UBC, memory write-protected
0x02: Page 0 to 3 defined as UBC, memory write-protected
0x03: Page 0 to 4 defined as UBC, memory write-protected
...
0x3E: Pages 0 to 63 defined as UBC, memory write-protected
Other values: Reserved
Note: Refer to the family reference manual (RM0016) section on
Flash write protection for more details.
我的bootload为4K即为4096/128=32页,那么opt1=32-2=30
但是当opt1为此值时发现0x9000处不能写
后用stvp实验发现当opt1=6时恰好前4k写保护!! |