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

CC2642R的simple_peripheral例程下到自己做的板子,蓝牙设备无法找到,是什么原因?

编译环境:IAR 8.32  

SDK:simplelink_cc13x2_26x2_sdk_2_40_00_81

使用XDS110仿真器DEBUG时,运行ICall_registerApp(&selfEntity, &syncEvent); 时,出现错误,

请问怎么解决?

Viki Shi:

仅凭描述无法判断,建议从硬件这块排查一下:www.ti.com/…/swra640c.pdf

user5203601:

回复 Viki Shi:

如果正常的,会出现广播的设备名称吗?

Viki Shi:

回复 user5203601:

会,可以被scanner搜索到

user5203601:

回复 Viki Shi:

前面程序运行到ICall_registerApp卡住会报错,现在我使用smart Flash Programmer 2烧写程序的同时也烧写了 cc26x2r1lp_bim_onchip,无论是simple_peripheral工程还是simple_peripheral_oad_onchip工程,debug调试时,ICall_registerApp能执行成功,一直可以往下执行,但是使用其它的设备无法发现此设备的广播名称, 而且我在代码中也没看到有广播的程序代码,是不是没有添加广播的代码?

Viki Shi:

回复 user5203601:

// Setup and start Advertising// For more information, see the GAP section in the User's Guide:// software-dl.ti.com/.../// Create Advertisement set #1 and assign handlestatus = GapAdv_create(&SimplePeripheral_advCallback, &advParams1,&advHandleLegacy);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Load advertising data for set #1 that is statically allocated by the appstatus = GapAdv_loadByHandle(advHandleLegacy, GAP_ADV_DATA_TYPE_ADV,sizeof(advData1), advData1);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Load scan response data for set #1 that is statically allocated by the appstatus = GapAdv_loadByHandle(advHandleLegacy, GAP_ADV_DATA_TYPE_SCAN_RSP,sizeof(scanResData1), scanResData1);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Set event mask for set #1status = GapAdv_setEventMask(advHandleLegacy,GAP_ADV_EVT_MASK_START_AFTER_ENABLE |GAP_ADV_EVT_MASK_END_AFTER_DISABLE |GAP_ADV_EVT_MASK_SET_TERMINATED);// Enable legacy advertising for set #1status = GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Create Advertisement set #2 and assign handlestatus = GapAdv_create(&SimplePeripheral_advCallback, &advParams2,&advHandleLongRange);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Load advertising data for set #2 that is statically allocated by the appstatus = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_ADV,sizeof(advData2), advData2);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Set event mask for set #2status = GapAdv_setEventMask(advHandleLongRange,GAP_ADV_EVT_MASK_START_AFTER_ENABLE |GAP_ADV_EVT_MASK_END_AFTER_DISABLE |GAP_ADV_EVT_MASK_SET_TERMINATED);// Enable long range advertising for set #2status = GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);// Display device addressDisplay_printf(dispHandle, SP_ROW_IDA, 0, "%s Addr: %s",(addrMode <= ADDRMODE_RANDOM) ? "Dev" : "ID",Util_convertBdAddr2Str(pPkt->devAddr));

user5203601:

回复 Viki Shi:

我看到这段代码了,DEBUG的时候也运行到过这里?为什么别的设备就扫描不到它呢?这个广播是永久的还是只短暂的广播一次?

YiKai Chen:

回复 user5203601:

先試試用SmartRf Studio能不能發出BLE Advertising

user5203601:

回复 Viki Shi:

程序DEBUG时,能够运行到广播case SP_PASSCODE_EVT:SimplePeripheral_processPasscode((spPasscodeData_t*)(pMsg->pData));但是还是无法扫描到设备,我的板子以前贴的是CC2640R2F的,除了换了一个48M晶振,直接pin to pin贴上去的,这样会有什么问题吗?

user5203601:

回复 user5203601:

更正下前面的:程序DEBUG时,能够运行到case SP_ADV_EVT:SimplePeripheral_processAdvEvent((spGapAdvEventData_t*)(pMsg->pData));
但是还是无法扫描到设备,我的板子以前贴的是CC2640R2F的,除了换了一个48M晶振,直接pin to pin贴上去的,这样会有什么问题吗?

YiKai Chen:

回复 user5203601:

你有先試試用SmartRf Studio能不能發出BLE Advertising?

赞(0)
未经允许不得转载:TI中文支持网 » CC2642R的simple_peripheral例程下到自己做的板子,蓝牙设备无法找到,是什么原因?
分享到: 更多 (0)