Keil MDK AGDI Drivers, ULink, JLink, ST-Link, NuLink, JTAGjet

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

时间: 2024-08-02 03:46:46

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

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

KEIL 5帮你快速建工程模板的技巧 本人使用keil mdk 5.12有一段时间了,发现keil mdk 5.12里面驱动库比较方便.这个新功能可以节省我们的时间,也可以让初学者能尽快上手和掌握这个芯片.大家以后既就可以很方便的建自己的工程模板了,再也不会为了找芯片的驱动库而烦恼. 今天外我来教大家来怎么使用这个建工程的利器吧. 首先是新建工程吧,如下图步骤: 因为我用的是stm32f401 Necleo,所以芯片型号应该要选择stm32f401te,选好芯片类型后,会弹出一个大的面板,如下图

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

看到Keil MDK又出新版咯,分享给大家 Keil MDK-ARM 5.25 uVision5开发工具下载地址:http://www.myir-tech.com/soft.asp?id=1140 Keil MDK是基于Arm的微控制器最全面的软件开发解决方案,包括创建,构建和调试嵌入式应用程序所需的所有组件. MDK v5.25通过其集成的功率测量功能引入了对ULINK plus的支持 Keil MDK-ARM 5.25新增功能介绍 新增功能:系统分析器在一个窗口中随时间显示相关的执行信息.它

Keil MDK从未有过的详细使用讲解

转自博客:http://blog.csdn.net/zhzht19861011/article/details/5846510 这博主关于MDK 的使用的文章,写的得TM的好  TM的实用! 真心收藏! 熟悉Keil C 51的朋友对于Keil MDK上手应该比较容易,毕竟界面是很像的.但ARM内核毕竟不同于51内核,因此无论在设置上还是在编程思想上,都需要下番功夫研究的.本文以MDK V4.03为例,详细的写一下MDK的设置.界面.工具.可能会有些杂乱,但我想所涉及的东西都是最常用的:可能不是

有趣的keil MDK细节(转)

源:有趣的keil MDK细节 1.MDK中的char类型的取值范围是? 在MDK中,默认情况下,char 类型的数据项是无符号的,所以它的取值范围是0-255.它们可以显式地声明为signed char 或 unsigned.因此,定义有符号char类型变量,必须用signed显式声明.我曾读过一本书,其中有一句话:“signed关键字也是很宽宏大量,你也可以完全当它不存在,在缺省状态下,编译器默认数据位signed类型”,这句话便是有异议的,我们应该对自己所用的CPU构架以及编译器熟练掌握.

转:Keil MDK从未有过的详细使用讲解

来自:http://blog.csdn.net/zhzht19861011/article/details/5846510 熟悉Keil C 51的朋友对于Keil MDK上手应该比较容易,毕竟界面是很像的.但ARM内核毕竟不同于51内核,因此无论在设置上还是在编程思想上,都需要下番功夫研究的.本文以MDK V4.03为例,详细的写一下MDK的设置.界面.工具.可能会有些杂乱,但我想所涉及的东西都是最常用的:可能不是那么的严谨清晰,我想谁也没把我期望成专家!哈,有问题欢迎留言.正式开始.   首

STM32F10x随笔(keil mdk)

STM32F10x(Keil+MDK) by HYH | 2017 年 11 月 3 日 下午 8:51 一.安装后keil MDK环境后,就可直接开发arm了. 备用下载链接:http://pan.baidu.com/s/1qYNtrys 密码:wqpy 最好安装最新版的. 二.RT-Thread简单使用. 1.编译. 1)打开工程 在bsp\Stm32F10x下有相应的工程文件,打开即可. 2).下载设备包. 网址:http://www.keil.com/dd2/pack/#/eula-co

KEIL MDK软件仿真

开发环境:keil MDK V5.10 操作系统:windows 7(32位) 问题描述:使用MDK进行软件设计时没有使用ST官方的模板而是手动建立的工程,使用ST官方提供的3.5版本固件库.编译完全通过,在使用软件仿真时出现问题,表现为程序无法跳转到main入口,直接在SystemInit()函数就无法执行,调试窗口出现如标题所示的错误信息: error 65: access violation at 0x40021000 : no 'read' permission 如下图所示,途中红圈分别

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

1. 仿真的时候,进入之后 2. 说是main()未定义,可是明明定义了,什么原因?喔,看错了,是--main.对比了一下和正常工厂的配置,都一样,换个jlink V9测试一下吧.换了个ST LINK V2 也不行,看样子是工程的问题喽?屏蔽了一些main()函数的一些代码,发现可以执行到main()了!!!奇哉怪也,难道后面的代码写错了,导致不能仿真到main()??? 原文地址:https://www.cnblogs.com/429512065qhq/p/11061335.html

Keil MDK 5.17 released, ARM - CMSIS 4.5.0( 2015-11)

Keil MDK 5.17 releasedThis update for Keil MDK-ARM extends language support to East European and Asian character sets. Added are also several new features, for example a debug driver with improved reset handling.https://www.keil.com/lkt/0/158/demo/ev