没有合适的资源?快使用搜索试试~ 我知道了~
首页J-Link SDK 用户指南:UM08002
J-Link SDK 用户指南:UM08002
5星 · 超过95%的资源 需积分: 50 79 下载量 21 浏览量
更新于2024-07-14
2
收藏 3.36MB PDF 举报
"UM08002_JLinkDLL.pdf 是SEGGER Microcontroller GmbH提供的J-Link SDK用户指南,文档版本为6.42,修订版5,日期为2019年2月7日。该SDK主要涉及J-Link应用编程接口(API)的详细说明,用于开发与J-Link调试器相关的软件应用。"
J-Link SDK是一个针对SEGGER J-Link硬件调试器的软件开发工具包。它提供了API,使得开发者能够创建自定义的应用程序来控制和利用J-Link的功能。J-Link是广泛使用的嵌入式系统调试工具,支持多种微控制器和操作系统,如ARM架构的设备。
J-Link SDK包含以下关键知识点:
1. **J-Link API**:这是SDK的核心部分,是一系列函数调用和数据结构,允许程序员在自己的应用程序中控制J-Link设备。这些函数涵盖了各种操作,包括连接和断开设备、下载代码到目标MCU、读写内存、单步执行、设置断点、获取调试信息等。
2. **多平台支持**:J-Link SDK通常支持Windows、Linux和macOS等不同操作系统,允许开发者在各种环境下进行开发。
3. **软件版本更新**:文档中提到信息可能随时变化,提示用户确保使用最新版的手册,这意味着SDK可能会定期更新以添加新功能、修复错误或提升性能。
4. **免责声明**:SEGGER不保证其规格完全无误,并明确表示不承担任何明示或暗示的保修责任,包括适销性和特定用途适用性。这表明开发者在使用SDK时应自行承担风险。
5. **版权信息**:SEGGER保留所有权利,未经许可,不得提取手册部分内容或修改PDF文件。使用该SDK的软件必须遵循提供的许可证条款。
6. **开发应用示例**:使用J-Link SDK的开发者可以创建定制的固件更新工具、远程调试解决方案、嵌入式系统的自动化测试程序等。
通过J-Link SDK,开发者能够深入地集成J-Link调试器到他们的开发流程中,实现高效、灵活的嵌入式系统调试和测试。结合实际项目需求,可以利用SDK提供的API开发出满足特定需求的工具,提高开发效率并降低开发成本。
16
4.1.1 Data types ....................................................................................... 50
4.1.2 Calling conventions ............................................................................50
4.2 Global DLL error codes ................................................................................. 51
4.3 API functions ............................................................................................... 52
4.3.1 JLINKARM_BeginDownload() ............................................................... 58
4.3.2 JLINKARM_Clock() ............................................................................. 58
4.3.3 JLINKARM_Close() ............................................................................. 58
4.3.4 JLINKARM_ClrBP() ............................................................................. 58
4.3.5 JLINKARM_ClrBPEx() ..........................................................................59
4.3.6 JLINKARM_ClrDataEvent() .................................................................. 59
4.3.7 JLINKARM_ClrError() ..........................................................................60
4.3.8 JLINKARM_ClrRESET() ....................................................................... 60
4.3.9 JLINKARM_ClrTCK() ........................................................................... 60
4.3.10 JLINKARM_ClrTDI() ..........................................................................60
4.3.11 JLINKARM_ClrTMS() ......................................................................... 61
4.3.12 JLINKARM_ClrTRST() ........................................................................61
4.3.13 JLINKARM_ClrWP() .......................................................................... 61
4.3.14 JLINKARM_CORE_GetFound() ............................................................ 61
4.3.15 JLINKARM_ConfigJTAG() ................................................................... 64
4.3.16 JLINKARM_Connect() ....................................................................... 65
4.3.17 JLINKARM_Core2CoreName() ............................................................ 65
4.3.18 JLINKARM_CORESIGHT_Configure() ...................................................65
4.3.19 JLINKARM_CORESIGHT_ReadAPDPReg() .............................................67
4.3.20 JLINKARM_CORESIGHT_WriteAPDPReg() ............................................ 68
4.3.21 JLINKARM_CP15_ReadEx() ................................................................68
4.3.22 JLINKARM_CP15_WriteEx() ............................................................... 68
4.3.23 JLINKARM_DEVICE_GetIndex() ..........................................................69
4.3.24 JLINKARM_DEVICE_GetInfo() ............................................................ 69
4.3.25 JLINKARM_DEVICE_SelectDialog() ..................................................... 70
4.3.26 JLINK_DownloadFile() ...................................................................... 71
4.3.27 JLINKARM_EMU_COM_IsSupported() ..................................................72
4.3.28 JLINKARM_EMU_COM_Read() ............................................................72
4.3.29 JLINKARM_EMU_COM_Write() ........................................................... 73
4.3.30 JLINKARM_EMU_FILE_Delete() .......................................................... 73
4.3.31 JLINKARM_EMU_FILE_GetSize() ........................................................ 74
4.3.32 JLINKARM_EMU_FILE_Read() ............................................................ 74
4.3.33 JLINKARM_EMU_FILE_Write() ............................................................74
4.3.34 JLINK_EMU_AddLicense() ................................................................. 75
4.3.35 JLINK_EMU_EraseLicenses() ..............................................................76
4.3.36 JLINK_EMU_GetDeviceInfo() ............................................................. 77
4.3.37 JLINK_EMU_GetLicenses() ................................................................ 77
4.3.38 JLINKARM_EMU_GetList() ................................................................. 77
4.3.39 JLINKARM_EMU_GetNumDevices() .....................................................79
4.3.40 JLINKARM_EMU_GetProductName() ................................................... 80
4.3.41 JLINKARM_EMU_HasCapEx() ............................................................. 80
4.3.42 JLINKARM_EMU_HasCPUCap() ...........................................................80
4.3.43 JLINKARM_EMU_IsConnected() ..........................................................81
4.3.44 JLINKARM_EMU_SelectByUSBSN()) .................................................... 81
4.3.45 JLINKARM_EMU_SelectIP() ................................................................83
4.3.46 JLINKARM_EMU_SelectIPBySN() ........................................................ 84
4.3.47 JLINKARM_EnableLog() .................................................................... 84
4.3.48 JLINKARM_EnableLogCom() .............................................................. 84
4.3.49 JLINKARM_EnableSoftBPs() ...............................................................85
4.3.50 JLINKARM_EndDownload() ................................................................85
4.3.51 JLINK_EraseChip() ........................................................................... 86
4.3.52 JLINKARM_FindBP() ......................................................................... 86
4.3.53 JLINKARM_GetBPInfo() .....................................................................86
4.3.54 JLINKARM_GetBPInfoEx() ................................................................. 87
4.3.55 JLINKARM_GetCompileDateTime() ......................................................88
4.3.56 JLINKARM_GetConfigData() .............................................................. 88
J-Link ARM SDK (UM08002) © 2004-2019 SEGGER Microcontroller GmbH
17
4.3.57 JLINKARM_GetDebugInfo() ............................................................... 89
4.3.58 JLINKARM_GetDeviceFamily() ............................................................89
4.3.59 JLINKARM_GetDLLVersion() ...............................................................90
4.3.60 JLINKARM_GetEmuCaps() ................................................................. 91
4.3.61 JLINKARM_GetEmuCapsEx() ............................................................. 94
4.3.62 JLINKARM_GetFeatureString() ........................................................... 98
4.3.63 JLINKARM_GetFirmwareString() .........................................................99
4.3.64 JLINKARM_GetHardwareVersion() ...................................................... 99
4.3.65 JLINKARM_GetHWInfo() ..................................................................100
4.3.66 JLINKARM_GetHWStatus() .............................................................. 101
4.3.67 JLINKARM_GetId() ......................................................................... 102
4.3.68 JLINKARM_GetIdData() ...................................................................102
4.3.69 JLINKARM_GetIRLen() .................................................................... 102
4.3.70 JLINK_GetMemZones() ................................................................... 103
4.3.71 JLINKARM_GetMOEs() .................................................................... 104
4.3.72 JLINKARM_GetNumBPs() .................................................................106
4.3.73 JLINKARM_GetNumBPUnits() ........................................................... 106
4.3.74 JLINKARM_GetNumWPs() ................................................................107
4.3.75 JLINKARM_GetNumWPUnits() .......................................................... 107
4.3.76 JLINKARM_GetOEMString() ............................................................. 107
4.3.77 JLINK_GetpFunc() .......................................................................... 108
4.3.78 JLINKARM_GetRegisterList() ............................................................ 108
4.3.79 JLINKARM_GetRegisterName() .........................................................109
4.3.80 JLINKARM_GetResetTypeDesc() ....................................................... 109
4.3.81 JLINKARM_GetScanLen() ................................................................ 110
4.3.82 JLINKARM_GetSelDevice() .............................................................. 110
4.3.83 JLINKARM_GetSN() ........................................................................ 110
4.3.84 JLINKARM_GetSpeed() ................................................................... 111
4.3.85 JLINKARM_GetSpeedInfo() .............................................................. 111
4.3.86 JLINKARM_GetWPInfoEx() ...............................................................112
4.3.87 JLINKARM_Go() ............................................................................. 113
4.3.88 JLINKARM_GoAllowSim() ................................................................ 113
4.3.89 JLINKARM_GoEx() ..........................................................................113
4.3.90 JLINKARM_GoIntDis() .....................................................................114
4.3.91 JLINKARM_Halt() ........................................................................... 114
4.3.92 JLINKARM_HasError() .....................................................................114
4.3.93 JLINKARM_IsConnected() ................................................................114
4.3.94 JLINKARM_IsHalted() ..................................................................... 115
4.3.95 JLINKARM_IsOpen() ....................................................................... 115
4.3.96 JLINKARM_Lock() ...........................................................................115
4.3.97 JLINKARM_MeasureCPUSpeed() ....................................................... 116
4.3.98 JLINKARM_MeasureCPUSpeedEx() ....................................................116
4.3.99 JLINKARM_MeasureRTCKReactTime() ................................................117
4.3.100 JLINKARM_MeasureSCLen() ...........................................................117
4.3.101 JLINKARM_Open() ........................................................................117
4.3.102 JLINKARM_OpenEx() .................................................................... 118
4.3.103 JLINKARM_ReadCodeMem() ...........................................................118
4.3.104 JLINKARM_ReadDCC() .................................................................. 119
4.3.105 JLINKARM_ReadDCCFast() .............................................................119
4.3.106 JLINKARM_ReadDebugPort() ..........................................................120
4.3.107 JLINKARM_ReadICEReg() .............................................................. 120
4.3.108 JLINKARM_ReadMem() ..................................................................120
4.3.109 JLINKARM_ReadMemEx() .............................................................. 121
4.3.110 JLINKARM_ReadMemHW() ............................................................. 121
4.3.111 JLINKARM_ReadMemIndirect() ....................................................... 122
4.3.112 JLINKARM_ReadMemU8() ..............................................................122
4.3.113 JLINKARM_ReadMemU16() ............................................................ 123
4.3.114 JLINKARM_ReadMemU32() ............................................................ 124
4.3.115 JLINKARM_ReadMemU64() ............................................................ 124
4.3.116 JLINK_ReadMemZonedEx() ............................................................125
J-Link ARM SDK (UM08002) © 2004-2019 SEGGER Microcontroller GmbH
18
4.3.117 JLINKARM_ReadReg() ................................................................... 126
4.3.118 JLINKARM_ReadRegs() ..................................................................134
4.3.119 JLINKARM_ReadTerminal() ............................................................ 135
4.3.120 JLINKARM_Reset() ....................................................................... 135
4.3.121 JLINKARM_ResetNoHalt() .............................................................. 136
4.3.122 JLINKARM_ResetPullsRESET() ........................................................ 136
4.3.123 JLINKARM_ResetPullsTRST() .......................................................... 137
4.3.124 JLINKARM_ResetTRST() ................................................................ 137
4.3.125 JLINKARM_SelDevice() ..................................................................137
4.3.126 JLINKARM_SelectDeviceFamily() .....................................................137
4.3.127 JLINKARM_SelectIP() .................................................................... 138
4.3.128 JLINKARM_SelectTraceSource() ......................................................138
4.3.129 JLINKARM_SelectUSB() ................................................................. 138
4.3.130 JLINKARM_SetBP() ....................................................................... 139
4.3.131 JLINKARM_SetBPEx() ....................................................................140
4.3.132 JLINKARM_SetDataEvent() ............................................................ 142
4.3.133 JLINKARM_SetEndian() ................................................................. 144
4.3.134 JLINKARM_SetErrorOutHandler() ....................................................144
4.3.135 JLINK_SetHookUnsecureDialog() .................................................... 145
4.3.136 JLINKARM_SetInitRegsOnReset() ....................................................146
4.3.137 JLINKARM_SetLogFile() ................................................................. 146
4.3.138 JLINKARM_SetMaxSpeed() ............................................................ 147
4.3.139 JLINKARM_SetRESET() ................................................................. 147
4.3.140 JLINKARM_SetResetDelay() ........................................................... 147
4.3.141 JLINKARM_SetResetPara() .............................................................148
4.3.142 JLINKARM_SetResetType() ............................................................ 148
4.3.143 JLINKARM_SetSpeed() .................................................................. 149
4.3.144 JLINKARM_SetTCK() ..................................................................... 149
4.3.145 JLINKARM_SetTDI() ..................................................................... 149
4.3.146 JLINKARM_SetTMS() .....................................................................150
4.3.147 JLINKARM_SetTRST() ................................................................... 150
4.3.148 JLINKARM_SetWarnOutHandler() ....................................................150
4.3.149 JLINKARM_SetWP() ...................................................................... 150
4.3.150 JLINKARM_SimulateInstruction() .................................................... 153
4.3.151 JLINKARM_Step() .........................................................................153
4.3.152 JLINKARM_StepComposite() .......................................................... 153
4.3.153 JLINKARM_StoreBits() .................................................................. 154
4.3.154 JLINKARM_TIF_GetAvailable() ........................................................154
4.3.155 JLINKARM_TIF_Select() ................................................................ 155
4.3.156 JLINKARM_Unlock() ...................................................................... 155
4.3.157 JLINKARM_UpdateFirmwareIfNewer() ..............................................155
4.3.158 JLINKARM_WaitDCCRead() ............................................................ 155
4.3.159 JLINKARM_WaitForHalt() ............................................................... 156
4.3.160 JLINKARM_WriteBits() ...................................................................156
4.3.161 JLINKARM_WriteDCC() .................................................................. 156
4.3.162 JLINKARM_WriteDCCFast() ............................................................ 157
4.3.163 JLINKARM_WriteDebugPort() ......................................................... 158
4.3.164 JLINKARM_WriteICEReg() ..............................................................158
4.3.165 JLINKARM_WriteMem() ................................................................. 158
4.3.166 JLINKARM_WriteMemDelayed() ...................................................... 159
4.3.167 JLINKARM_WriteMemEx() ..............................................................159
4.3.168 JLINK_WriteMemZonedEx() ........................................................... 160
4.3.169 JLINKARM_WriteReg() ...................................................................161
4.3.170 JLINKARM_WriteRegs() ................................................................. 161
4.3.171 JLINKARM_WriteU8() .................................................................... 161
4.3.172 JLINKARM_WriteU16() .................................................................. 162
4.3.173 JLINKARM_WriteU32() .................................................................. 162
4.3.174 JLINKARM_WriteU64() .................................................................. 162
4.3.175 JLINKARM_WriteVectorCatch() ....................................................... 163
4.4 Indirect API functions ................................................................................. 165
J-Link ARM SDK (UM08002) © 2004-2019 SEGGER Microcontroller GmbH
19
4.4.1 JLINK_IFUNC_SET_HOOK_DIALOG_UNLOCK_IDCODE .......................... 165
4.4.2 JLINK_IFUNC_PIN_OVERRIDE ........................................................... 167
4.4.3 JLINK_IFUNC_SCRIPTFILE_EXEC_FUNC .............................................. 168
4.5 Executing command strings ......................................................................... 170
4.5.1 JLINKARM_ExecCommand() .............................................................. 170
4.6 DLL startup sequence implementation ...........................................................172
4.7 Implementation Samples ............................................................................. 176
4.7.1 Using the DLL built-in flash programming functionality ......................... 176
4.7.2 Locate the latest installed version of the J-Link DLL ............................. 177
4.7.3 Store custom licenses on J-Link ........................................................ 178
4.8 Criteria for J-Link compatible IDEs ............................................................... 182
5 Power API .................................................................................................................183
5.1 General information .................................................................................... 184
5.2 Power API functions ....................................................................................185
5.2.1 JLINK_POWERTRACE_Control() ..........................................................185
5.2.2 JLINK_POWERTRACE_Read() .............................................................190
6 High-Speed Sampling API (HSS) ............................................................................. 192
6.1 General information .................................................................................... 193
6.1.1 Advantages of SEGGER J-Link HSS vs. ARM SWO ................................ 193
6.2 HSS API functions ...................................................................................... 194
6.2.1 Supported HSS Speeds .................................................................... 194
6.2.2 JLINK_HSS_Start() .......................................................................... 194
6.2.3 JLINK_HSS_Stop() ...........................................................................196
6.2.4 JLINK_HSS_Read() .......................................................................... 196
7 RTT ........................................................................................................................... 199
7.1 Introduction ............................................................................................... 200
7.2 How RTT works .......................................................................................... 201
7.2.1 Target implementation ..................................................................... 201
7.2.2 Locating the Control Block ................................................................201
7.2.3 Internal structures ...........................................................................201
7.2.4 Requirements ..................................................................................202
7.2.5 Performance ................................................................................... 202
7.2.6 Memory footprint .............................................................................202
7.3 RTT Communication .................................................................................... 203
7.3.1 J-Link RTT Viewer ............................................................................203
7.3.2 RTT Client ...................................................................................... 207
7.3.3 RTT Logger ..................................................................................... 207
7.3.4 RTT in other host applications ...........................................................208
7.4 RTT API functions ....................................................................................... 209
7.4.1 JLINK_RTTERMINAL_Control() ........................................................... 209
7.4.2 JLINK_RTTERMINAL_Read() .............................................................. 210
7.4.3 JLINK_RTTERMINAL_Write() .............................................................. 211
7.5 FAQ .......................................................................................................... 212
8 Trace ......................................................................................................................... 213
8.1 Micro trace buffer (MTB) specifics .................................................................214
8.1.1 Manually specifying the MTB unit base address ................................... 214
8.1.2 Manually specifying the MTB buffer address ........................................ 214
8.1.3 Manually specifying the MTB buffer size ............................................. 214
8.2 ETM and Trace on ARM7/9 .......................................................................... 215
8.2.1 General information ......................................................................... 215
8.2.2 ETM ............................................................................................... 215
8.2.3 ETM API functions ........................................................................... 218
8.2.4 Basic operations of the trace buffer ................................................... 220
8.2.5 Trace API functions ..........................................................................222
J-Link ARM SDK (UM08002) © 2004-2019 SEGGER Microcontroller GmbH
20
9 JTAG API ..................................................................................................................225
9.1 General information .................................................................................... 226
9.2 Using the JTAG API .................................................................................... 227
9.3 How the JTAG communication works .............................................................228
9.4 JTAG data buffers .......................................................................................229
9.4.1 Explanation of terms ........................................................................229
9.4.2 Organization of buffers .....................................................................229
9.4.3 Example ......................................................................................... 229
9.4.4 Transfering JTAG data ...................................................................... 231
9.4.5 Screen shots from logic analyzer .......................................................231
9.4.6 Speed - Efficient use ....................................................................... 232
9.5 Getting started ...........................................................................................234
9.6 JTAG API functions ..................................................................................... 235
9.6.1 JLINK_JTAG_ConfigDevices() .............................................................235
9.6.2 JLINKARM_JTAG_GetDeviceId() ......................................................... 236
9.6.3 JLINKARM_JTAG_GetDeviceInfo() ...................................................... 237
9.6.4 JLINKARM_JTAG_GetU8() ................................................................. 238
9.6.5 JLINKARM_JTAG_GetU16() ................................................................238
9.6.6 JLINKARM_JTAG_GetU32() ................................................................238
9.6.7 JLINKARM_JTAG_GetData() ...............................................................239
9.6.8 JLINKARM_JTAG_StoreData() ............................................................ 239
9.6.9 JLINKARM_JTAG_StoreInst() ............................................................. 241
9.6.10 JLINKARM_JTAG_StoreRaw() ........................................................... 242
9.6.11 JLINKARM_JTAG_StoreGetData() ......................................................242
9.6.12 JLINKARM_JTAG_StoreGetRaw() ...................................................... 243
9.6.13 JLINKARM_JTAG_SyncBits() ............................................................ 243
9.6.14 JLINKARM_JTAG_SyncBytes() .......................................................... 243
10 Serial Wire Debug (SWD) .......................................................................................244
10.1 General information .................................................................................. 245
10.2 How the SWD communication works ........................................................... 246
10.3 SWD data buffers ..................................................................................... 247
10.3.1 Explanation of terms ...................................................................... 247
10.3.2 Organization of buffers ...................................................................247
10.3.3 Transfering SWD data .................................................................... 247
10.3.4 Speed - Efficient use ......................................................................248
10.4 Getting started .........................................................................................249
10.5 Using the SWD API ...................................................................................250
10.6 SWD API functions ....................................................................................251
10.6.1 JLINKARM_SWD_GetU8() ................................................................251
10.6.2 JLINKARM_SWD_GetU16() .............................................................. 251
10.6.3 JLINKARM_SWD_GetU32() .............................................................. 252
10.6.4 JLINKARM_SWD_GetData() ............................................................. 252
10.6.5 JLINKARM_SWD_StoreRaw() ........................................................... 252
10.6.6 JLINKARM_SWD_StoreGetRaw() ...................................................... 253
10.6.7 JLINKARM_SWD_SyncBits() .............................................................253
10.6.8 JLINKARM_SWD_SyncBytes() .......................................................... 253
11 Serial Wire Output (SWO) ...................................................................................... 254
11.1 General information .................................................................................. 255
11.1.1 Serial Wire Viewer ......................................................................... 255
11.1.2 Supported SWO speeds .................................................................. 255
11.1.3 Selectable SWO speeds .................................................................. 255
11.2 SWO API functions ................................................................................... 257
11.2.1 JLINKARM_SWO_Control() .............................................................. 257
11.2.2 JLINKARM_SWO_DisableTarget() ...................................................... 258
11.2.3 JLINKARM_SWO_EnableTarget() .......................................................259
11.2.4 JLINKARM_SWO_GetCompatibleSpeeds() .......................................... 260
J-Link ARM SDK (UM08002) © 2004-2019 SEGGER Microcontroller GmbH
剩余328页未读,继续阅读
2020-10-24 上传
2023-06-06 上传
2023-07-21 上传
2019-07-05 上传
2019-09-18 上传
2021-04-27 上传
lihanchao
- 粉丝: 2
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Angular程序高效加载与展示海量Excel数据技巧
- Argos客户端开发流程及Vue配置指南
- 基于源码的PHP Webshell审查工具介绍
- Mina任务部署Rpush教程与实践指南
- 密歇根大学主题新标签页壁纸与多功能扩展
- Golang编程入门:基础代码学习教程
- Aplysia吸引子分析MATLAB代码套件解读
- 程序性竞争问题解决实践指南
- lyra: Rust语言实现的特征提取POC功能
- Chrome扩展:NBA全明星新标签壁纸
- 探索通用Lisp用户空间文件系统clufs_0.7
- dheap: Haxe实现的高效D-ary堆算法
- 利用BladeRF实现简易VNA频率响应分析工具
- 深度解析Amazon SQS在C#中的应用实践
- 正义联盟计划管理系统:udemy-heroes-demo-09
- JavaScript语法jsonpointer替代实现介绍
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功