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.

RTOS/CC2640R2F: the value I read from cc2640r2f alway is 0 after I using android phone write an characteristic to cc2640r2f board which using simple_peripheral demo.

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2540, CC2564, CC2564C

Tool/software: TI-RTOS

Hi,I'm so sorrry that my english is so bad.the value I read from cc2640r2f alway is 0 after I using android phone write an characteristic  to cc2640r2f board which using simple_peripheral demo;but  the value alway correctly if I using iphone write an characteristic.I don't know how to fix it.can anyone help me?thanks a lot!

  • Can you provide what android app are you using? Which android phone do you have?
    Are you using out of box simple_peripheral project?

    Do you have a packet sniffer, if yes, can you provide sniffer log?
  • My android phone is vivo x7.The value is 0 if I using BLE Reader write and the value is correctly if I using BlueTools write in the same android phone.But the question is if I developing an app to write the characteristic the value is 0.I only have a CC2540 dongle,but it seem to only catch BLE 4.0 data.And I use the multi-role project ,the issue is same to the simple_peripheral .Thank you for your reply!androidTestApp.rar

  • Is my understanding correct that it does not work with your own app, but work with another app in android?

    You should be able to sniff the connection data since it's just write to characteristic.

    Make sure the pairing/bonding is disabled and don't change the PHY setting.

    To make it easy for the sniffer to catch the connection, try to only advertise in only channel (ex: 37).

    Go to peripheral.c file and then under gapRole_init, change the following line:

      gapRole_AdvChanMap = GAP_ADVCHAN_ALL;

    To

      gapRole_AdvChanMap = GAP_ADVCHAN_37;

    It would be easier to see to debug once we get the sniffer log.

  • your understanding are correct!not only my own app but also one of app I provided don't work.The BLE Reader can't work correct if I use it test cc2640r2f.But it work correct if I use BLE Reader to test CC2564 or CC2540.this is the sbuffer log.Is it you need?write_errror.psd

  • I can't see anything wrong in the log. According to the sniffer log, you are writing 0 and also reading 0...
    Can you compare the correct log and error log?
  • Yes,I have compared the correct log and error log.The difference is that whatever I write anything the value of write request alway is 0 if the app dones't work and the value of write request is correct if the app does work.So I think the reason of this issue is the app have some problem,But, when I developing CC2540 and CC2564C I using the same app(BLE Reader) to test my own design board,it work correctly.So,it confuse me.The BLE Stack which I use is  simplelink_cc2640r2_sdk_1_50_00_58.

  • However, in the sniffer log, the data you are sending out is 0. That means there is nothing wrong with CC264R2 returning value 0 when you read it. The problem seems to be the custom android app since you already said when you are using other android app and iPhone, there is no problem.
    Also according to the log, I don't see you discover service and characterisitics. Are you just using hardcoded handle?

    Can you attach log for working correctly version?
  • Thank you for your help!The problem is the app.