TI中文支持网
TI专业的中文技术问题搜集分享网站

#CC2640 OAD oad_image_tool 用法介绍

oad_image_tool 做OAD升级出现不能正常执行,希望有oad_image_tool使用的相关资料或介绍

Kevin Qiu1:

关于oad_image_tool 请看安装目录:C:/ti/simplelink_cc2640r2_sdk_4_10_00_10/docs/blestack/ble_user_guide/html/oad-secure/tools.html
中的OAD Image Tool章节

yekun kun:

回复 Kevin Qiu1:

你好文件是这样介绍的:

[Optional] For App+Stack or Library OAD Images, trim SNV/Unused Space

Library and App+Stack can generate large OAD images especially if the end application utilizes SNV. (App + Stack will always be large)

SNV can be preserved on the OAD Target device by applying the ‘-r’ command to the OAD Image Tool. The ‘-r’ command will limit the output image to within the range specified. Page alignment must still be preserved, so some 0xFFs may be kept in the image.

For example, to preserve page 31, or a 1 page SNV: the -r :1e000 command can be appended to the post build step:

Listing 93. Modified IAR post-build step to remove SNV from an App+Stack OAD image¶

"$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashROM_OAD_Offchip\Exe\simple_peripheral_cc2640r2lp_app.hex" "$PROJ_DIR$\..\stack\FlashROM\Exe\simple_peripheral_cc2640r2lp_stack.hex" -t offchip -i app --imgVer 0 -ob "$PROJ_DIR$\FlashROM_OAD_Offchip\Exe\simple_peripheral_cc2640r2lp_app_oad.bin" -m 0x0000 -r :0x1e000

The result will be am OAD image file that will not overwrite a target’s 31st page (if used for SNV, adjust as necessary for 2 SNV pages)

Lastly, for Library builds, there will be 0xFFs between the end of the Application + Stack merged section and the SNV. If SNV is being preserved then it is safe to also trim the OAD image to the nearest page.

For example, if a Library OAD image is produced, only takes up the first 15 pages and the SNV does not need to preserved, then append -r :0x0F000 to the post-build step:

Listing 94. Modified IAR post-build step to remove SNV and 0xFFs from a Library OAD image.¶

"$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashROM_StackLibrary_OAD_Offchip\Exe\hid_adv_remote_cc2640r2rc_app.hex" -t offchip -i app --imgVer 0 -ob "$PROJ_DIR$\FlashROM_StackLibrary_OAD_Offchip\Exe\hid_adv_remote_cc2640r2rc_app.bin" -m 0x0000 -r :0xF000

总的来说就是下面两条命令
"$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashROM_StackLibrary_OAD_Offchip\Exe\hid_adv_remote_cc2640r2rc_app.hex" -t offchip -i app –imgVer 0 -ob "$PROJ_DIR$\FlashROM_StackLibrary_OAD_Offchip\Exe\hid_adv_remote_cc2640r2rc_app.bin" -m 0x0000 -r :0xF000

"$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashROM_OAD_Offchip\Exe\simple_peripheral_cc2640r2lp_app.hex" "$PROJ_DIR$\..\stack\FlashROM\Exe\simple_peripheral_cc2640r2lp_stack.hex" -t offchip -i app –imgVer 0 -ob "$PROJ_DIR$\FlashROM_OAD_Offchip\Exe\simple_peripheral_cc2640r2lp_app_oad.bin" -m 0x0000 -r :0x1e000

我修改为:修改Post_build命令行为: $TOOLS_BLE_DIR$\oad\oad_image_tool.exe $PROJ_DIR$\FlashROM_StackLibrary\Exe\ble5_simple_peripheral_cc2640r2lp_app_FlashROM_StackLibrary.hex -t offchip -i app –imgVer 0 -ob $PROJ_DIR$\FlashROM_StackLibrary\Exe\hid_adv_remote_cc2640r2rc_app.bin -m 0x0000 –r 0x0000。

我的HEX文件地址:C:\ti421\simplelink_cc2640r2_sdk_1_40_00_45\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\tirtos\iar\app\FlashROM_StackLibrary\Exe\ble5_simple_peripheral_cc2640r2lp_app_FlashROM_StackLibrary.hex

还有一个疑问OAD_image_tool不是将生成的HEX文件,生成可下载的oad_bin文件吗?如果将源文件pro_build 下$TOOLS_BLE_DIR$\output_converter\output_converter.exe $EXE_DIR$\$TARGET_BNAME$.bin 替换,不是就不能生成hex文件啦,怎么讲hex文件转化为bin文件

Kevin Qiu1:

回复 yekun kun:

我用最新版的SDK会生成hex和_oad.bin文件,你是进行片外oad还是片上?

yekun kun:

回复 Kevin Qiu1:

你好 我使用的是片外 OADSDK 1.40
CMD 编译错误提示

C:\ti421\simplelink_cc2640r2_sdk_1_40_00_45\tools\ble5stack\oad>oad_image_tool.exe 1.hex -t offchip -i app –imgVer 0 -ob 2.bin -m 0x0000 -r 0x0000

******************************************************************************************
Texas Instruments OAD Image Tool
Version: 1.0
******************************************************************************************

OAD Type: offchip
Img Type: APP
Input file(s): 1.hex
Output Hex file: None
Output Bin file: 2.bin

Layout of concatenated input files, per flash sector, before applying –range.
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15
XX0X XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XX00 XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XX00 XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
XXX0 XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX 0000 0000 0000 0000 0000 000X 000x —-
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX X000 0000 0000 0000 0000 0000 0000 —-
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX X000 0000 0000 0000 0000 0000 0000 —-
XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX X000 0000 0000 0000 0000 0000 0000 —-
Legend: `X` 100% full, `x` >50% full, `.` <50% full, `-` empty, `F` all 0xFF,`0` all 0x00.
******************************************************************************************
Runtime Output:

Fatal Error: — The provided metadata location (0x00000000) is not empty. Exiting.
这是什么意思?

yekun kun:

回复 Kevin Qiu1:

ble5_simple_peripheral_cc2640r2lp_app_FlashROM_StackLibrary.zip这个是我生成的HEX

Kevin Qiu1:

回复 yekun kun:

这段地址不为空,已经被用了

yekun kun:

回复 Kevin Qiu1:

为什么会出现这个现象 ICF配置不对吗

Kevin Qiu1:

回复 yekun kun:

已在另一帖回复你,集中到一个帖子讨论,不要重复发帖

赞(0)
未经允许不得转载:TI中文支持网 » #CC2640 OAD oad_image_tool 用法介绍
分享到: 更多 (0)