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.

CC2541 disconnects after 10~15 Seconds (reason=0x08)

Other Parts Discussed in Thread: CC2541, ASH

Hello All
i am in the process of developing a custom PCB  using cc2541 .At this point i have succes in the following

  1. cc2541 power ups and accepts code
  2. the RF Part is working 
  3. I can connect it to BLE Device Monitor PC App.
  4. I can do  full Attribute read from BLE Device Monitor PC App(see attached file for the attribute read logged data in XML).

0447.read data from cc2541.xml
<?xml version="1.0" encoding="UTF-8"?>
<attributes>
  <attribute>
    <handle>1</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>2</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:03:00:00:2A</value>
  </attribute>
  <attribute>
    <handle>3</handle>
    <type>0x2A00</type>
    <menemonic>Device Name</menemonic>
    <value>54:49:20:42:4C:45:20:4B:65:79:66:6F:62</value>
  </attribute>
  <attribute>
    <handle>4</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:05:00:01:2A</value>
  </attribute>
  <attribute>
    <handle>5</handle>
    <type>0x2A01</type>
    <menemonic>Appearance</menemonic>
    <value>00:00</value>
  </attribute>
  <attribute>
    <handle>6</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>0A:07:00:02:2A</value>
  </attribute>
  <attribute>
    <handle>7</handle>
    <type>0x2A02</type>
    <menemonic>Peripheral Privacy Flag</menemonic>
    <value>00</value>
  </attribute>
  <attribute>
    <handle>8</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>08:09:00:03:2A</value>
  </attribute>
  <attribute>
    <handle>9</handle>
    <type>0x2A03</type>
    <menemonic>Reconnection Address</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>10</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:0B:00:04:2A</value>
  </attribute>
  <attribute>
    <handle>11</handle>
    <type>0x2A04</type>
    <menemonic>Peripheral Preferred Connection Parameters</menemonic>
    <value>50:00:A0:00:00:00:E8:03</value>
  </attribute>
  <attribute>
    <handle>12</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>13</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>20:0E:00:05:2A</value>
  </attribute>
  <attribute>
    <handle>14</handle>
    <type>0x2A05</type>
    <menemonic>Service Changed</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>15</handle>
    <type>0x2902</type>
    <menemonic>Client Characteristic Configuration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>16</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>17</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:12:00:23:2A</value>
  </attribute>
  <attribute>
    <handle>18</handle>
    <type>0x2A23</type>
    <menemonic>System ID</menemonic>
    <value>8C:18:28:00:00:29:6A:BC</value>
  </attribute>
  <attribute>
    <handle>19</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:14:00:24:2A</value>
  </attribute>
  <attribute>
    <handle>20</handle>
    <type>0x2A24</type>
    <menemonic>Model Number String</menemonic>
    <value>4D:6F:64:65:6C:20:4E:75:6D:62:65:72:00</value>
  </attribute>
  <attribute>
    <handle>21</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:16:00:25:2A</value>
  </attribute>
  <attribute>
    <handle>22</handle>
    <type>0x2A25</type>
    <menemonic>Serial Number String</menemonic>
    <value>53:65:72:69:61:6C:20:4E:75:6D:62:65:72:00</value>
  </attribute>
  <attribute>
    <handle>23</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:18:00:26:2A</value>
  </attribute>
  <attribute>
    <handle>24</handle>
    <type>0x2A26</type>
    <menemonic>Firmware Revision String</menemonic>
    <value>46:69:72:6D:77:61:72:65:20:52:65:76:69:73:69:6F:6E:00</value>
  </attribute>
  <attribute>
    <handle>25</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:1A:00:27:2A</value>
  </attribute>
  <attribute>
    <handle>26</handle>
    <type>0x2A27</type>
    <menemonic>Hardware Revision String</menemonic>
    <value>48:61:72:64:77:61:72:65:20:52:65:76:69:73:69:6F:6E:00</value>
  </attribute>
  <attribute>
    <handle>27</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:1C:00:28:2A</value>
  </attribute>
  <attribute>
    <handle>28</handle>
    <type>0x2A28</type>
    <menemonic>Software Revision String</menemonic>
    <value>53:6F:66:74:77:61:72:65:20:52:65:76:69:73:69:6F:6E:00</value>
  </attribute>
  <attribute>
    <handle>29</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:1E:00:29:2A</value>
  </attribute>
  <attribute>
    <handle>30</handle>
    <type>0x2A29</type>
    <menemonic>Manufacturer Name String</menemonic>
    <value>4D:61:6E:75:66:61:63:74:75:72:65:72:20:4E:61:6D:65:00</value>
  </attribute>
  <attribute>
    <handle>31</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:20:00:2A:2A</value>
  </attribute>
  <attribute>
    <handle>32</handle>
    <type>0x2A2A</type>
    <menemonic>IEEE 11073-20601 Regulatory Certification Data List</menemonic>
    <value>FE:00:65:78:70:65:72:69:6D:65:6E:74:61:6C</value>
  </attribute>
  <attribute>
    <handle>33</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>02:22:00:50:2A</value>
  </attribute>
  <attribute>
    <handle>34</handle>
    <type>0x2A50</type>
    <menemonic>PnP ID</menemonic>
    <value>01:0D:00:00:00:10:01</value>
  </attribute>
  <attribute>
    <handle>35</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>36</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>0A:25:00:06:2A</value>
  </attribute>
  <attribute>
    <handle>37</handle>
    <type>0x2A06</type>
    <menemonic>Alert Level</menemonic>
    <value>00</value>
  </attribute>
  <attribute>
    <handle>38</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>39</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>04:28:00:06:2A</value>
  </attribute>
  <attribute>
    <handle>40</handle>
    <type>0x2A06</type>
    <menemonic>Alert Level</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>41</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>42</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>12:2B:00:07:2A</value>
  </attribute>
  <attribute>
    <handle>43</handle>
    <type>0x2A07</type>
    <menemonic>Tx Power Level</menemonic>
    <value>00</value>
  </attribute>
  <attribute>
    <handle>44</handle>
    <type>0x2902</type>
    <menemonic>Client Characteristic Configuration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>45</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>46</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>12:2F:00:19:2A</value>
  </attribute>
  <attribute>
    <handle>47</handle>
    <type>0x2A19</type>
    <menemonic>Battery Level</menemonic>
    <value>64</value>
  </attribute>
  <attribute>
    <handle>48</handle>
    <type>0x2902</type>
    <menemonic>Client Characteristic Configuration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>49</handle>
    <type>0x2908</type>
    <menemonic>Report Reference</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>50</handle>
    <type>0x2800</type>
    <menemonic>GATT Primary Service Declaration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>51</handle>
    <type>0x2803</type>
    <menemonic>GATT Characteristic Declaration</menemonic>
    <value>10:34:00:E1:FF</value>
  </attribute>
  <attribute>
    <handle>52</handle>
    <type>0xFFE1</type>
    <menemonic>Key press state</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>53</handle>
    <type>0x2902</type>
    <menemonic>Client Characteristic Configuration</menemonic>
    <value></value>
  </attribute>
  <attribute>
    <handle>54</handle>
    <type>0x2901</type>
    <menemonic>Characteristic User Description</menemonic>
    <value></value>
  </attribute>
</attributes>

Now i am facing  a problem again.which is that the cc2541 board disconnects after 10~15  Seconds .

with the reason below 

GAP Link Terminated: status=0 h=0 reason=0x08
In the forums i have read that this reason is due to supervision timeout i have change it to a larger value but no effect

 

This is a custom firmware that i have made using the KeyfobDemo App for cc2541.
The notable things i have changed in the firmware is modifying the firmware to use the internal 32K OSC instead of external

Along with that i have tested the same firmware on the orignal Keyfob(cc2541) and it disconnects immediatelty after it connects.

 

Here is the Log of the BLE Device Monitor from start to disconnect 

22:51:23.371 > BLE Host: COM33 115200 baud hardware flowc.
22:51:23.816 > BLE Host found
22:51:23.826 > Scan request ...
22:51:23.827 > GAP Device Init Done
22:51:23.912 > GAP Device Information: status=0 type=0x00 [len=11]
22:51:23.915 > MAC address: BC:6A:29:28:18:8C
22:51:23.916 > Scan resp: ad=0x01 len=2
22:51:23.917 > Scan resp: ad=0x02 len=7
22:51:23.917 > GAP Device Information: status=0 type=0x04 [len=12]
22:51:23.918 > Device found: Keyfobdemo
22:51:27.888 > Scan cancel request ...
22:51:27.903 > Scan finished [4.76 sec]
22:51:27.905 > GAP Device Discovery: 0 devices
22:51:33.915 > Connect request
22:51:34.107 > Gap Link Established: h=0 ci=16 lat=0 to=3200
22:51:34.118 > Keyfobdemo connected
22:51:34.126 > Service discovery started
22:51:34.180 > ATT_ReadByGrpTypeRsp: status=0 n=19
22:51:34.209 > ATT_ReadByGrpTypeRsp: status=0 n=19
22:51:34.248 > ATT_ReadByGrpTypeRsp: status=0 n=13
22:51:34.249 > ATT_ReadByGrpTypeRsp: status=26 n=0
22:51:34.250 > Primary Service Discovery done [0.129 sec]
22:51:34.271 > Characteristic description discovery started
22:51:34.343 > ATT_FindInfoRsp: status=0 n=21
22:51:34.371 > ATT_FindInfoRsp: status=0 n=21
22:51:34.389 > ATT_FindInfoRsp: status=0 n=21
22:51:34.429 > ATT_FindInfoRsp: status=0 n=21
22:51:34.469 > ATT_FindInfoRsp: status=0 n=21
22:51:34.510 > ATT_FindInfoRsp: status=0 n=21
22:51:34.549 > ATT_FindInfoRsp: status=0 n=21
22:51:34.589 > ATT_FindInfoRsp: status=0 n=21
22:51:34.629 > ATT_FindInfoRsp: status=0 n=21
22:51:34.669 > ATT_FindInfoRsp: status=0 n=21
22:51:34.710 > ATT_FindInfoRsp: status=0 n=17
22:51:34.748 > ATT_FindInfoRsp: status=26 n=0
22:51:34.749 > Characteristic Description Discovery done [0.478] sec
22:51:34.761 > Characteristic discovery started
22:51:34.820 > ATT_ReadyByTypeResp: status=0 n=22
22:51:34.849 > ATT_ReadyByTypeResp: status=0 n=22
22:51:34.889 > ATT_ReadyByTypeResp: status=0 n=22
22:51:34.929 > ATT_ReadyByTypeResp: status=0 n=22
22:51:34.969 > ATT_ReadyByTypeResp: status=0 n=22
22:51:35.009 > ATT_ReadyByTypeResp: status=0 n=22
22:51:35.049 > ATT_ReadyByTypeResp: status=0 n=15
22:51:35.087 > ATT_ReadyByTypeResp: status=26 n=0
22:51:35.088 > Characteristic Discovery done [0.327] sec
22:51:35.488 > Attribute read started
22:51:35.545 > ATT_ReadResp: status=0 h=0 n=18, 53 6F 66 74 77 61 72 65 20 52 65 76 69 73 69 6F 6E 00
22:51:35.588 > ATT_ReadResp: status=0 h=0 n=18, 48 61 72 64 77 61 72 65 20 52 65 76 69 73 69 6F 6E 00
22:51:35.628 > ATT_ReadResp: status=0 h=0 n=1, 00
22:51:35.668 > ATT_ReadResp: status=0 h=0 n=1, 00
22:51:35.708 > ATT_ReadResp: status=0 h=0 n=7, 01 0D 00 00 00 10 01
22:51:35.748 > ATT_ReadResp: status=0 h=0 n=2, 00 00
22:51:35.788 > ATT_ReadResp: status=0 h=0 n=1, 64
22:51:35.828 > ATT_ReadResp: status=0 h=0 n=13, 54 49 20 42 4C 45 20 4B 65 79 66 6F 62
22:51:35.868 > ATT_ReadResp: status=0 h=0 n=1, 00
22:51:35.908 > ATT_ReadResp: status=0 h=0 n=8, 50 00 A0 00 00 00 E8 03
22:51:35.948 > ATT_ReadResp: status=0 h=0 n=18, 46 69 72 6D 77 61 72 65 20 52 65 76 69 73 69 6F 6E 00
22:51:35.988 > ATT_ReadResp: status=0 h=0 n=14, 53 65 72 69 61 6C 20 4E 75 6D 62 65 72 00
22:51:36.028 > ATT_ReadResp: status=0 h=0 n=13, 4D 6F 64 65 6C 20 4E 75 6D 62 65 72 00
22:51:36.068 > ATT_ReadResp: status=0 h=0 n=8, 8C 18 28 00 00 29 6A BC
22:51:36.108 > ATT_ReadResp: status=0 h=0 n=14, FE 00 65 78 70 65 72 69 6D 65 6E 74 61 6C
22:51:36.148 > ATT_ReadResp: status=0 h=0 n=18, 4D 61 6E 75 66 61 63 74 75 72 65 72 20 4E 61 6D 65 00
22:51:36.150 > Attribute read done
22:51:39.247 > GAP Link Param Update: 0 0 800 0 1000
22:51:40.858 > Attribute table saved
22:51:49.266 > GAP Link Terminated: status=0 h=0 reason=0x08
22:51:49.279 > Keyfobdemo disconnected

  • Hi,

    The reason '0x08' means the peripheral device disconnects due to Supervision Timeout. You need to set "DEFAULT_UPDATE_CONN_TIMEOUT" parameter to a larger value.

    You can find more information on this here.

    Hope this helps!

    Thanks,

    Dhaval

  • Hello dhaval 
    thanks for the reply .
    first the link you gave for more info is a dead link.

    i have tried to set the Supervision timout in the file  keyfobdemo.c using the parameter  mentioned below

    // Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter update request is enabled
    #define DEFAULT_DESIRED_CONN_TIMEOUT 10000

    Sorry i cannot find where this parameter u specified DEFAULT_UPDATE_CONN_TIMEOUT

    can you tell me where is this parameter

    Secondly why the parameter i have tried to change has no effect

    and what does this means

     if automatic parameter update request is enabled

     

    thanx 
    Zubair

  • I have found just now that i can set the automatic  update request by setting 

    // Whether to enable automatic parameter update request when a connection is formed
    #define DEFAULT_ENABLE_UPDATE_REQUEST TRUE

    which in my case is already TRUE

    so the supervision timeout  i am trying to set  using DEFAULT_DESIRED_CONN_TIMEOUT  should have an effect 


  • DEFAULT_ENABLE_UPDATE_REQUEST determines if your slave device will request the connection parameters you desire. Connection parameters are things like connection intervals and slave latency.  DEFAULT_DESIRED_CONN_TIMEOUT sets how long you are willing to wait for the master to accept your connection parameters. If DEFAULT_ENABLE_UPDATE_REQUEST  is false, DEFAULT_DESIRED_CONN_TIMEOUT  is irrelevant.

    None of this matters because you got error code 8 (supervision timeout) instead of 0x3B (unacceptable connection interval). A supervision timeout basically means your connection is gone and no one knows why. For example, if your slave device loses power, you would get this error. I think you have a problem at the physical level, but that's a guess

  • Hello Peter thanx for the reply
    ok now i know that what are these DEFAULTs

    But i disagree with your thought that this is a problem at physical level because once i set the DEFAULT_ENABLE_UPDATE_REQUEST to FALSE the problem is solved .

    now i am connected and i can read characteristics .I am using simple Keys with two buttons and i can read their state in the BLE device monitor.

    the only problem  in the board's design was the wrong placement of the 2 Caps with the external 32KHz crystal and it was not working so we solved this problem for now by using the INTERNAL 32 KHz OSC.

    The second argument which i want to repeat because i already wrote it in this Question that i have tested the same firmware on the TI Keyfob and the result was immediate disconnection instead of after 10 seconds.

    Now i cannot say that TI Keyfob's design is wrong :)

    The problem is solved but i would love to know what was the reason that it is was disconnecting and what is the reason  that setting DEFAULT_ENABLE_UPDATE_REQUEST to FALSE solved the problem.

    I am new to BLE development so may be i am wrong on a couple of things .
    thanx for listening
    Zubair

  • I may be wrong sometimes. You can read about all this in the TI Software Developer's Guide:  http://www.ti.com/lit/ug/swru271f/swru271f.pdf

  • Hi all, Thanks for the above mentioned discussion. I am facing the same issue with my device (disconnecting after 8-10 sec). I also tried to set FALSE the "Automatic Papramter Update Request", but still its disconnecting after 8-10 sec. Plz let me know, if any thing else is remaining.... Thanks n Regards /Ash
  • Hi
    "disconnecting after 8-10 sec"
    The problem usually is crystal or capacitor of crystal.