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

f_write/f_close cause BLE disconnect

Hardware: nrf52832

SDK: 16.0.0 with FreeRtos, 

Softdevice: S132 7.0

I set configMAX_PRIORITIES to 5 and modified nrf_sdh_freertos_init to set BLE task priority to 4.

My sd card maintain task priority is set to 2.

For BLE NUS service:

#define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**< Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS) /**< Maximum acceptable connection interval (75 ms), Connection interval uses 1.25 ms units. */
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory time-out (4 seconds). */

The NUS service and SD card function works fine when test them separately. But if Operate SD card during NUS connection, I got disconnect with reason:0x8

I have tried to enlarge INTERVAL to 120ms/175ms, also tried to change SLAVE_LATENCY to 4. Problem still exist.

I searched internet and NRF Dev Zone, found some similar question, but none of them can resolve my problem. So I have to raise a new question here. 

 

Parents
  • Hi again

    These pins should not be a problem to use, but I tested it just for good measure on my board as well, and I still don't have any trouble writing to the SD card as you can see in the screenshot from the debug terminal below (the disconnection was done manually by me in the nRFConnect app).

    The SD card I'm using is a 2GB microSD card, with a "regular" FAT format. Our examples should support what is described in the FatFs documentation. I think this format is limited to 4GB, so that might be your issue. You might have to edit some of the FatFs configurations to support larger cards, but I don't think we have tested this.

    The reason your board can't use the BLE app for nRFConnect is that only our first party kit SEGGER IDs are supported, as supporting all kinds of third-party devices would require way more maintenance and work than just our own boards.

    Best regards,

    Simon

Reply
  • Hi again

    These pins should not be a problem to use, but I tested it just for good measure on my board as well, and I still don't have any trouble writing to the SD card as you can see in the screenshot from the debug terminal below (the disconnection was done manually by me in the nRFConnect app).

    The SD card I'm using is a 2GB microSD card, with a "regular" FAT format. Our examples should support what is described in the FatFs documentation. I think this format is limited to 4GB, so that might be your issue. You might have to edit some of the FatFs configurations to support larger cards, but I don't think we have tested this.

    The reason your board can't use the BLE app for nRFConnect is that only our first party kit SEGGER IDs are supported, as supporting all kinds of third-party devices would require way more maintenance and work than just our own boards.

    Best regards,

    Simon

Children
Related