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

Controller hangs with call to fds_init()

I'm using nrf52 with SDK version 12.0.0. I'm trying to use the FDS for my application. I used one of the existing fds example from link fds_example.

With this example, I call the function "fds_test_init" which in turn calls "fds_init". After debugging, I reached to a point where the function "sd_flash_write" is called and this function declaration is taken from the place "/nRF5SDK/components/softdevice/s132/headers/nrf_soc.h".

It is at the call of this function that the controller hangs with message "Starting target cpu" in the console window.

Below is the definitions of FS & FDS macros:

  • FS_QUEUE_SIZE = 4
  • FS_OP_MAX_RETRIES = 3
  • FS_MAX_WRITE_SIZE_WORDS = 1024
  • FDS_OP_QUEUE_SIZE = 4
  • FDS_CHUNK_QUEUE_SIZE = 8
  • FDS_MAX_USERS = 3
  • FDS_VIRTUAL_PAGES = 3
  • FDS_VIRTUAL_PAGE_SIZE = 2048

Could anyone support me here to understand why the controller hangs at the call of the function "sd_flash_write"?

Thanks in advance.

Parents
  • The example should be used with a SoftDevice, I tested your code, and it runs to while (write_flag==0);, but write_flag never becomes 1, because you haven't enabled the SoftDevice.

    From the documentation of sd_flash_write() you can see that it has different behavior depending if the SoftDevice is enabled or not:

    If the SoftDevice is enabled:
    This call initiates the flash access command, and its completion will be communicated to the
    application with exactly one of the following events:
        - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed.
        - @ref NRF_EVT_FLASH_OPERATION_ERROR   - The command could not be started.
    
    If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the write has been completed.
    
Reply
  • The example should be used with a SoftDevice, I tested your code, and it runs to while (write_flag==0);, but write_flag never becomes 1, because you haven't enabled the SoftDevice.

    From the documentation of sd_flash_write() you can see that it has different behavior depending if the SoftDevice is enabled or not:

    If the SoftDevice is enabled:
    This call initiates the flash access command, and its completion will be communicated to the
    application with exactly one of the following events:
        - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed.
        - @ref NRF_EVT_FLASH_OPERATION_ERROR   - The command could not be started.
    
    If the SoftDevice is not enabled no event will be generated, and this call will return @ref NRF_SUCCESS when the write has been completed.
    
Children
Related