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/LAUNCHXL-CC2640R2: Bulk Data Transmission via BLE

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CC2640R2F

Tool/software: TI-RTOS

Hi,

I have a 32mb flash over my custom designed card. I save some sensor values over on it when any mobile device is not connected via Bluetooth to my hardware. When any mobile device is connected to the hardware, I just want to send the data stored in the flash just in one shot (as soon as possible) to the mobile device.

I asked this question in another thread but then I just wanted to ask one more question but I could not so I create this thread.

In the previous thread, I got the answer that "I suggest you look into reverting the existing off-chip OAD profile implementation." After that answer, I asked the question below;

-->

As you said, I tried the OAD example and I observed the BTool log screen. In the direction of my observation, I saw that max data packet unit data len is 248 bytes and there were approximately 100ms between two successive packets.

If I am not wrong, a data packet that has max 251 bytes can be sent in 2.5ms (for ble 4.2) and 1.4ms (for ble 5). What I mean that BTool sends the packets as quick as possible, in the meantime, firmware side gets the packet, controls it (maybe) and saves the packet to the flash and this process can take 100ms I think. Is that right?

If this calculation is right, If I can create a 251-byte-packet and send it via BLE in every 2.5ms ( Even though my firmware achieve this time, I think the other side, an app, for example, cannot reach this specs. Am I right?), my 32MB flash can be streamed in approximately 6 minutes. And this time is also too much for me. Is that possible to make it faster? If not, I will not use an external flash to save data in my custom hw design.

The last question, let us assume I will use an external flash, can I split the external flash into two for OAD and saving my sensor data. I mean, one external flash for both of these operations.

Thank you for your time,

Best regards,

Dogus.

  • Hi Dogus,
    Assigning this to an expert for follow-up.
  • Hi Dogus,

    The generic OAD implementation is perhaps not the best starting point for an application that needs throughput. BTool OAD will wait for an acknowledgement before it sends the next packet. This is not really necessary.

    If you want throughput, you'd want to use GATT Notification (from GATT Server) or WriteWithoutResponse (if from GATT Client) since these are complete GATT subprocedures by themselves, and so are allowed to send several frames per connection event.

    The method would be to call GATT_Notification until you get an error response when the TX queue is filled up, and then periodically or based on connection event done callback, call it again.

    There is also a tradeoff when it comes to connection interval. You want it to be long because then you have time for more frames, but also short because then you can retransmit faster if a connection event failed, and also because usually phones can only receive 1-3 frames per connection event anyway.

    Flash write should only be, per the datasheet, 8us per word. But using the BLE5 stack on the CC2640R2 is not really a great idea because that device does not have the BLE5 stack content in ROM, but rather the BLE 4.2 compliant stack in ROM. Perhaps consider CC2642R1 or the regular blestack (not 5) on CC2640R2F.

    I'll direct your attention to some reference examples
    * Throughput example github.com/.../simplelink_sdk-1.40
    * Audio streaming github.com/.../simplelink_cc26x2_sdk-2.30

    Best regards,
    Aslak
  • Hi,

    Thank you for your reply. I will work on your question.

    I am wondering, what are your comments about my final question that is related using external flash both OAD and saving sensor data.

    Also, I am just asking because, in the future of my project, I want to pass it BLE5 from blestack. Normally is that possible with CC2640R2 right?

    Thank you for your time
    Dogus

  • Hi Dogus,

    You can split the external flash however you want, but make sure you configure the OAD profile and BIM project such that they don't think they own the entire flash. You'll also want to ensure that the OAD activity does not overlap with your other external flash accesses.

    Using external flash + BIM you should be able to migrate from blestack to ble5stack, although keep in mind there is much less free space in an ble5stack application.

    Best regards,
    Aslak
  • Hi,

    Thank you for your answers.

    Best regards,

    Dogus