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 disconnection problem

Other Parts Discussed in Thread: CC2541, TRF7970A

Hi,

I am working on a project that already exists where we have BLE working fine. I now need to implement RFID reading. The RFID reading can take around 30-50ms

When I put a go to read a tag, the BLE disconnects and gives me the reason for it as: LL_STATUS_ERROR_CONN_TIMING_FAILURE

I have tried to increase the desired minimum connection interval to 200ms which should be more than enough time

Can anyone help explain why this might be happening?

  • Are you also changing the max connection interval? You can also set the slave latency which allows the cc2541 to skip connection events. 

    Are you checking to make sure the master is accepting those connection parameters? You can do this with a packet sniffer, or watching spikes in current consumption.

    HCI_EXT_ConnEventNoticeCmd() will tell you when a connection event happens. That way you can time you RFID event to happen right when the 50ms window starts.

  • Hi Peter,

    The slave latency is set to 4 and the max desired connection interval is set to 240ms. It isn't code I originally wrote but the comments says IOs (which is the master) does not like a maximum connection interval of more than 240ms.

    I tried changing the connection interval to 60 and 100 and it seems more stable. However if I change it to 60 and 80 it hardly works at all. There is some sort of connection between min and max?

    I occasionally now get UPDATE_PARAMS_TIMEOUT_EVT when it tries to change the connection interval. 

  • Hi,

    I am now getting a UPDATE_PARAMS_TIMEOUT_EVT pretty much 4/5 times. Can anyone help with this problem? When it does connect successfully it works fine.
  • Garry,

    If this is at all helpful, I ran into a similar issue last year implementing continuous reading (Read multiple blocks) of an ISO15693 tag using the CC2541 and TRF7970A. I fiddled quite a bit with the connection interval challenges, and was unable to fix it that way. I ended up splitting it up into a few batches of separate reads, and that worked for me and solved the problem.

    I also saw a similar sort of strange behavior when the power source for the CC2541 was not sufficient, i.e. the current draw from the TRF7970A while the RF field was on caused the CC2541 to reset.

    Hope this helps, good luck!
  • Michael,

    I ended up moving the function that read from the RFID to somewhere else in the code which stopped these problems. I'm not sure why I was getting timeouts because of it, but I guess it must be very sensitive to timings etc...it seems fine now anyway
  • Hi Gary,

    How much time does the RFID read take?

    Although you may have set Min/Max connection interval and slave latency values, you may not be requesting the host to update the connection parameters to the values that you want. For this please call the function

        GAPRole_SetParameter(GAPROLE_PARAM_UPDATE_ENABLE, sizeof(uint8_t),
                             &enable_update_request);                                                                        // with enable_update_request set a s TRUE.

    Also make sure that the priority of the event where you make the RFID read is lower than that of BLE Stack event. You can add you event task at the end of

    const pTaskEventHandlerFn tasksArr[]

    Regards,

    Arun

  • Arun,

    I think it should take no more than 50ms. 

    enable_update_request is set to true

    I think you are spot on and the problem was due to task issues. I actually had the RFID function at the end of my BLE task main function, which I guess is not really the way to do it and it should have its own task etc.