This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Crash when writing > 20 bytes (from Android)

Hi,

I'm trying to write more than 20 bytes to a custom characteristic, from Android (Cordova BLE Central), but this completely crashes my App

APP_ERROR:ERROR:Fatal

I'm using SDK 12.1 App Template, plus the LED & Button example service LBS

I set the LED (Write) characteristic to have a max size of 256 like this

   attr_md.vloc       = BLE_GATTS_VLOC_STACK;
    attr_md.rd_auth    = 0;
    attr_md.wr_auth    = 0;
    attr_md.vlen       = 0;// variable length set to false (disabled)
    
    memset(&attr_char_value, 0, sizeof(attr_char_value));

    attr_char_value.p_uuid       = &ble_uuid;
    attr_char_value.p_attr_md    = &attr_md;
    attr_char_value.init_len     = sizeof(uint8_t);
    attr_char_value.init_offs    = 0;
    attr_char_value.max_len      = 256;//sizeof(uint16_t);
    attr_char_value.p_value      = NULL;

Do I need to increase some buffer size so I can send more than 20 bytes.

BTW. I am using the nRF51822QFAA (16k) and have the IRAM setting at 0x20001FE8

But perhaps I need to give the SD more RAM ??

Parents
  • Thanks guys

    I know that the max data transfer size is 20 byes, but I didnt expect the Application to have a fatal error if someone attempts to send more than 20 bytes.

    I'd expect the SD to just reject the write, or truncate the data.

    Crashing is a problem for me, as I keep some history data in RAM and it will be lost if the application cashes. (Writing data to Flash is not really an option as it would wear the flash out as it has limited write cycles

    Perhaps this is a bug in the S130 SD V2,0

    However its a bit of a pain to have to rebuild the same app for S130 SD V1.0 (even though its just an app for testing the connection to Android (Cordova)

    Edit I guess I need to retest this on a non-custom service, that has a Write characteristic

Reply
  • Thanks guys

    I know that the max data transfer size is 20 byes, but I didnt expect the Application to have a fatal error if someone attempts to send more than 20 bytes.

    I'd expect the SD to just reject the write, or truncate the data.

    Crashing is a problem for me, as I keep some history data in RAM and it will be lost if the application cashes. (Writing data to Flash is not really an option as it would wear the flash out as it has limited write cycles

    Perhaps this is a bug in the S130 SD V2,0

    However its a bit of a pain to have to rebuild the same app for S130 SD V1.0 (even though its just an app for testing the connection to Android (Cordova)

    Edit I guess I need to retest this on a non-custom service, that has a Write characteristic

Children
No Data
Related