Reading from flash using FDS while BLE is connected

Hi!

We're holding a large amount of data in flash, and would like to pass it onto the central when connected.

Currently, we're following this process:

1. Read one buffer of size X from flash into a Ram buffer of size X.

2. Start advertising and connect to a central

3. Pass the entire ram buffer to the central in chuncks

4. Disconnect from the central

5. If more Flash buffers are available, Go back to 1 until no more data is stored in flash.

This seems inefficient to me. I'd rather read the flash buffers while we're connected, and not terminate the connection until all flash has been transmitted.

Is there a problem with the approach I'm thinking of? The flash read is non blocking, so the connection may stay open for a bit of time.

Which approach is more efficient in terms of power consumption?

Is there a recommended way of doing this to minimize idle time? (for example have 2 ram buffers- one for transmitting the data over BLE, one for reading the next data from flash?)

Thanks!

  • Hi,

    This seems inefficient to me. I'd rather read the flash buffers while we're connected, and not terminate the connection until all flash has been transmitted.

    I fully agree, and I don't understand the fundamental issue here. There is no problem with reading from flash while in a BLE connection. An in fact, flash is read while in a BLE connection already, as code executes from flash.

    Is there a problem with the approach I'm thinking of? The flash read is non blocking, so the connection may stay open for a bit of time.

    I cannot think of any reason why copying data to RAM earlier rather than later provide any benefits.

    Which approach is more efficient in terms of power consumption?

    Regarding current consumption I doubt you will find any measurable difference in current consumption between the two approaches you describe.

    Is there a recommended way of doing this to minimize idle time? (for example have 2 ram buffers- one for transmitting the data over BLE, one for reading the next data from flash?)

    No, not really. (And I would be suprised if this is where the bottlenecks are in your product).

Related