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

Will SDCard's storage operations affect BLE connections?

The project I am working on is to store the data acquired through BLE_uart_c and the data collected by the sensor on SDCard. I use FreeRTOS. The problem is described as follows:
(1) nRF2832, SD132 and SDK15.0 were used.
(2) under the multi-task operation of FreeRTOS, BLE_uart_c, data collection and other tasks all operate normally;
(3) however, as long as the data is stored in SDCard, BLE_uart_c connection will be interrupted and the connection will be reconnected. To solve this problem, I made the following attempts:
First, I write 1 to 20 bytes into SDCard at a rate of 200Hz. Everything is fine, but any more than 30 bytes will cause BLE_Uart_c to disconnect.At first I thought there was a problem with the task priority setting of FreeRTOS, but I tried to change it.The highest priority in FreeRTOS is 5, BLE_uart_c is 4, and "SDCard write task" is 3.
I tried the implementation of "SDCard write task" function again and replaced the SDCard operation with "floating point loop operation", which took much longer time than "SDCard write task". Surprisingly, everything was ok, which means that the task switch of FreeRTOS was all right and there was no problem!
Therefore, I located the problem that the "SDCard write operation" would affect the BLE connection after a certain period of time, but I was not familiar with this and did not know how to solve it.
Somebody can help me, this problem is very anxious, thanks a lot!

Parents
  • Therefore, I located the problem that the "SDCard write operation" would affect the BLE connection after a certain period of time

    I am assuming that you are writing an external flash driver.  I do not think that The operation of this driver should influence the BLE operation itself. 

    however, as long as the data is stored in SDCard, BLE_uart_c connection will be interrupted and the connection will be reconnected

    If there is a proper disconnect and reconnect, then you should be able to see the reason of the disconnect when you get the  BLE_GAP_EVT_DISCONNECTED event. The reason will give you more insights on what happened and might be useful to narrow the problem further down. 

    At this point, it is even hard to say if there is a problem with your task priorities as I have no insights in what your tasks are doing.

Reply
  • Therefore, I located the problem that the "SDCard write operation" would affect the BLE connection after a certain period of time

    I am assuming that you are writing an external flash driver.  I do not think that The operation of this driver should influence the BLE operation itself. 

    however, as long as the data is stored in SDCard, BLE_uart_c connection will be interrupted and the connection will be reconnected

    If there is a proper disconnect and reconnect, then you should be able to see the reason of the disconnect when you get the  BLE_GAP_EVT_DISCONNECTED event. The reason will give you more insights on what happened and might be useful to narrow the problem further down. 

    At this point, it is even hard to say if there is a problem with your task priorities as I have no insights in what your tasks are doing.

Children
Related