新唐開發平台:進階使用者的七大訣竅 (5) 使用Watchpoint來除錯

Post Reply
User avatar
NuvotonMarcom
Posts: 227
Joined: 10 Sep 2018, 17:23

31 May 2021, 03:12

適用情境
  • 追查記憶體存取狀態
  • 參數發生非預期的變化
除錯技巧
  • 在除錯模式下使用 watchpoint,以KEIL μVision 與 IAR EWARM為例
  • 當指定條件發生,例如指定觀察的數據有被讀寫,Watchpoint 會將CPU停下來
KEIL μVision
需先安裝 Nu-Link Keil Driver。
“Ctrl+B” 開啟Breakpoints 視窗。
支援 “訪問斷點(A)”, “執行斷點 (E)” 與 “計數次數產生斷點”
KEIL μVision.png
KEIL μVision.png (75.81 KiB) Viewed 1852 times

IAR EWARM
需先安裝 Nu-Link IAR Driver。
View -> Breakpoints視窗 ->右擊 “New Breakpoint” -> 選擇 “Code” 或 “Data”
支援讀寫訪問資料斷點。
支援程式斷點,可增加變數作為條件
IAR EWARM.png
IAR EWARM.png (83.63 KiB) Viewed 1852 times

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests