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.

CC2640 Write Long Characteristics max Limit

Other Parts Discussed in Thread: CC2640, CC2650

Hi TI Support Team,

I am working with CC2640 and using 2_18_00_03 BLE stack. I am currently using SmartRF06EB+CC2650-7ID as aplatform for developing the firmware.

I have started by working with Simple_BLE_Peripheral project and using BTool + Host_test_app as central to test the firmware. I am trying to use Write Long Characteristic GATT command to send 200 bytes to the peripheral. I can read the long characteristic which is initialized to some value. But when i try to write i get an error saying INVALID_SIZE. I also get an info message from BTool saying the device limit to write is 90 bytes. I would like to know whether this is a CC2650 limit or Host_test_app firmware limitation or the limitation of the BTool. Please let me know what is limiting the scenario and what to change to get a 200 byte write. I am attaching the BTool Log. 

I would like to have a response soon. I have had bad reviews about TI support dragging its feet for no reason. Please help me prove that it is incorrect.  I have already tried to search the forum but i could not find a satisfactory answer. 

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Begin Log
[279] : <Tx> - 10:46:16.123
-Type           : 0x01 (Command)
-OpCode         : 0xFD8C (GATT_ReadLongCharValue)
-Data Length    : 0x06 (6) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x0024 (36)
 Offset         : 0x0000 (0)
Dump(Tx):
0000:01 8C FD 06 00 00 24 00 00 00                   ......$...
--------------------------------------------------------------------
[280] : <Rx> - 10:46:16.170
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (Success)
 OpCode         : 0xFD8C (GATT_ReadLongCharValue)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 8C FD 00                      .........
--------------------------------------------------------------------
[281] : <Rx> - 10:46:16.201
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 09:08:07:06:05:04:03:02:01:00:09:08:07:06:05:04:
                  03:02:01:00:09:08
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 09 08 07 06 05 04 03 ................
0010:02 01 00 09 08 07 06 05 04 03 02 01 00 09 08    ...............
--------------------------------------------------------------------
[282] : <Rx> - 10:46:16.264
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 07:06:05:04:03:02:01:00:09:08:07:06:05:04:03:02:
                  01:00:09:08:07:06
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 07 06 05 04 03 02 01 ................
0010:00 09 08 07 06 05 04 03 02 01 00 09 08 07 06    ...............
--------------------------------------------------------------------
[283] : <Rx> - 10:46:16.326
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 05:04:03:02:01:00:09:08:07:06:05:04:03:02:01:00:
                  09:08:07:06:05:04
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 05 04 03 02 01 00 09 ................
0010:08 07 06 05 04 03 02 01 00 09 08 07 06 05 04    ...............
--------------------------------------------------------------------
[284] : <Rx> - 10:46:16.373
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 03:02:01:00:09:08:07:06:05:04:03:02:01:00:09:08:
                  07:06:05:04:03:02
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 03 02 01 00 09 08 07 ................
0010:06 05 04 03 02 01 00 09 08 07 06 05 04 03 02    ...............
--------------------------------------------------------------------
[285] : <Rx> - 10:46:16.435
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 01:00:09:08:07:06:05:04:03:02:01:00:09:08:07:06:
                  05:04:03:02:01:00
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 01 00 09 08 07 06 05 ................
0010:04 03 02 01 00 09 08 07 06 05 04 03 02 01 00    ...............
--------------------------------------------------------------------
[286] : <Rx> - 10:46:16.500
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 09:08:07:06:05:04:03:02:01:00:09:08:07:06:05:04:
                  03:02:01:00:09:08
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 09 08 07 06 05 04 03 ................
0010:02 01 00 09 08 07 06 05 04 03 02 01 00 09 08    ...............
--------------------------------------------------------------------
[287] : <Rx> - 10:46:16.562
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 07:06:05:04:03:02:01:00:09:08:07:06:05:04:03:02:
                  01:00:09:08:07:06
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 07 06 05 04 03 02 01 ................
0010:00 09 08 07 06 05 04 03 02 01 00 09 08 07 06    ...............
--------------------------------------------------------------------
[288] : <Rx> - 10:46:16.625
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 05:04:03:02:01:00:09:08:07:06:05:04:03:02:01:00:
                  09:08:07:06:05:04
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 05 04 03 02 01 00 09 ................
0010:08 07 06 05 04 03 02 01 00 09 08 07 06 05 04    ...............
--------------------------------------------------------------------
[289] : <Rx> - 10:46:16.687
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x1C (28) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x16 (22)
 Value          : 03:02:01:00:09:08:07:06:05:04:03:02:01:00:09:08:
                  07:06:05:04:03:02
Dump(Rx):
0000:04 FF 1C 0D 05 00 00 00 16 03 02 01 00 09 08 07 ................
0010:06 05 04 03 02 01 00 09 08 07 06 05 04 03 02    ...............
--------------------------------------------------------------------
[290] : <Rx> - 10:46:16.734
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x08 (8) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x02 (2)
 Value          : 01:00
Dump(Rx):
0000:04 FF 08 0D 05 00 00 00 02 01 00                ...........
--------------------------------------------------------------------
[291] : <Rx> - 10:46:16.749
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x050D (1293) (ATT_ReadBlobRsp)
 Status         : 0x1A (26) (The Procedure Is Completed)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x00 (0)
Dump(Rx):
0000:04 FF 06 0D 05 1A 00 00 00                      .........
--------------------------------------------------------------------
[292] : <Info> - 10:49:30.539
GATT Write Command Data Length Exceeds Device Write Limit
Command Data Length = 200
Device Write Limit = 90
Multiple Write Commands Will Be Used To Send The Data
--------------------------------------------------------------------
[293] : <Tx> - 10:49:30.539
-Type           : 0x01 (Command)
-OpCode         : 0xFD96 (GATT_WriteLongCharValue)
-Data Length    : 0x60 (96) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x0024 (36)
 Offset         : 0x0000 (0)
 Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22
Dump(Tx):
0000:01 96 FD 60 00 00 24 00 00 00 11 22 11 22 11 22 ...`..$...."."."
0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0020:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0030:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0040:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0050:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0060:11 22 11 22                                     ."."
--------------------------------------------------------------------
[294] : <Rx> - 10:49:30.602
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (Success)
 OpCode         : 0xFD96 (GATT_WriteLongCharValue)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 96 FD 00                      .........
--------------------------------------------------------------------
[295] : <Error> - 10:49:30.929
ATT Command Failed
Command = ATT_ExecuteWriteReq
Handle = 0x0024
Error = The Attribute Value Length Is Invalid For The Operation.
--------------------------------------------------------------------
[296] : <Rx> - 10:49:30.929
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x0A (10) bytes(s)
 Event          : 0x0501 (1281) (ATT_ErrorRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x04 (4)
 ReqOpCode      : 0x18 (ATT_ExecuteWriteReq)
 Handle         : 0x0024 (36)
 ErrorCode      : 0x0D (13) (INVALID_SIZE)
                  The Attribute Value Length Is Invalid 
                  For The Operation.
Dump(Rx):
0000:04 FF 0A 01 05 00 00 00 04 18 24 00 0D          ..........$..
--------------------------------------------------------------------
[297] : <Tx> - 10:49:30.929
-Type           : 0x01 (Command)
-OpCode         : 0xFD96 (GATT_WriteLongCharValue)
-Data Length    : 0x60 (96) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x0024 (36)
 Offset         : 0x005A (90)
 Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22:11:22:11:22:11:22
Dump(Tx):
0000:01 96 FD 60 00 00 24 00 5A 00 11 22 11 22 11 22 ...`..$.Z.."."."
0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0020:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0030:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0040:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0050:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
0060:11 22 11 22                                     ."."
--------------------------------------------------------------------
[298] : <Rx> - 10:49:30.992
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (Success)
 OpCode         : 0xFD96 (GATT_WriteLongCharValue)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 96 FD 00                      .........
--------------------------------------------------------------------
[299] : <Rx> - 10:49:31.302
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x0A (10) bytes(s)
 Event          : 0x0501 (1281) (ATT_ErrorRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x04 (4)
 ReqOpCode      : 0x18 (ATT_ExecuteWriteReq)
 Handle         : 0x0024 (36)
 ErrorCode      : 0x0D (13) (INVALID_SIZE)
                  The Attribute Value Length Is Invalid 
                  For The Operation.
Dump(Rx):
0000:04 FF 0A 01 05 00 00 00 04 18 24 00 0D          ..........$..
--------------------------------------------------------------------
[300] : <Tx> - 10:49:31.302
-Type           : 0x01 (Command)
-OpCode         : 0xFD96 (GATT_WriteLongCharValue)
-Data Length    : 0x1A (26) byte(s)
 ConnHandle     : 0x0000 (0)
 Handle         : 0x0024 (36)
 Offset         : 0x00B4 (180)
 Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                  11:22:11:22
Dump(Tx):
0000:01 96 FD 1A 00 00 24 00 B4 00 11 22 11 22 11 22 ......$...."."."
0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22       ."."."."."."."
--------------------------------------------------------------------
[301] : <Rx> - 10:49:31.342
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x06 (6) bytes(s)
 Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
 Status         : 0x00 (0) (Success)
 OpCode         : 0xFD96 (GATT_WriteLongCharValue)
 DataLength     : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 96 FD 00                      .........
--------------------------------------------------------------------
[302] : <Rx> - 10:49:31.512
-Type           : 0x04 (Event)
-EventCode      : 0x00FF (HCI_LE_ExtEvent)
-Data Length    : 0x0A (10) bytes(s)
 Event          : 0x0501 (1281) (ATT_ErrorRsp)
 Status         : 0x00 (0) (Success)
 ConnHandle     : 0x0000 (0)
 PduLen         : 0x04 (4)
 ReqOpCode      : 0x18 (ATT_ExecuteWriteReq)
 Handle         : 0x0024 (36)
 ErrorCode      : 0x0D (13) (INVALID_SIZE)
                  The Attribute Value Length Is Invalid 
                  For The Operation.
Dump(Rx):
0000:04 FF 0A 01 05 00 00 00 04 18 24 00 0D          ..........$..
--------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End Log
  • Here's the log for successful 90 bytes read and write.

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Begin Log
    [364] : <Tx> - 11:46:32.978
    -Type           : 0x01 (Command)
    -OpCode         : 0xFD8C (GATT_ReadLongCharValue)
    -Data Length    : 0x06 (6) byte(s)
     ConnHandle     : 0x0000 (0)
     Handle         : 0x0024 (36)
     Offset         : 0x0000 (0)
    Dump(Tx):
    0000:01 8C FD 06 00 00 24 00 00 00                   ......$...
    --------------------------------------------------------------------
    [365] : <Rx> - 11:46:33.025
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFD8C (GATT_ReadLongCharValue)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 8C FD 00                      .........
    --------------------------------------------------------------------
    [366] : <Rx> - 11:46:33.072
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 09:08:07:06:05:04:03:02:01:00:09:08:07:06:05:04:
                      03:02:01:00:09:08
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 09 08 07 06 05 04 03 ................
    0010:02 01 00 09 08 07 06 05 04 03 02 01 00 09 08    ...............
    --------------------------------------------------------------------
    [367] : <Rx> - 11:46:33.197
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 07:06:05:04:03:02:01:00:09:08:07:06:05:04:03:02:
                      01:00:09:08:07:06
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 07 06 05 04 03 02 01 ................
    0010:00 09 08 07 06 05 04 03 02 01 00 09 08 07 06    ...............
    --------------------------------------------------------------------
    [368] : <Rx> - 11:46:33.321
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 05:04:03:02:01:00:09:08:07:06:05:04:03:02:01:00:
                      09:08:07:06:05:04
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 05 04 03 02 01 00 09 ................
    0010:08 07 06 05 04 03 02 01 00 09 08 07 06 05 04    ...............
    --------------------------------------------------------------------
    [369] : <Rx> - 11:46:33.368
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 03:02:01:00:09:08:07:06:05:04:03:02:01:00:09:08:
                      07:06:05:04:03:02
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 03 02 01 00 09 08 07 ................
    0010:06 05 04 03 02 01 00 09 08 07 06 05 04 03 02    ...............
    --------------------------------------------------------------------
    [370] : <Rx> - 11:46:33.434
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x08 (8) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x02 (2)
     Value          : 01:00
    Dump(Rx):
    0000:04 FF 08 0D 05 00 00 00 02 01 00                ...........
    --------------------------------------------------------------------
    [371] : <Rx> - 11:46:33.449
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x1A (26) (The Procedure Is Completed)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 0D 05 1A 00 00 00                      .........
    --------------------------------------------------------------------
    [372] : <Tx> - 11:49:09.692
    -Type           : 0x01 (Command)
    -OpCode         : 0xFD96 (GATT_WriteLongCharValue)
    -Data Length    : 0x60 (96) byte(s)
     ConnHandle     : 0x0000 (0)
     Handle         : 0x0024 (36)
     Offset         : 0x0000 (0)
     Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22
    Dump(Tx):
    0000:01 96 FD 60 00 00 24 00 00 00 11 22 11 22 11 22 ...`..$...."."."
    0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0020:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0030:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0040:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0050:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0060:11 22 11 22                                     ."."
    --------------------------------------------------------------------
    [373] : <Rx> - 11:49:09.755
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFD96 (GATT_WriteLongCharValue)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 96 FD 00                      .........
    --------------------------------------------------------------------
    [374] : <Rx> - 11:49:10.166
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x0519 (1305) (ATT_ExecuteWriteRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 19 05 00 00 00 00                      .........
    --------------------------------------------------------------------
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End Log
  • Hi team,

    We are using the CC2640 and we are using BTool to write 200 bytes of data and we are getting the following response:

    GATT Write Command Data Length Exceeds Device Write Limit

    Command Data Length = 200

    Device Write Limit = 90

    Multiple Write Commands Will Be Used To Send The Data

    Is there a way to change that Device Write Limit to 200?

    Here is the log from BTool: 

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Begin Log
    [279] : <Tx> - 10:46:16.123
    -Type           : 0x01 (Command)
    -OpCode         : 0xFD8C (GATT_ReadLongCharValue)
    -Data Length    : 0x06 (6) byte(s)
     ConnHandle     : 0x0000 (0)
     Handle         : 0x0024 (36)
     Offset         : 0x0000 (0)
    Dump(Tx):
    0000:01 8C FD 06 00 00 24 00 00 00                   ......$...
    --------------------------------------------------------------------
    [280] : <Rx> - 10:46:16.170
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFD8C (GATT_ReadLongCharValue)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 8C FD 00                      .........
    --------------------------------------------------------------------
    [281] : <Rx> - 10:46:16.201
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 09:08:07:06:05:04:03:02:01:00:09:08:07:06:05:04:
                      03:02:01:00:09:08
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 09 08 07 06 05 04 03 ................
    0010:02 01 00 09 08 07 06 05 04 03 02 01 00 09 08    ...............
    --------------------------------------------------------------------
    [282] : <Rx> - 10:46:16.264
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 07:06:05:04:03:02:01:00:09:08:07:06:05:04:03:02:
                      01:00:09:08:07:06
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 07 06 05 04 03 02 01 ................
    0010:00 09 08 07 06 05 04 03 02 01 00 09 08 07 06    ...............
    --------------------------------------------------------------------
    [283] : <Rx> - 10:46:16.326
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 05:04:03:02:01:00:09:08:07:06:05:04:03:02:01:00:
                      09:08:07:06:05:04
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 05 04 03 02 01 00 09 ................
    0010:08 07 06 05 04 03 02 01 00 09 08 07 06 05 04    ...............
    --------------------------------------------------------------------
    [284] : <Rx> - 10:46:16.373
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 03:02:01:00:09:08:07:06:05:04:03:02:01:00:09:08:
                      07:06:05:04:03:02
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 03 02 01 00 09 08 07 ................
    0010:06 05 04 03 02 01 00 09 08 07 06 05 04 03 02    ...............
    --------------------------------------------------------------------
    [285] : <Rx> - 10:46:16.435
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 01:00:09:08:07:06:05:04:03:02:01:00:09:08:07:06:
                      05:04:03:02:01:00
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 01 00 09 08 07 06 05 ................
    0010:04 03 02 01 00 09 08 07 06 05 04 03 02 01 00    ...............
    --------------------------------------------------------------------
    [286] : <Rx> - 10:46:16.500
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 09:08:07:06:05:04:03:02:01:00:09:08:07:06:05:04:
                      03:02:01:00:09:08
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 09 08 07 06 05 04 03 ................
    0010:02 01 00 09 08 07 06 05 04 03 02 01 00 09 08    ...............
    --------------------------------------------------------------------
    [287] : <Rx> - 10:46:16.562
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 07:06:05:04:03:02:01:00:09:08:07:06:05:04:03:02:
                      01:00:09:08:07:06
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 07 06 05 04 03 02 01 ................
    0010:00 09 08 07 06 05 04 03 02 01 00 09 08 07 06    ...............
    --------------------------------------------------------------------
    [288] : <Rx> - 10:46:16.625
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 05:04:03:02:01:00:09:08:07:06:05:04:03:02:01:00:
                      09:08:07:06:05:04
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 05 04 03 02 01 00 09 ................
    0010:08 07 06 05 04 03 02 01 00 09 08 07 06 05 04    ...............
    --------------------------------------------------------------------
    [289] : <Rx> - 10:46:16.687
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x16 (22)
     Value          : 03:02:01:00:09:08:07:06:05:04:03:02:01:00:09:08:
                      07:06:05:04:03:02
    Dump(Rx):
    0000:04 FF 1C 0D 05 00 00 00 16 03 02 01 00 09 08 07 ................
    0010:06 05 04 03 02 01 00 09 08 07 06 05 04 03 02    ...............
    --------------------------------------------------------------------
    [290] : <Rx> - 10:46:16.734
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x08 (8) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x02 (2)
     Value          : 01:00
    Dump(Rx):
    0000:04 FF 08 0D 05 00 00 00 02 01 00                ...........
    --------------------------------------------------------------------
    [291] : <Rx> - 10:46:16.749
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x050D (1293) (ATT_ReadBlobRsp)
     Status         : 0x1A (26) (The Procedure Is Completed)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 0D 05 1A 00 00 00                      .........
    --------------------------------------------------------------------
    [292] : <Info> - 10:49:30.539
    GATT Write Command Data Length Exceeds Device Write Limit
    Command Data Length = 200
    Device Write Limit = 90
    Multiple Write Commands Will Be Used To Send The Data
    --------------------------------------------------------------------
    [293] : <Tx> - 10:49:30.539
    -Type           : 0x01 (Command)
    -OpCode         : 0xFD96 (GATT_WriteLongCharValue)
    -Data Length    : 0x60 (96) byte(s)
     ConnHandle     : 0x0000 (0)
     Handle         : 0x0024 (36)
     Offset         : 0x0000 (0)
     Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22
    Dump(Tx):
    0000:01 96 FD 60 00 00 24 00 00 00 11 22 11 22 11 22 ...`..$...."."."
    0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0020:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0030:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0040:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0050:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0060:11 22 11 22                                     ."."
    --------------------------------------------------------------------
    [294] : <Rx> - 10:49:30.602
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFD96 (GATT_WriteLongCharValue)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 96 FD 00                      .........
    --------------------------------------------------------------------
    [295] : <Error> - 10:49:30.929
    ATT Command Failed
    Command = ATT_ExecuteWriteReq
    Handle = 0x0024
    Error = The Attribute Value Length Is Invalid For The Operation.
    --------------------------------------------------------------------
    [296] : <Rx> - 10:49:30.929
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x0A (10) bytes(s)
     Event          : 0x0501 (1281) (ATT_ErrorRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x04 (4)
     ReqOpCode      : 0x18 (ATT_ExecuteWriteReq)
     Handle         : 0x0024 (36)
     ErrorCode      : 0x0D (13) (INVALID_SIZE)
                      The Attribute Value Length Is Invalid 
                      For The Operation.
    Dump(Rx):
    0000:04 FF 0A 01 05 00 00 00 04 18 24 00 0D          ..........$..
    --------------------------------------------------------------------
    [297] : <Tx> - 10:49:30.929
    -Type           : 0x01 (Command)
    -OpCode         : 0xFD96 (GATT_WriteLongCharValue)
    -Data Length    : 0x60 (96) byte(s)
     ConnHandle     : 0x0000 (0)
     Handle         : 0x0024 (36)
     Offset         : 0x005A (90)
     Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22:11:22:11:22:11:22
    Dump(Tx):
    0000:01 96 FD 60 00 00 24 00 5A 00 11 22 11 22 11 22 ...`..$.Z.."."."
    0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0020:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0030:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0040:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0050:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0060:11 22 11 22                                     ."."
    --------------------------------------------------------------------
    [298] : <Rx> - 10:49:30.992
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFD96 (GATT_WriteLongCharValue)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 96 FD 00                      .........
    --------------------------------------------------------------------
    [299] : <Rx> - 10:49:31.302
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x0A (10) bytes(s)
     Event          : 0x0501 (1281) (ATT_ErrorRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x04 (4)
     ReqOpCode      : 0x18 (ATT_ExecuteWriteReq)
     Handle         : 0x0024 (36)
     ErrorCode      : 0x0D (13) (INVALID_SIZE)
                      The Attribute Value Length Is Invalid 
                      For The Operation.
    Dump(Rx):
    0000:04 FF 0A 01 05 00 00 00 04 18 24 00 0D          ..........$..
    --------------------------------------------------------------------
    [300] : <Tx> - 10:49:31.302
    -Type           : 0x01 (Command)
    -OpCode         : 0xFD96 (GATT_WriteLongCharValue)
    -Data Length    : 0x1A (26) byte(s)
     ConnHandle     : 0x0000 (0)
     Handle         : 0x0024 (36)
     Offset         : 0x00B4 (180)
     Value          : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
                      11:22:11:22
    Dump(Tx):
    0000:01 96 FD 1A 00 00 24 00 B4 00 11 22 11 22 11 22 ......$...."."."
    0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22       ."."."."."."."
    --------------------------------------------------------------------
    [301] : <Rx> - 10:49:31.342
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFD96 (GATT_WriteLongCharValue)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 96 FD 00                      .........
    --------------------------------------------------------------------
    [302] : <Rx> - 10:49:31.512
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (HCI_LE_ExtEvent)
    -Data Length    : 0x0A (10) bytes(s)
     Event          : 0x0501 (1281) (ATT_ErrorRsp)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     PduLen         : 0x04 (4)
     ReqOpCode      : 0x18 (ATT_ExecuteWriteReq)
     Handle         : 0x0024 (36)
     ErrorCode      : 0x0D (13) (INVALID_SIZE)
                      The Attribute Value Length Is Invalid 
                      For The Operation.
    Dump(Rx):
    0000:04 FF 0A 01 05 00 00 00 04 18 24 00 0D          ..........$..
    --------------------------------------------------------------------
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// End Log
    
    

    We are getting an INVALID_SIZE error when sending more than 90 bytes (no issues for 90 bytes or less).

    Regards,

    Akash Patel

  • Hello Akash,

    You are getting an ATT_ErrorRsp for 90 bytes write length as well. This error is coming from your GATT server, you'll need to look on the server side to see why it's sending an Error Rsp. Perhaps the Characteristic is not configured to accept this size write?

    Best wishes
  • Hello Krutarth, Akash,

    I've joined your posts since they cover the same topic. Can you provide your code changes to simipleGattProfile.c that allows 90+ byte writes?

    Best wishes
  • Here's code for my write attribute function in simple gatt profile.c.

    static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle,
    gattAttribute_t *pAttr,
    uint8_t *pValue, uint16_t len,
    uint16_t offset, uint8_t method)
    {
    bStatus_t status = SUCCESS;
    uint8 notifyApp = 0xFF;

    if ( pAttr->type.len == ATT_BT_UUID_SIZE )
    {
    // 16-bit UUID
    uint16 uuid = BUILD_UINT16( pAttr->type.uuid[0], pAttr->type.uuid[1]);
    switch ( uuid )
    {
    // HACK
    case SIMPLEPROFILE_CHAR1_UUID:

    //Validate the value
    // Make sure it's not a blob oper
    if ( offset == 0 )
    {
    if ( len != SIMPLEPROFILE_CHAR1_LEN )
    {
    status = ATT_ERR_INVALID_VALUE_SIZE;
    }
    }
    else
    {
    status = ATT_ERR_ATTR_NOT_LONG;
    }

    //Write the value
    if ( status == SUCCESS )
    {
    VOID memcpy( pAttr->pValue, pValue, SIMPLEPROFILE_CHAR1_LEN );

    notifyApp = SIMPLEPROFILE_CHAR1;

    }

    break;

    case SIMPLEPROFILE_CHAR3_UUID:

    //Validate the value
    // Make sure it's not a blob oper
    //if ( offset > 0 )
    //{
    if ( len != SIMPLEPROFILE_CHAR3_LEN )
    {
    status = ATT_ERR_INVALID_VALUE_SIZE;
    }
    //}
    //else
    //{
    // status = ATT_ERR_ATTR_NOT_LONG;
    //}

    //Write the value

    if ( status == SUCCESS )
    {
    VOID memcpy( pAttr->pValue, pValue, SIMPLEPROFILE_CHAR3_LEN );
    notifyApp = SIMPLEPROFILE_CHAR3;
    }
    /* uint8 *pCurValue = (uint8 *)pAttr->pValue;
    *pCurValue = pValue[0];
    notifyApp = SIMPLEPROFILE_CHAR3;

    }
    */
    break;

    case GATT_CLIENT_CHAR_CFG_UUID:
    status = GATTServApp_ProcessCCCWriteReq( connHandle, pAttr, pValue, len,
    offset, GATT_CLIENT_CFG_NOTIFY );
    break;

    default:
    // Should never get here! (characteristics 2 and 4 do not have write permissions)
    status = ATT_ERR_ATTR_NOT_FOUND;
    break;
    }
    }
    else
    {
    // 128-bit UUID
    status = ATT_ERR_INVALID_HANDLE;
    }

    // If a characteristic value changed then callback function to notify application of change
    if ( (notifyApp != 0xFF ) && simpleProfile_AppCBs && simpleProfile_AppCBs->pfnSimpleProfileChange )
    {
    simpleProfile_AppCBs->pfnSimpleProfileChange( notifyApp );
    }

    return ( status );
    }

  • Thanks for sharing. Which UUID are you writing? Also, can you use the debugger to see if you are returning a 'status' of non-success to the write operation?

    Best wishes
  • I am using SIMPLEPROFILE_CHAR3_UUID. I don't think the write operation returns a 'status' of non-success since you can actually read the value you have written back correctly. Can you please elaborate on how do yo want me to check the returning status. I am still getting used to CCS.
  • What is the defined value of SIMPLEPROFILE_CHAR3_LEN in your system?

    Best wishes
  • SIMPLEPROFILE_CHAR3_LEN is defined as 200

  • I would expect this conditional to fail:

    if ( len != SIMPLEPROFILE_CHAR3_LEN )
    {
    status = ATT_ERR_INVALID_VALUE_SIZE;
    }

    Since 90 != 200, which seems to indicate what you are observing.

    Can you put a breakpoint on this check and confirm likewise?

    Best wishes
  • I am trying to transfer 200 bytes JXS the 90 bytes log was just to show that i can transfer 90 Bytes successfully if i define SIMPLEPROFILE_CHAR3_LEN to be 90. I do not see an error in that log. When the BTool cannot transfer 200 Bytes it divides the transfer automatically in 90 bytes multiple writes which will definitely give me an error because of the condition "if ( len != SIMPLEPROFILE_CHAR3_LEN )"
    My code can only accept exactly 200 bytes write and i want to have a single long 200 bytes write not multiple writes of 90 bytes. I hope i cleared my question here.
  • Thank you for clarifying. You need to make your WriteAttrCb callback function is more robust since you can't make assumptions about the write offset used by the GATT Client (BTool in this case). Please see an example in Project Zero from SimpleLink Academy with the data_service.c service implementation. You can find the installer for SimpleLink Academy on the BLE Wiki.

    Best wishes
  • Alright thanks for the info i will take a look at Project Zero and modify my code according to that and post the modified code for you to verify.
  • Coming back to this, I did some further research and identified that there is a 90 byte write limitation in BTool if you are initiating the write from the Read/Write tab. There is no limitation if you are using GATT_ReadLongCharValue from the Adv. Commands (GATT) menu.

    Also, on your peripheral (GATT server) side, be sure to set the Prepare Write Queue to match the expected number of bytes you expect to receive, The default queue size is 5, which at the default MTU of 23, is 5 * 18 bytes = 90.

    You can adjust the Prepare Write Queue with GATTServApp_SetParameter with param GATT_PARAM_NUM_PREPARE_WRITES. There is no specified limit, but you are bounded by available HEAPMGR space.

    Best wishes

  • Thanks that clears out some of my questions. I was not using the read/write tab i am using the GATT_WriteLongCharValue from the Adv. Commands (GATT) menu to write 200 bytes to my server.

    I have already changed the GATT_PARAM_NUM_PREPARE_Writes to 20 and there was no problem with the HEAPMGR space.
  • Here's the current log that i have after i updated my code on the peripheral.

    /////////////////////////////////////////////////////////////////Begin Log
    [143] : <Tx> - 06:20:08.644
    -Type : 0x01 (Command)
    -OpCode : 0xFD96 (GATT_WriteLongCharValue)
    -Data Length : 0xCE (206) byte(s)
    ConnHandle : 0x0000 (0)
    Handle : 0x0024 (36)
    Offset : 0x0000 (0)
    Value : 11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22:11:22:11:22:11:22:11:22:
    11:22:11:22:11:22:11:22
    Dump(Tx):
    0000:01 96 FD CE 00 00 24 00 00 00 11 22 11 22 11 22 ......$...."."."
    0010:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0020:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0030:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0040:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0050:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0060:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0070:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0080:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    0090:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    00A0:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    00B0:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    00C0:11 22 11 22 11 22 11 22 11 22 11 22 11 22 11 22 ."."."."."."."."
    00D0:11 22 ."
    --------------------------------------------------------------------
    [144] : <Rx> - 06:20:08.696
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
    Status : 0x00 (0) (Success)
    OpCode : 0xFD96 (GATT_WriteLongCharValue)
    DataLength : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 96 FD 00 .........
    --------------------------------------------------------------------
    [145] : <Rx> - 06:20:09.179
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x0A (10) bytes(s)
    Event : 0x0501 (1281) (ATT_ErrorRsp)
    Status : 0x00 (0) (Success)
    ConnHandle : 0x0000 (0)
    PduLen : 0x04 (4)
    ReqOpCode : 0x16 (ATT_PrepareWriteReq)
    Handle : 0x0024 (36)
    ErrorCode : 0x09 (9) (PREPARE_QUEUE_FULL)
    Too Many Prepare Writes Have Been Queued.
    Dump(Rx):
    0000:04 FF 0A 01 05 00 00 00 04 16 24 00 09 ..........$..
    --------------------------------------------------------------------
    ///////////////////////////////////////////////////////////////////////////////////End Log

    I have changed the host_test_app.c build_Config.opt file to enable Data length extension and i also updated the
    #define DEFAULT_MAX_NUM_WRITES 20 in the gattserverapp.h file
    I still have problem with host test app to send 200 bytes via Btool command GATT_WRITELONGCHAR. Please let me know if you have a solution for this.
  • You're almost there. See my previous post about calling the API for setting the prepare write queue size. Adjusting the #define does not change the size. Another option is to use a larger ATT MTU size, this will reduce the number of queue entries.

    Best wishes
  • Hi JXS ,
    I tried three different ways but still have the same error:
    1> I tried to increase the ATT_MTU size by defining MAX_PDU_SIZE = 255 in predefined symbols doesn't work.
    2>I tried using following API to change the size of queue the function returns "INVALID_PARAMETER" in response. Please let me know what i am doing wrong here.
    uint8_t wl_var =20 ;
    uint8_t stat;
    stat = GATTServApp_SetParameter(GATT_PARAM_NUM_PREPARE_WRITES,1,&wl_var);
    3>I tried using following function
    #define APP_SUGGESTED_PDU_SIZE 251
    #define APP_SUGGESTED_TX_TIME 2120
    HCI_LE_WriteSuggestedDefaultDataLenCmd(APP_SUGGESTED_PDU_SIZE , APP_SUGGESTED_TX_TIME);
    doesn't work

    Let me know where i am going wrong or there is something else that i should try.
  • Hi JXS,
    By increasing MAX_PDU_SIZE and using GATT_ExchangeMTU() function after i established the connection i can read and write 200 bytes. Now my question changes to can we eliminate the step of using GATT_ExchangeMTU() some how.

    Thanks for all the help for resolving previous issue.
  • Hi Krutarth,

    Thanks for letting us know it's working on your side. Regarding "auto setting the MTU", this is not possible as the GATT_ExchangeMTU procedure must be completed to negotiate the MTU for both sides of the connection.

    Best wishes
  • Hi JXS,
    Now i am trying to use Simple BLE Central to read and write the 200 byte long attribute. I configured the central for data length extension and MTU size is updated to 206 bytes and it shows on the LCD. Now when i try to read the value from the peripheral I am able to receive ATT_READ_BLOB_RSP but when i try to access the last data byte i get incorrect value. Please let me know if I am doing something wrong here. I am able to read and write using my Iphone and using Btool but i cannot read using BLE Central firmware.

    Display_print1(dispHandle, 7, 0, "Read rsp: %d", pMsg->msg.readBlobRsp.pvalue[199]);
  • Hi Krutarth,

    With a packet sniffer, are you able to confirm if the value is correctly sent?

    Best wishes
  • Above image is a snapshot from my BLE Protocol Analyzer where you can see the response from the Peripheral when Central requests data.