[問題]開發uVision 5 - 8051 debugger

作者: getaway (夏天快走!!!)   2020-06-18 17:41:49
小弟最近在研究開發uVision5 - C51 debugger,
先前做了一些功課粗略知道應從Target driver-硬件調試器(AGDI)方向下手
參考連結
http://www.keil.com/appnotes/docs/apnt_145.asp
目前已經確定可以執行Flash DownLoad/ GetRegs 兩種行為。
=======================前言簡介結束,問題來了============================
開始進入Debug mode後,
依以前使用它家MCU的經驗都會顯示 ASM code在Disassembly視窗,
可是即便我能透過pF = (FLASHPARM *)pCbFunc(AG_CB_GETFLASHPARAM, NULL);
或其他手段取得Binary code,卻無從打印上去Disassembly視窗。
之前嘗試往以下四個方向著手
AG_READ => read memory
AG_WRITE =>write memory
AG_RDOPC =>read code memory(used for disassmbly)
AG_WROPC =>write code memory(use while loading a user program)
但找不出可以執行打印Disassembly視窗的關鍵處
附上片段程式碼希望能對了解問題有幫助
/*
* Read 'nMany' bytes out of the code space into buffer 'pB'
* return: 0:=Ok, else 'ErrorAddress | (amCODE << 24)'
*/
UL32 ReadCode (BYTE *pB, DWORD nAdr, DWORD nMany)
{
if (CacheValid (pB, nAdr, nMany)) // use cache, if possible
return (0);
else
memset (pB, 0, nMany); // for now, we return 0 bytes (NOP's)
}
請有經驗的前輩大大不吝給任何指點/方向/討論AGDI的地方

Links booklink

Contact Us: admin [ a t ] ucptt.com