Andes Workshop
http://forum.andestech.com/

MCU program debug
http://forum.andestech.com/viewtopic.php?f=23&t=544
Page 1 of 1

Author:  cindy [ Thu Mar 01, 2012 4:54 pm ]
Post subject:  MCU program debug

如果我們要debug ROM或是flash,
可以使用MCU Program debug。

Andesight裡的Debug分成2種,分別為
C/C++ application及MCU Program。
它們的差異有幾點:
(1)C/C++ application的流程:load code,
設定temp breakpoint在main (也可以改到_start),
load code之後continue,停在main。
(2)MCU Program debug是比較彈性的,
可以下各種gdb的command。
因為C/C++ application debug一定會load code,
所以debug ROM或是flash建議採用MCU Program debug。

以下說明MCU Program debug的使用流程。

(1) 首先要先燒code,選擇flash burner-->real board
Attachment:
p2.gif
p2.gif [ 14.91 KiB | Viewed 6958 times ]


(2)將要用的code燒進去。
Attachment:
p1.gif
p1.gif [ 21.11 KiB | Viewed 6958 times ]



(3)第1次使用MCU Program debug要設定,
Debug As-->Debug Configuration
Attachment:
p3.gif
p3.gif [ 20.5 KiB | Viewed 6958 times ]


(4)在MCU Program上double click,會出現如下圖的程式名字。
右邊有選項可以選。

Attachment:
p4.gif
p4.gif [ 19.82 KiB | Viewed 6958 times ]


(5)在此我勾選Reset and hold,使得MCU Program debug在一開始就停在0。
勾好之後,按下Debug可以啟動。
Attachment:
p5.gif
p5.gif [ 29.62 KiB | Viewed 6958 times ]


(6)如下圖,$pc值在0
以下的debug和一般也相同,可以單步執行。
只是HW breakpoint的數量不要超過user的design。
Attachment:
p6.gif
p6.gif [ 30.42 KiB | Viewed 6958 times ]


(7)下次如果還要啟動MCU debug,
不用再到Debug configuration。只要按MCU Program即可。
Attachment:
p7.gif
p7.gif [ 24.64 KiB | Viewed 6958 times ]

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/