精華區beta Programming 關於我們 聯絡資訊
※ 引述《tester.bbs@bbs.csie.ncu.edu.tw (try or test)》之銘言: > > 1st : Write the host side JTAG slave or master monitor program, you may write > > a console in PC to drive the UART or Parallel port or USB...etc. > > Implement the pin assignment from serial port to JTAG. > > 2nd : Implement the JTAG R/W function of target processor > > By TDO, TDI, TMS, TCK...etc. > > 3rd : Set the system clock via the R/W functions > > 4th : Trigger the processor to reset > ^^^^^^^ > 這個 reset 有一點語焉不詳, 怪怪的. Reset pulse 及外掛 pull-up 電路, > 會讓 processor 從某個特定位址跑起. 但 processor 在跑, processor 之外 > 的 ROM/RAM 就可能會被其使用. > 使 processor 讓出 bus 可能的方法是讓 processor 執行 Hardware HALT . > 某些 processor 如果執行 LEVEL RESET 也可能會讓 processor 的所有 > address, data , control 都進入 bus float state. > 問題就在 JTAG 的 boundary scan 電路會讓被監測的 processor 進入 tri-state > floating bus 的狀態嗎 ? 只有 status scan 功能是不夠的. 要執行 hardware > breakpoint 是要靠 OCD 的 compare circuit , 再截斷 clock. 或者是 forced to > reset level (not pulse) 再插入 next step address 都還算是簡單可以不必使用 > tri-state bus 的電路就做得到. 但 OCD 的實現, 並非標準的 JTAG 規範. 所以, > 若超過 OCD hardware break-point 的功能, 進一步到要能與 processor 相互遮蔽 > output, 且能直接 access RAM , ROM, I/O , 就得問 JTAG 內建電路是否會讓被監 > 測的 Chip 與 JTAG register 在 output 端能否成為 tri-state , 以致可以用 > boundary scan 的 register output 當 bus input 送進 address, data , 及 R/W > control 等 bus 的訊號 ? 而這部份的電路顯然是會隨 SOC chip 有所不同. 其次 > 是內建這種遮蔽功能的 JTAG 電路顯然會成為 security 的漏洞. 我以為你每一個步驟都會覺得語焉不詳的說... 因為每一個 step 寫起來至少從幾週到幾個月不等...簡單的描述絕對不是你所謂的語 焉不詳而已 您說的沒錯...光是 reset 一刀切下去分成 software reset 跟 hardware reset 之外 你還可以細分各是哪一種狀況造成的 現在在賣的 SoC 有支援省電模式跟 soft reset 或是 watchdog 的...這些都跑不掉 BTW, 人都殺到 JTAG 端了...您提的 security 是要保護什麼呢? 坐在 partition driver 之上的 data難不成就不能有 file system 的保護嗎? > > 5th : Initial the memory interface if your flash use memory interface. > > ( Or initial the serial interface controller if your flash is attached > > to a serial bus like I2C or SPI...etc, sure, you need to pack the I2C > > or SPI command to your payload via the JTAG protocol) > > 6th : Follow the flash chip specification to initialize the flash device. > > 6th : Read the flash just from the memory controller(or serial bus > > controller) > > ... > > Final: If you want to write the flash, read the flash chip specification, > > usually you'll need a special procedure to program the flash. > > PS. It's just my experience, maybe not suitable for everyone. > 可以介紹使用的 processor , kit 或 board 的來源型號 ? 請洽各大 SoC 廠...至少 Intel 的 reference manual 跟 application note 不用花一毛錢就可以 download... BTW, 不同的應用對應到的 Kit 會天差地遠....請先決定您的 prototyping 方向吧 最後在順帶一提:我寫的 procedure 只是在硬凹使用 JTAG-ICE直接 Access hardware 的暴力解法,純粹是回文所生,大概以一般的台灣 SI 廠是不會去做這種費力不討好 的工作,做 compiler 或是 ICE 的廠商...可以再看看有沒有這樣搞吧 通常長的正常一點的開發流程會乖乖的去寫 boot loader 再利用 ICE 倒到 SRAM 或是 SDRAM, trigger CPU跳到 CS0 讓系統帶起來,上一篇的重點只是在說明你要的目的, JTAG 可以幫你做 -- 一株幸運草是由四顆心所構成的 m^_^m -- ※ Origin: 交大資管心靈小站 <bbs.iim.nctu.edu.tw> ◆ From: cissol1.cis.nctu.edu.tw