This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Horrible flash write performance in DFU

I've implemented my DFU app on Android(4.3). During the test, I found a strange problem, that the performance of writing image data into swap area is very very slow. My Softdevice is S130 (8.0.0), and the chip is nrf51422-QFAC.

At first I run the primary Bootloader-dfu-dual-bank program on the chip, it failed. The reason was that the hci_mem_pool could not produce the 5th buffer, as the 4 buffers produced before had not yet been consumed. It means the ble transfer speed exceeded the flash write speed. Then I modified the DFU program to the following logic:

1. It allocs one big buffer to cache the image data
2. It engages with the central(android app) that after send 16 packets, the central must wait for its notification.
3. After receiving 16 packets(16 bytes per packets), it called *dfu_data_pkt_handle* function, in which called *pstorage_store* to write the image data into flash (write 256 bytes once, instead of write 16 bytes per time. I think this could improve the performance).
4.In the function dfu_cb_handler, it sends notification to central, then the central passes the next 16 packets.  

After the modification, the DFU process succeed. But it takes too much time. Specifically, sending a 23KB-size image takes 13 minutes.... I didn't calculate the I/O separately, but it's obviously the main part.

I fail to execute DFU using NRF MASTER CONTROL on this new chip and DFU program, possibly because of the version discrepency. But I've executed once on my old chip( NRF51822-QFAA) and softdevice( 6.0.0), the speed was very quick, I remember. So can anybody proposes some suggestions to me to find the key point? Thanks very much!

Parents
  • @xc0903: 13 minute for 23kB is far too slow.

    In our example we set the RX buffer count to 8 I'm not sure why in your case it's limited at 4 ?

    Could you let me know :

    • Connection interval did you use ?

    • Which Android device you used ?

    • Which SDK version ?

    I just tried here with S130 v1.0. and bootloader from Sdk v8.1, I didn't have any issue with the DFU on nRF Master Control Panel app on Galaxy S4 phone. It got updated in roughly 1 minute.

Reply
  • @xc0903: 13 minute for 23kB is far too slow.

    In our example we set the RX buffer count to 8 I'm not sure why in your case it's limited at 4 ?

    Could you let me know :

    • Connection interval did you use ?

    • Which Android device you used ?

    • Which SDK version ?

    I just tried here with S130 v1.0. and bootloader from Sdk v8.1, I didn't have any issue with the DFU on nRF Master Control Panel app on Galaxy S4 phone. It got updated in roughly 1 minute.

Children
No Data
Related