新聞中心

stm8s的UBC參數(shù)問題

作者: 時(shí)間:2016-11-29 來源:網(wǎng)絡(luò) 收藏
咱們先介紹一下問題:我在做bootload時(shí)發(fā)現(xiàn)UBC選項(xiàng)字節(jié)和手冊(cè)上的差別甚大,不知道是手冊(cè)錯(cuò)誤還是設(shè)置問題。

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,但是當(dāng)opt1為此值時(shí)發(fā)現(xiàn)0x9000處不能寫,后用stvp實(shí)驗(yàn)發(fā)現(xiàn)當(dāng)opt1=6時(shí)恰好前4k寫保護(hù)。

有關(guān)stm8s的UBC參數(shù)問題的問與答:

問:芯片的具體型號(hào)?
答:stm8s105c6

問:對(duì)于STM8S105C6而言,F(xiàn)lash的每頁是512字節(jié)。
答:1page=4blocks!!

問:錯(cuò),應(yīng)該是:1page = 512bytes
答:也不對(duì),看pm手冊(cè)。

好的,現(xiàn)在我們粘出PM手冊(cè)供大家參考:



好了,我們討論到這里,相信你也懂了,歡迎大家繼續(xù)在此處留言討論,帶所有人都懂得stm8s的UBC參數(shù)問題。


關(guān)鍵詞: stm8sUBC參數(shù)問

評(píng)論


技術(shù)專區(qū)

關(guān)閉