咱们先介绍一下问题:我在做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写保护。
有关stm8s的UBC参数问题的问与答:
问:芯片的具体型号?
答:stm8s105c6
问:关于STM8S105C6而言,Flash的每页是512字节。
答:1page=4blocks!!
问:错,应该是:1page = 512bytes
答:也不对,看pm手册。
好的,现在咱们粘出PM手册供咱们参阅:
好了,咱们评论到这儿,相信你也懂了,欢迎咱们持续在此处留言评论,带所有人都懂得stm8s的UBC参数问题。