Re: [請益] ICE(in circuit emulator) for 嵌入式系統

看板Tech_Job作者時間12年前 (2013/10/17 23:18), 編輯推噓6(609)
留言15則, 7人參與, 最新討論串1/1
※ 引述《Hyozero (123)》之銘言: 原文恕刪 : 好奇wiki裡寫的: : 1.An "emulator" gets its name because it emulates (imitates) the central : processing unit of the embedded system's computer. : 請問它是怎麼模擬CPU的阿?本來在板子上的CPU不是還在上面嗎? 那篇前面有提到一開始的emulator的確是可以插在板子上模擬CPU 不過以現在ICE的用途其實是誤稱(misnomer),我其實比較習慣講debugger 現在還是有些CPU可以用emulator模擬,不過都是比較小的MCU像是8051和AVR : 2.Notably, when their program fails, most embedded systems simply become inert : lumps of nonfunctioning electronics . Embedded systems often lack basic : functions to detect signs of software failure, such as an MMU to catch memory : access errors. : 請問為何說Embedded system沒有可以檢查software failure的功能呢? : 小弟的公司是用uart或I2C去讀code run時的print message或register值,這樣的功能 : 算是後來再附加上去的嗎? 用UART或I2C debug的前提是CPU還可以執行程式 如果因為一些原因bus hang住了,或是CPU讀到錯的指令跑飛了,就沒辦法這樣debug 這種情況就要靠ICE透過JTAG直接控制CPU來debug : 3.With an ICE, the programmer can usually test pieces of code, then isolate the : fault to a particular section of code, and then inspect the failing code and : rewrite it to solve the problem. : 這部份實在無法理解了,為何ICE能夠做到把code切分段去debug呢? 你可以在code裡面加break point,當CPU跑到break point的時候就會停下來 停下來之後可以透過ICE檢察系統狀態看是否正常 所以就可以知道跑到那段code前是沒問題的 另外也可以用step一步一步執行看程式會掛在那裡 以上是個人淺見,如有誤還請幫忙指正~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.243.11.56

10/17 23:52, , 1F
10/17 23:52, 1F

10/18 03:29, , 2F
10/18 03:29, 2F

10/18 08:07, , 3F
謝謝您! 還有個認知上的問題想請教
10/18 08:07, 3F

10/18 08:08, , 4F
我把ICE想成是模擬CPU或控制CPU,所以它可以直接看code跑
10/18 08:08, 4F

10/18 08:09, , 5F
的情況,也可以直接access register值和週邊device狀況
10/18 08:09, 5F

10/18 08:09, , 6F
請問我這樣認知是正確的嗎?
10/18 08:09, 6F

10/18 08:45, , 7F
是[控制CPU],你所有在debug tool上的動作(load code
10/18 08:45, 7F

10/18 08:45, , 8F
, 改值,single step)。都會透過ICE實際去access cpu。
10/18 08:45, 8F

10/18 08:45, , 9F
他算是一種侵入式的debug 手段
10/18 08:45, 9F

10/18 08:49, , 10F
另外,為何ICE可以分段執行code 那是因為CPU裡面有跟ICE
10/18 08:49, 10F

10/18 08:49, , 11F
相關的電路來做control,因此可以做到想停就停的境界。
10/18 08:49, 11F

10/18 09:09, , 12F
現在的IC就是利用CPU本身提供的單步執行功能,
10/18 09:09, 12F

10/18 09:10, , 13F
所以不是用另一個東西來模擬,那是滿早以前的方法,很昂貴
10/18 09:10, 13F

10/18 09:25, , 14F
現代已經用 JTage 構造直接做在IC內了
10/18 09:25, 14F

10/23 21:55, , 15F
現在都做成硬体的JTAG,所以都有限制只能設幾個breakpo
10/23 21:55, 15F
文章代碼(AID): #1IN_-wYd (Tech_Job)