【原创出品§转载请注明出处】 出处:http://www.cnblogs.com/libra13179/p/6273415.html

我在这里就交大家怎样制作自己的Pack,(这里是我制作好的http://files.cnblogs.com/files/libra13179/KEIL5%E7%9A%84RTT%E4%B9%8Bpack.zip)

1、用的C:\Program Files (x86)\SEGGER\JLink_V512f\Samples\RTT\SEGGER_RTT_V512f这个压缩文件中程序。制作keil5的pack-LMLPHP

2、添加文件rtt_log.C和rtt_log.H

制作keil5的pack-LMLPHP

3、新增一个Segger.Segger_RTT_Logger.pdsc

制作keil5的pack-LMLPHP

Segger.Segger_RTT_Logger.pdsc的具体内容如下

 <?xml version="1.0" encoding="utf-8"?>

 <package schemaVersion="1.2" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
<vendor>Segger</vendor>
<name>Segger_RTT_Logger</name>
<description>Simple logging functionality for Segger's J-Link Real-Time Terminal</description>
<url></url>
<supportContact>[email protected]</supportContact>
<!-- optional license file -->
<!--
<license>
</license>
--> <releases>
<release version="1.0.1">
2017/01/11 Initial Version (SEGGER_RTT_V512f)
2017/01/11 add rtt_log.c and rtt_log.h
</release>
</releases> <keywords>
<!-- keywords for indexing -->
<keyword>Debug</keyword>
<keyword>Log</keyword>
<keyword>Logging</keyword>
<keyword>J-Link</keyword>
<keyword>Segger</keyword>
</keywords> <!-- apis section (optional - for Application Programming Interface descriptions) -->
<!--
<apis>
</apis>
--> <!-- boards section (mandatory for Board Support Packs) -->
<!--
<boards>
</boards>
--> <!-- devices section (mandatory for Device Family Packs) -->
<!--
<devices>
</devices>
--> <!-- examples section (optional for all Software Packs)-->
<!--
<examples>
</examples>
--> <!-- conditions section (optional for all Software Packs)-->
<!--
<conditions>
</conditions>
--> <!-- component section (optional for all Software Packs)--> <components>
<component Cclass="Segger Tools" Cgroup="Segger RTT Tools Logger" Cversion="1.0.0">
<description>Routines to use the Segger Real-Time Terminal for logging</description>
<files>
<file category="header" name="SEGGER_RTT_V512f\RTT\SEGGER_RTT.h"/>
<file category="header" name="SEGGER_RTT_V512f\RTT\SEGGER_RTT_Conf.h" attr="config"/>
<file category="source" name="SEGGER_RTT_V512f\RTT\SEGGER_RTT.c"/>
<file category="source" name="SEGGER_RTT_V512f\RTT\SEGGER_RTT_printf.c"/>
<file category="header" name="SEGGER_RTT_V512f\rtt_log.h"/>
<file category="source" name="SEGGER_RTT_V512f\rtt_log.c"/>
</files>
</component> </components> <!-- optional taxonomy section for defining new component Class and Group names -->
<!--
<taxonomy>
</taxonomy>
--> </package>

> 参考KEIL的pack文档
http://files.cnblogs.com/files/libra13179/keil%E4%B9%8Bpack%E5%88%B6%E4%BD%9C%E6%96%87%E6%A1%A3.zip

4、将SEGGER_RTT_V512f文件夹和Segger.Segger_RTT_Logger.pdsc进行压缩文件命名为Segger.Segger_RTT_Logger.1.0.1.ZIP,.ZIP后缀修改.pack。

制作keil5的pack-LMLPHP

制作keil5的pack-LMLPHP

5、安装到keil中

制作keil5的pack-LMLPHP

测试我们生成PACK

制作keil5的pack-LMLPHP

制作keil5的pack-LMLPHP

制作keil5的pack-LMLPHP

制作keil5的pack-LMLPHP

编译工程下载后可以看到

制作keil5的pack-LMLPHP

05-11 16:55