This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SDK_BT_MEM_ALLOC_FAIL?

Hello,

Only modify the new MSPEXP-PAN13XX-SDK-GA's accelerometer sample application as below.

UCHAR dummy_data[280];
API_RESULT appl_spp_write(UCHAR rem_bt_dev_index, UCHAR * data, UINT16 data_len)
{
#if 1
    memset(dummy_data, '0', 278);
    dummy_data[278] = '\r';
    dummy_data[279] = '\n';

    return BT_spp_send(sdk_status[rem_bt_dev_index].spp_connection_handle, dummy_data,
                       280);
#else
    return BT_spp_send(sdk_status[rem_bt_dev_index].spp_connection_handle, data,
                       data_len);
#endif
}

After SPP connected, It's called sdk_error_handler().

Set breakpoint here,check sdk_error_code. it's 22 (SDK_BT_MEM_ALLOC_FAIL?)

I want to send 280bytes data.

Please tell me recover method.

Regards,

Misa

  • Misa,

     

    The error is clearly in the allocation of memory. I am not sure of what part is actually causing it. The stack is likely complaining about the 280 bytes. You could create a larger buffer in your application and send it in several 100-110 byte chunks. This will hopefully solve the issue. Try not to call BT_spp_send with 280 bytes.

     

    Gustavo