微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > CC2640 multi_role工程 无法配对绑定

CC2640 multi_role工程 无法配对绑定

时间:10-02 整理:3721RD 点击:

您好:

    缺省的multi_role工程没有配对、绑定的代码,为了添加此配对、绑定功能,我添加了如下:

{    

uint32_t passkey = 0; // passkey "000000"    

uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;    

 uint8_t mitm = TRUE;    

 uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;    

uint8_t bonding = TRUE;

GAPBondMgr_SetParameter(GAPBOND_DEFAULT_PASSCODE, sizeof(uint32_t),  &passkey);

GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);    

GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);    

GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);    

GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);  

 }

在buildConfig.opt文件中打开了-DGAP_BOND_MGR宏。

编译STACK无法通过,提示如下错误信息。请帮忙看下,谢谢了。

Error[Lp011]: section placement failed

          unable to allocate space for sections/blocks with a total estimated minimum size of 0x11da4 bytes (max align 0x4) in <[0x0000f000-0x0001efff]> (total uncommitted space 0xdfd0).

Error[Lp011]: section placement failed

          unable to allocate space for sections/blocks with a total estimated minimum size of 0x518 bytes (max align 0x4) in <[0x20004478-0x200048e7]> (total uncommitted space 0x470).

Error[Lp021]: the destination for compressed initializer batch "P2-1" is placed at an address that is dependent on the size of the batch, which is not allowed when using packbits compression. Consider using "initialize by copy with packing 

= zeros" (or none) instead.

经过调整

--config_def ICALL_STACK0_ADDR=0x0000A000
--config_def ICALL_RAM0_ADDR=0x200043A4

这两个宏后,STACK与APP都能编译通过,但是下载APP后无法正常运行,从IAR上报了一下错误信息出来,请技术帮忙看看,是什么问题?

先忽略warning,不能正常运行的表现是什么?

你是基于BLE2.0还是BLE2.1的?

多谢回复。

其实我要实现的功能就是:(1)使LightBlue能够在连接该蓝牙设备时出现输入配对PIN码的框,用于密码验证。但是没出现该输入框。(2)simple_passcodeCB与 simple_pairStateCB这两个回调函数至始至终都没有进去过。

代码如下:

{

// Setup the GAP Bond Manager.
{
uint32_t passkey = 0; // passkey "000000"
uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8_t mitm = TRUE;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8_t bonding = TRUE;

GAPBondMgr_SetParameter(GAPBOND_DEFAULT_PASSCODE, sizeof(uint32_t), &passkey);
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
}

// Register with bond manager after starting device.
GAPBondMgr_Register((gapBondCBs_t *)&simpleBondCB);

}

// Bond Manager Callbacks
static const gapBondCBs_t simpleBondCB =
{
simple_passcodeCB, // Passcode callback
simple_pairStateCB // Pairing state callback
};

static void simple_passcodeCB(uint8_t *deviceAddr,
uint16_t connectionHandle, uint8_t uiInputs,
uint8_t uiOutputs)
{
    uint32 passcode=123456;

    // Send passcode response
    GAPBondMgr_PasscodeRsp(connectionHandle, SUCCESS, passcode);
}

static void simple_pairStateCB(uint16_t connHandle,
uint8_t state, uint8_t status)
{

}

你看一下工程里的OSAL_SNV的宏定义是多少



Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top