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

USBD_MSD Disk initialization fails in USB unplug with SDK15.0

After unplugging the USB, disk initialization fails in usbd_user_ev_handler function function (case: APP_USBD_EVT_STOPPED). If I connect and disconnect a second time, it works.

Parents
  • Hi.


    I had the almost the same issue. After any access to the files via the USB, the file system was demolished after internal flash access.
    I added additional logs to the SDK in QSPI module and it has shown me, that QSPI uninit function (block_dev_qspi_uninit), called after unplugging the USB, was busy (return with NRF_ERROR_BUSY).

    I add this code at the beggining of block_dev_qspi_uninit:


    if ((p_work->state != NRF_BLOCK_DEV_QSPI_STATE_IDLE))

    {

     wait_for_idle(p_qspi_dev);

    }


    It fixed the problem.

    Best regards
    Artur

Reply
  • Hi.


    I had the almost the same issue. After any access to the files via the USB, the file system was demolished after internal flash access.
    I added additional logs to the SDK in QSPI module and it has shown me, that QSPI uninit function (block_dev_qspi_uninit), called after unplugging the USB, was busy (return with NRF_ERROR_BUSY).

    I add this code at the beggining of block_dev_qspi_uninit:


    if ((p_work->state != NRF_BLOCK_DEV_QSPI_STATE_IDLE))

    {

     wait_for_idle(p_qspi_dev);

    }


    It fixed the problem.

    Best regards
    Artur

Children
Related