Projects\ble\util\BEM
bem_main.c
文件里把aesKey
的内容更改为自己的
1
2
3
4
static const uint8 aesKey[KEY_BLENGTH] = {
// This dummy key must be replaced by a randomly generated key that is kept secret.
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
};
BEM_CC254XF256.hex
BEM_CC254XF256.hex
下载到芯片Erase,program and verify
Project->Edit Configurations->New
Based on connfiguration
选择my-OAD-A
修改C/C++ Compiler
配置的Preprocessor
选项
在Defind symbols
中添加
1
FEATURE_OAD_SECURE
config
选项卡,在Linker configuration file
的填入
1
$PROJ_DIR$\..\..\common\CC2540\cc254x_f256_imgAe.xcl
BOOTP_E_IMAGE_A
宏定义,根据注释可知,如果当前不是引导程序注释掉#define BOOTP_E_IMAGE_A
Append and verify
.bin
文件,会发现下载完成后,镜像仍然是ABased on connfiguration
选择Encrypted-Boot-ImageA
oad_target.c
,注释掉做引导Image时的那个警告
Based on connfiguration
选择Encrypted-ImageA
修改C/C++ Compiler
配置的Preprocessor
选项
Defind symbols
中把HAL_IMAGE_A
修改为HAL_IMAGE_B
config
选项卡,修改Linker configuration file
内容把$PROJ_DIR$\..\..\common\CC2540\cc254x_f256_imgAe.xcl
改为
1
$PROJ_DIR$\..\..\common\CC2540\cc254x_f256_imgBe.xcl
Projects\ble\util\EBL
修改C/C++ Compiler
配置的Preprocessor
选项
Defind symbols
中添加
1
2
SBL_SIGNER
SBL_SECURE=FALSE
sbl_exec.c
文件中把把aesKey
的内容更改为和BEM工程的一致
1
2
3
4
5
6
7
8
static const uint8 aesKey[KEY_BLENGTH] = {
#if defined AES_TEST_VECS
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF
#else
// This dummy key must be replaced by a randomly generated key that is kept secret.
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
#endif
};
EBL_CC254x_UART0_ALT1.hex
EBL_CC254x_UART0_ALT1.hex
下载到芯片Erase,program and verify
Projects\ble\SimpleBLEPeripheral\CC2541DB\Encrypted-ImageB\Exe
文件夹内的SimpleBLEPeripheral.bin
Load Image
,载入镜像
Encrypt Image
,保存成加密后的bin文件Projects\ble\SimpleBLEPeripheral\CC2541DB\Encrypted-ImageA\Exe
文件夹内的SimpleBLEPeripheral.bin