[问题]开发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