Package adds functionality to expose whole flash or one flash area as block device over USB MSC interface. This allows to read and write to flash from host computer directly to flash. Device will not have file system provided by package so it's up to the system to utilize it.
Add package to application or target pkg.deps: list.
For example following configuration will present content of slot 1 flash as RAW disk.
syscfg.vals: MSC_FLASH_FLASH_AREA_ID: FLASH_AREA_IMAGE_1
To expose entire flash (not single flash area) following configuration could be used:
syscfg.vals: MSC_FLASH_FLASH_ID: 0
If some starting flash sector should not be exposed (used by bootloader), starting offset can be provided. In following example first 16kB of flash will not be visible.
syscfg.vals: MSC_FLASH_FLASH_ID: 0 MSC_FLASH_FLASH_OFFSET: 0x4000
Complete target settings to expose flash could look like this
syscfg.yml:
syscfg.vals: USBD_VID: 0xABCD USBD_PID: 0x1234 USBD_VENDOR_STRING: '"Vendor"' USBD_PRODUCT_STRING: '"FlashDisk"' MSC_FLASH_FLASH_AREA_ID: FLASH_AREA_IMAGE_1
pkg.yml:
pkg.deps: - "@apache-mynewt-core/hw/usb/tinyusb/msc_flash"