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

FDS not working after SD initialize

HI, I have nrf52832 and I am using latest SDK 14.2.0. 

I am using FDS and the problem is that before setting up BLE fds_record_write works fine but after setting up BLE all data using fds_record_write goes to dirty records. My ble part is just simple central what scanns advertisements and creates connectioin. Here is my main code.


ret_code_t ret;

ret = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(ret);

NRF_LOG_DEFAULT_BACKENDS_INIT();

ret = app_timer_init();
APP_ERROR_CHECK(ret);

NRF_LOG_INFO("RUN\r\n");

//INIT FLASH
fds_register(fds_evt_handler);

NRF_LOG_INFO("Initializing fds...");

ret = fds_init();
APP_ERROR_CHECK(ret);

wait_for_fds_ready();

fds_stat_t stat = {0};

ret = fds_stat(&stat);
APP_ERROR_CHECK(ret);

NRF_LOG_INFO("Found %d valid records.", stat.valid_records);
NRF_LOG_INFO("Found %d dirty records (ready to be garbage collected).", stat.dirty_records);

fds_gc();

//When I call here fds_record_write it works fine

ble_init();

//When I call here fds_record_write it goes to dirty records

Parents Reply
  • Hi, that looks working. I can take it as reference to my project. Thanks.

    <warning> nrf_sdh_ble: RAM starts at 0x20002A68, can be adjusted to 0x20002760.

    <warning> nrf_sdh_ble: RAM size can be adjusted to 0xD8A0.

    <info> app: UART Start!

    <info> app: fds_test_write()

    <info> app: read from record: 

    <info> app: DEADBEEF

    <info> app: DEADBEEF

    <info> app: DEADBEEF

    <info> app: DEADBEEF

    <info> app: DEADBEEF

    <info> app: DEADBEEF

    <info> app: 

    <info> app: Found 6 valid records.

    <info> app: Found 0 dirty records (ready to be garbage collected).

Children
No Data
Related