MDK Key Code 符号说明
最近总有人问MDK里的文件转换问题,关于其中的符号,MDK的文档已经写的够详细了,我再搬一下原文档吧,也许这就是书非借不能读也的原因。
比较典型的应用就是:
armcc bin文件转换:
fromelf.exe使用相对路径:
$KARM\ARMCC\bin\fromelf.exe --bin -o "$L@L.bin" "#L"
$K表示MDK的安装目录
$L表示连接输出的文件目录
@L表示连接输出的文件名
#L表示连接输出的文件名本身引用
如果是用armgcc,则命令要改一改,使用objcopy命令:
转成hex文件
$KARM\ARMGCC\bin\arm-none-eabi-objcopy.exe -O ihex "$L@L.elf" "$L@L.hex"
转成bin文件
$KARM\ARMGCC\bin\arm-none-eabi-objcopy.exe -O binary "$L@L.elf" "$L@L.bin"
注:我的armgcc安装在 D:\Keil_v5\ARM\ARMGCC\ 这里。
以下是MDK原文档,关于其它的一些符号,可以查下面的表。
Key Sequence for Tool Parameters
Use Key Sequences to pass arguments from µVision to external user programs. Key Sequences are combinations of a Key Code and a File Code. Key sequences can be used, for example, in the dialogs Tools, SVCS, Options for Target — User, or from the command line. The following rules apply:
Certain Key Codes have to be duplicated when used from the command line.
To use the symbols $, #, %, @, ~, ^
escape them with $$, ##, %%, @@, ~~, ^^.
Enclose Key Sequences within quotes (" ") when using folder names that might contain special characters (space, ~, or #).
Key Codes and File Codes are listed in the tables below:
Environment Variables
You can use environment variables for passing paths to external programs. This is described explicitly in the respective dialog documentation. Environment variables must be enclosed by curly brackets ({ }). For example, you have defined an environment variable with
SET ProgramFiles(x86)=C:\Program Files (x86).
You can use the environment variable as
{ProgramFiles(x86)} in dialog fields.