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

BLE5.0 HCI Hardware Error

平台:CC2640R2F

SDK:simplelink_cc2640r2_sdk_3_10_00_15

使用的参考代码:ble5stack 之simple_peripheral

问题描述:使用notification给手机发送数据,当每次发送的数据长度达到160字节时,三星的手机作为接收方,设备会死机(发生HCI Hardware Error,Error code =0x81,HW_FAIL_OUT_OF_MEMORY)。而相同的代码,如果oppo reno手机和美图手机作为接收方,设备运行正常。以下是代码,还请指导:

bStatus_t uart_rf_tx( uint8 param, uint16_t len, void *value )
{

bStatus_t status;
uint16_t maloc_len = 0;
attHandleValueNoti_t noti;

noti.pValue = (uint8 *)GATT_bm_alloc( UartTxRxConfigData->connHandle, ATT_HANDLE_VALUE_NOTI, GATT_MAX_MTU, &maloc_len );
if ( noti.pValue != NULL ) //if allocated
{
if(maloc_len >= len)
{
send_data_len = len;
noti.len= len;
}
else
{
send_data_len = maloc_len;
noti.len= maloc_len;
}
// Place data into buffer
memcpy(noti.pValue,value,noti.len);

noti.handle = UartTxRxAttrTbl[2].handle;
// Attempt to send the notification w/ no authentication
status = GATT_Notification( UartTxRxConfigData->connHandle, &noti, 0);
if ( status != SUCCESS ) //if noti not sent
{
GATT_bm_free( (gattMsg_t *)&noti, ATT_HANDLE_VALUE_NOTI );
}
else
{
// Notification is successfully sent, increment counters
;
}
}
else
{
// bleNoResources was returned
asm(" NOP ");
}

}

Viki Shi:

这个报错是内存不够了,建议增加内存试试

user4250809:

回复 Viki Shi:

还想请教一下,ICall的内存如何修改?另外,还是有疑问,为什么其它手机不会内存不足?

user4250809:

回复 Viki Shi:

是哪一部分的内存不够了?如何调整?

Viki Shi:

回复 user4250809:

看下这边:software-dl.ti.com/…/ble-memory_problems.html
手机间的差异不是很了解,建议查下手机的相关参数要求

user4250809:

回复 Viki Shi:

收到,非常感谢!

user4250809:

回复 Viki Shi:

在本工程里,heap 是autosize。通过内存优化,节省了400多字节给到heap,测试了一下,还是报相同的问题。

赞(0)
未经允许不得转载:TI中文支持网 » BLE5.0 HCI Hardware Error
分享到: 更多 (0)