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.

LAUNCHXL-CC2650: "simpleProfileChar5 array" values are overwritten when more than 20 bytes are received from BLE scanner

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650

Hello,

I am using

CCS7.4

Compiler TI V5.2.4

BLE SDK Version  ble_sdk_2_02_07_06

Example "Simple BLE Peripheral"

BLE SCANNER app is used to transmit data from android to CC2650

I have modified code as per said by "YK" from this website "sunmaysky.blogspot.com/.../add-write-capability-to-characteristics.html

Then I done following changes


#define SIMPLEPROFILE_CHAR5_LEN 50

I can write 20 Byte from BLE scanner to CC2650 successfully.

BUT when I transmit more than 20 byte the array

simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] is overwritten.

NOW THE PROBLEM IS:  

When I send alphabets for example data, abcdefghijklmnopqrst, which is stored as 0 to 19 array index that is 20 byte and I get this response where 20 byte are received properly.

as shown in image

But, when I send abcdefghijklmnopqrstuvwxyz which is 26 bytes, array locations from 0 to 5 that is 6 bytes are overwritten and nothing is written at array location after 19. that is array location from 20 onward are blank

and Yes I know that I will have to increase MAX_PDU_SIZE in ble_user_config.h file.

and I have set  #define MAX_PDU_SIZE 50

BUT,

why data is being overwritten

Please give me the solution