1.主控MCU是STM32F103,同样的固件,在开发板+TI CC2564模组的应用上BLE可以搜索、连接、通信,而在自制PCBA上面搜索不到BLE,用2540USBDongle进行抓包,没有发现任何广播数据,而HID和SPP模式是可以正常搜索和通信,不过需要把发射功率调大。请问是什么原因?
这个函数调整发射功率是只针对经典蓝牙部分吗?还是包括BLE的发射功率?
int BTPSAPI VS_EnableBLE(unsigned int BluetoothStackID)
{
int Result;
/* Verify that the BluetoothStackID passed in appear valid. */
if(BluetoothStackID)
{
Byte_t Length;
Byte_t Status;
Byte_t *Data;
Word_t OCF;
Byte_t Buffer[32];
Byte_t ReturnLength;
OCF = (Word_t)TEXAS_INSTRUMENTS_VENDOR_SPECIFIC_OCF_BLE_ENABLE;
Length = sizeof(TEXAS_INSTRUMENTS_VENDOR_SPECIFIC_BLE_ENABLE_DATA) – 1;
Data = (Byte_t *)TEXAS_INSTRUMENTS_VENDOR_SPECIFIC_BLE_ENABLE_DATA;
ReturnLength = sizeof(Buffer);
Result = HCI_Send_Raw_Command(BluetoothStackID, HCI_COMMAND_CODE_VENDOR_SPECIFIC_DEBUG_OGF,
OCF, Length, (Byte_t *)Data, &Status, &ReturnLength, Buffer, 0);
/* If the function was not successful, then we */
/* need to flag an error. */
if((Result < 0) || (Status != 0))
Result = BTPS_ERROR_VS_HCI_ERROR;
/* Send output power with 1 —*/
OCF = (Word_t)TEXAS_INSTRUMENTS_VENDOR_SPECIFIC_OCF_LE_OUTPUT_POWER;
Length = 0x01;
Data = (Byte_t *)"\x0A";
ReturnLength = sizeof(Buffer);
Result = HCI_Send_Raw_Command(BluetoothStackID, HCI_COMMAND_CODE_VENDOR_SPECIFIC_DEBUG_OGF,
OCF, Length, (Byte_t *)Data, &Status, &ReturnLength, Buffer, 0);
}
else
Result = BTPS_ERROR_INVALID_PARAMETER;
/* Return the result the caller. */
return(Result);
}
Viki Shi:
根据描述,同样的固件有时正常有时不正常,唯一变量是硬件。我建议排查硬件部分问题,尽量参考TI的官方设计
Yann Wang:
回复 Viki Shi:
你好Wiki,我们购买的开发板配套模组是CC2564MODNEM,而自制PCBA使用的是CC2564RVM芯片,在协议栈的使用上有没有区别?是否需要配置特殊的编译选项?
da qin zheng sheng:
芯片有cc2564和cc2564B两种,前者不推荐使用。