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

USB device (USBD) controller

How can I modify the USBD example of creating a mass staorage device to have only 1 drive (when I run the example, I get 3) ?

Parents
  • Hi,

    This is covered by the documentation for the example, see this link.

    Quote:

    Every logical unit is a block device instance that describes the physical memories. To choose which block devices should be visible as an MSC logical unit, you must modify BLOCKDEV_LIST.

    The blockdev list looks like this:

    #define BLOCKDEV_LIST() (                                   \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_ram, block_dev),     \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_empty, block_dev),   \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_qspi, block_dev)     \
    )

    So if you only want e.g. the QSPI memory, you can change the blockdev list to this:

    #define BLOCKDEV_LIST() (                                   \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_qspi, block_dev)     \
    )

Reply
  • Hi,

    This is covered by the documentation for the example, see this link.

    Quote:

    Every logical unit is a block device instance that describes the physical memories. To choose which block devices should be visible as an MSC logical unit, you must modify BLOCKDEV_LIST.

    The blockdev list looks like this:

    #define BLOCKDEV_LIST() (                                   \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_ram, block_dev),     \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_empty, block_dev),   \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_qspi, block_dev)     \
    )

    So if you only want e.g. the QSPI memory, you can change the blockdev list to this:

    #define BLOCKDEV_LIST() (                                   \
        NRF_BLOCKDEV_BASE_ADDR(m_block_dev_qspi, block_dev)     \
    )

Children
Related