新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > stm8s的UBC參數(shù)問題

stm8s的UBC參數(shù)問題

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

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

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

問:芯片的具體型號?
答:stm8s105c6

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

問:錯,應該是:1page = 512bytes
答:也不對,看pm手冊。

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



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


評論


技術專區(qū)

關閉