AGDI Drivers

AGDI is an Application Program Interface (API) third-party developers can use to create hardware debugger drivers that interface directly with the Keil µVision Debugger. The purpose of AGDI is to provide a way to interface the Keil Debugger user-interface to a third-party's hardware debugging interface.

AGDI drivers are DLLs that are created using Microsoft Visual C++ and template files provided by Keil.

For further information please download Appnote 173 for ARM-based target systems or Appnote 145 for 8051 and C166 based systems.

AGDI drivers can interface to:

  • Emulators.
  • JTAG Debug Interfaces.
  • OCDS (on-chip debugging system) Interfaces.
  • Target Monitors.
  • Any other target debugging hardware.
#define _EXPO_ __declspec(dllexport)
extern _EXPO_ U32 AG_Init (U16 nCode, void *vp);
extern _EXPO_ U32 AG_MemAtt (U16 nCode, UL32 nAttr, GADR *pA);
extern _EXPO_ U32 AG_BpInfo (U16 nCode, void *vp);
extern _EXPO_ AG_BP *AG_BreakFunc (U16 nCode, U16 n1, GADR *pA, AG_BP *pB);
extern _EXPO_ U32 AG_HistFunc (U32 nCode, I32 indx, I32 dir, void *vp);
extern _EXPO_ U32 AG_GoStep (U16 nCode, U32 nSteps, GADR *pA);
extern _EXPO_ U32 AG_Serial (U16 nCode, U32 nSerNo, U32 nMany, void *vp);
extern _EXPO_ U32 AG_MemAcc (U16 nCode, UC8 *pB, GADR *pA, UL32 nMany);
extern _EXPO_ U32 AG_RegAcc (U16 nCode, U32 nReg, GVAL *pV);
extern _EXPO_ U32 AG_AllReg (U16 nCode, void *pR);

AGDI Interface Functions

All functions that start with AG_ need to be defined in the target driver DLL. If a function executes correctly, the value 0 is returned to µVision, otherwise an error code should be returned. Note that the following exported functions must be defined, either fully functional or just as dummies:

Function Description
AG_Init() AGDI Initialize function.
AG_MemAtt() Memory Attribute access function.
AG_BpInfo() Breakpoint Set / Reset / Enable / Disable / Kill function.
AG_BreakFunc() Breakpoint access function.
AG_GoStep() Go / Step / Stop commands.
AG_Serial() Read / Write a Serial Window function.
AG_MemAcc() Access target memory function.
AG_RegAcc() Read / Write a single Register function.
AG_AllReg() Read / Write Registers function.
AG_HistFunc() Trace History access function.

If this is not the case, µVision considers the target driver as invalid and cancels using it.

AGDI Callbacks

AGDI can borrow some of the functionality from µVision. This can be done by using the pCbFunc callback pointer, a function code and the appropriate parameters. Note that only the most important callback functions are described here. The additional ones can be found in AGDI.H near the end of the file.

typedef U32 (*pCBF) (U32 nCode, void *vp);
#define AG_CB_TRUEXPR 1 // vp := 'EXP *' (use for Bp->ep)
#define AG_CB_PROGRESS 2 // vp := 'struct PgRess *'
#define AG_CB_INITREGV 3 // vp := 'REGDSC *' (into RegView)
#define AG_CB_EXECCMD 4 // vp := 'char *' command string
#define AG_CB_FORCEUPDATE 5 // vp := NULL, force general windows update
#define AG_CB_DISASM 6 // vp := 'DAAS *', disasm opcodes
#define AG_CB_INLASM 7 // vp := 'DAAS *', assemble szB[] into Opc[]
#define AG_CB_MSGSTRING 8 // vp := 'char *' text for message pane
#define AG_CB_GETDEVINFO 9 // vp := 'DEV_X66 *', get device info
#define AG_CB_SYMBYVAL 10 // vp := 'SYMDESC *', find symbol by value
#define AG_CB_SYMBYNAME 11 // vp := 'SYMDESC *', find symbol by name
#define AG_CB_SLE66MM 12 // vp := &slots[0] out of [512]
#define AG_CB_PHYS2MMU 13 // vp := (void *) ((DWORD) physAdr)
#define AG_CB_MMU2PHYS 14 // vp := (void *) ((DWORD) logicalAdr)
#define AG_CB_GETFLASHPARAM 15 // vp := (FLASHPARM *) or NULL
#define AG_CB_GETBOMPTR 16 // vp := &ioc /5.3.2003/ // Note: special callback for DTC-Messaging
#define AG_CB_DCTMSG_WRITE 17 // vp := write-access address #define AG_CB_DISASM_EXT 18 // vp := 'DAS_MIXED *', disasm to file
#define AG_CB_LAREC_DATA 19 // vp := 'AGDI_LAREC *', send data-record to Logic-Analyzer
#define AG_CB_SHUTDOWN 20 //
#define AG_CB_GETSCOPEINFO 21 // vp := 'AG_SCOPE *', get Scope Info
#define AG_CB_ENUMFUNCTIONS 22 // vp := 'AG_BLOCK *'. enumerate App/Modules/Functions
Keil   ULINK, ULINK2, ULINK Pro --  UL2ARM.DLL, UM2CM3.DLL, ULP2ARM.DLL, ULP2CM3.DLL

TI   LMIDK-AGDI -- LMIDK-AGDI.DLL

Nuvoton   NuLink -- Nu_Link.dll

ST  ST-LINK -- ST-LINKIII-KEIL_SWO.dll

SiLabs  UDA -- SLAB_ADI.dll, SLAB_ADI_Util.dll, SLAB_CM_Keil.dll

Signum JTAGjet -- SigUV3Arm.dll

PEMicro Pemicro_ArmCortexInterface.dll

Segger  JLINK -- JLTAgdi.dll, JL2CM3.dll  
TDRV0=BIN\UL2ARM.DLL("ULINK2/ME ARM Debugger")
TDRV1=BIN\UL2CM3.DLL("ULINK2/ME Cortex Debugger")
TDRV2=BIN\ABLSTCM.dll("Altera Blaster Cortex Debugger")
TDRV3=BIN\lmidk-agdi.dll("Stellaris ICDI")
TDRV4=Signum\SigUV3Arm.dll("Signum Systems JTAGjet")
TDRV5=Segger\JLTAgdi.dll("J-LINK / J-TRACE ARM")
TDRV6=Segger\JL2CM3.dll("J-LINK / J-TRACE Cortex")
TDRV7=BIN\ULP2CM3.DLL("ULINK Pro Cortex Debugger")
TDRV8=BIN\ULP2ARM.DLL("ULINK Pro ARM Debugger")
TDRV9=NULink\Nu_Link.dll("NULink Debugger")
TDRV10=SiLabs\SLAB_CM_Keil.dll("SiLabs UDA Debugger")
TDRV11=STLink\ST-LINKIII-KEIL_SWO.dll ("ST-Link Debugger")
TDRV12=BIN\CMSIS_AGDI.dll("CMSIS-DAP Debugger")
TDRV13=BIN\DbgFM.DLL("Fast Models Debugger")
TDRV14=PEMicro\Pemicro_ArmCortexInterface.dll("PEMicro Debugger")

// Import Functions from JLINLARM.dll ==========================================
// Keil\ARM\Segger\JLTAgdi.dll
// Keil\ARM\Segger\JL2CM3.dll
//
// Functions for DLL
//
JLINKARM_GetDLLVersion
JLINKARM_GetCompileDateTime
JLINKARM_OpenEx
JLINKARM_Close
JLINKARM_HasError
JLINKARM_EnableLog
JLINKARM_SetLogFile
JLINKARM_SetErrorOutHandler
JLINKARM_SetWarnOutHandler
// JL2CM3
JLINKARM_IsOpen
JLINKARM_GetDebugInfo
//
// Functions for DLL, JLINK, MCU
//
JLINKARM_ExecCommand
//
// Functions for JLINK
//
JLINKARM_GetSN
JLINKARM_GetEmuCaps
JLINKARM_GetOEMString
JLINKARM_GetFeatureString
JLINKARM_GetFirmwareString
JLINKARM_GetHardwareVersion
//
// Functions for JLINK
//
JLINKARM_SetResetType
JLINKARM_GetSpeedInfo
JLINKARM_GetSpeed
JLINKARM_SetSpeed
JLINKARM_EnableSoftBPs
// JL2CM3
JLINKARM_SetEndian
JLINKARM_SelectIP
JLINKARM_SelectUSB
JLINKARM_TIF_GetAvailable
JLINKARM_TIF_Select
JLINKARM_JTAG_SyncBits
JLINKARM_JTAG_StoreRaw
JLINKARM_EMU_SelectIP
JLINKARM_EMU_GetList
JLINKARM_EMU_SelectByUSBSN
//
// Functions for JLINK
//
JLINKARM_GetHWStatus
JLINKARM_GetScanLen
JLINKARM_GetId
JLINKARM_GetIdData
JLINKARM_JTAG_GetDeviceId
JLINKARM_GetDeviceFamily
// JL2CM3
JLINKARM_JTAG_GetDeviceInfo

//
// Functions for MCU Run
//
JLINKARM_Reset
JLINKARM_Step
JLINKARM_Go
JLINKARM_Halt
JLINKARM_IsHalted
// JL2CM3
JLINKARM_SetRESET
JLINKARM_ClrRESET
//
// Functions for MCU Watchpoint
//
JLINKARM_GetNumWPs
JLINKARM_SetWP
JLINKARM_ClrWP
//
// Functions for MCU Breakpoint
//
JLINKARM_GetNumBPUnits
JLINKARM_SetBPEx
JLINKARM_ClrBPEx
//
// Functions for MCU ETM
//
JLINKARM_ETM_IsPresent
JLINKARM_ETM_ReadReg
JLINKARM_ETM_WriteReg
//
// Functions for MCU Trace
//
JLINKARM_TRACE_Control
JLINKARM_TRACE_Read
// JL2CM3
JLINKARM_RAWTRACE_Control
JLINKARM_RAWTRACE_Read
JLINKARM_SWO_Control
JLINKARM_SWO_Read
//
// Functions for MCU Register and Memory
//
JLINKARM_ReadMem
JLINKARM_WriteMem
JLINKARM_ReadReg
JLINKARM_WriteReg
// JL2CM3
JLINKARM_WriteU8
JLINKARM_WriteU16
JLINKARM_WriteU32
JLINKARM_ReadMemU8
JLINKARM_ReadMemU16
JLINKARM_ReadMemU32

Keil MDK AGDI Drivers, ULink, JLink, ST-Link, NuLink, JTAGjet的更多相关文章

  1. Keil MDK编译器(V4.03)与J-LINK使用

    前几天进手了一个J-LINK,因为H-JTAG毕竟对MDK支持的不是太完美,比如用keil mdk上面的下载按钮烧录程序,不是直接就能烧录进去,而是弹出H-Flash软件,再手工选择文件烧录:而且用H ...

  2. KEIL MDK 5.12帮你快速建工程模板的技巧

    KEIL 5帮你快速建工程模板的技巧 本人使用keil mdk 5.12有一段时间了,发现keil mdk 5.12里面驱动库比较方便.这个新功能可以节省我们的时间,也可以让初学者能尽快上手和掌握这个 ...

  3. Keil MDK最新版 5.25介绍及下载地址

    看到Keil MDK又出新版咯,分享给大家 Keil MDK-ARM 5.25 uVision5开发工具下载地址:http://www.myir-tech.com/soft.asp?id=1140 K ...

  4. STM32(1)——使用Keil MDK以及标准外设库创建STM32工程

    转载来自:http://emouse.cnblogs.com 1.1 开发工具与开发环境 1. 软件版本 本节所使用Keil MDK 为目前的最新版V4.21.其他版本差别不大,读者可以根据自己使用的 ...

  5. Keil MDK仿真调试STM32的时候直接进入SystemInit函数

    1. 仿真的时候,进入之后 2. 说是main()未定义,可是明明定义了,什么原因?喔,看错了,是--main.对比了一下和正常工厂的配置,都一样,换个jlink V9测试一下吧.换了个ST LINK ...

  6. Keil MDK STM32系列(二) 基于标准外设库SPL的STM32F401开发

    Keil MDK STM32系列 Keil MDK STM32系列(一) 基于标准外设库SPL的STM32F103开发 Keil MDK STM32系列(二) 基于标准外设库SPL的STM32F401 ...

  7. Keil MDK STM32系列(三) 基于标准外设库SPL的STM32F407开发

    Keil MDK STM32系列 Keil MDK STM32系列(一) 基于标准外设库SPL的STM32F103开发 Keil MDK STM32系列(二) 基于标准外设库SPL的STM32F401 ...

  8. Keil MDK STM32系列(四) 基于抽象外设库HAL的STM32F401开发

    Keil MDK STM32系列 Keil MDK STM32系列(一) 基于标准外设库SPL的STM32F103开发 Keil MDK STM32系列(二) 基于标准外设库SPL的STM32F401 ...

  9. Keil MDK 无法设置断点【worldsing】

    要解决一个问题就怕不知道怎么搜索,或是别人没有遇到过: 同样碰到Keil MDK Debug调试无法设置断点问题,首先来问百度,GOOGLE,一下是我搜索到的结果:   1.keil 不能设置断点,每 ...

随机推荐

  1. 基于CentOS与VmwareStation10搭建Oracle11G RAC 64集群环境:2.搭建环境-2.3配置共享磁盘

    2.3.配置共享磁盘 2.3.1.创建共享磁盘 在cmd中进入WMware Workstation 10.0 安装目录: 1.创建存储Oracle Clusterware文件  (Oracle Clu ...

  2. AutoCompleteTextView不能使用的问题

    AutoCompleteTextView按照网络上的方法写之后不能使用 解决方法: android:layout_width="fill_parent" 而不能是wrap_pare ...

  3. Linux下常用软件

    一, vmtool安装, 进入桌面就后,如果没有看到VMware Tools光盘, 请点击VMware Station菜单栏上的“虚拟机”,然后选择“安装VMware Tools”,就可以在桌面上以看 ...

  4. UIButton 在UIScrollView里面 点击效果不明显的问题

    self.scrollView.delaysContentTouches = NO; -(BOOL)touchesShouldCancelInContentView { return YES; }

  5. 【转】loadrunner检查点设置

    转自:http://www.cnblogs.com/fnng/archive/2013/03/10/2953257.html 判断脚本是否执行成功是根据服务器返回的状态来确定的,如果服务器返回的HTT ...

  6. Web前端开发工程师编程能力飞升之路

    [背景] 如果你是刚进入web前端研发领域,想试试这潭水有多深,看这篇文章吧:如果你是做了两三年web产品前端研发,迷茫找不着提高之路,看这篇文章吧:如果你是四五年的前端开发高手,没有难题能难得住你的 ...

  7. IOS设备启动图像命名规范

  8. C++11中的右值引用

    原文出处:http://kuring.me/post/cpp11_right_reference May 18, 2015 移动构造函数 C++98中的左值和右值 C++11右值引用和移动语义 强制移 ...

  9. 第三次阅读赵炯博士的《linux内核代码完全注释》:序

    这是我第三次阅读linux内核代码完全注释了,当然前两次也没有读完,第一次读到第五章,第二次第七章. 所以说,赵炯博士对我最大的帮助时介绍了intel386的结构,以及内核编程的方法. 至于真正的内核 ...

  10. HDU-3872 Dragon Ball 线段树+DP

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3872 题意:有n个龙珠按顺序放在一列,每个龙珠有一个type和一个权值,要求你把这n个龙珠分成k个段, ...