C8051F310?
C8051F310在燒寫程式DEBUG時出現Attmpt has been made to access a protected region of flash! A user space erase will be perfermed prior to programing...的解決方法
工具/原料
C8051F310最小系統
電腦中安裝keil3軟體
C8051F310對應的EC3 USB DEBUG ADAPTER偵錯程式
方法/步驟
除錯時出現的現象說明:出現error1:Attmpt has been made to access a protected region of flash! A user space erase will be perfermed prior to programing
error2:Failed reading flash,REceive Buffer failure
error3:Flash write command failure
error4:To recoverfrom the previous errors it is recommended that the debug hardware be reset,do you want to reset now?
出現上述問題的釋義是在DEBUG時程式無法寫入FLASH,這與我的除錯環境有關。那麼問題來了,除錯環境是什麼情況?
當時的除錯環境是:利用穩壓電源對C8051F310最小系統板供電3.3V,而穩壓電源所在的實驗桌在隨著電泵的運轉輕微晃動,在開啟電泵,對310 DEBUG時總是出現上述錯誤,在關閉電泵,重新對310 DEBUG時上述錯誤消失。。。那麼原因來了。
錯誤出現的原因:當開啟電泵時,實驗桌的輕微高頻率晃動導致開關電源的輸出電壓中夾雜高頻的紋波,因此在debug時導致程式無法寫入晶片FLASH。正常進入DEBUG後如下圖所示:
注意事項
對MCU晶片debug除錯時,儘量降低輸出電源的紋波。
在安靜的環境中除錯