MSC needs 64-byte bulk packets and single USB buffers. It also needs the serial-number format in Identity and power settings. Use the MSC guide to add the file-handling code.
|
Setting |
Meaning and generic default |
|
USB_MSC_ENABLE |
Generated MSC marker, always 1. Leave it generated. |
|
USB_MSC_FILES |
Number of published files, every integer 1–8; default 3. Only active files are included. |
|
USB_MSC_LABEL |
Drive label, 1–11 ASCII letters, digits, spaces, underscores or hyphens; not all spaces. Default POSITRONUSB. |
|
USB_MSC_NAME_1 … USB_MSC_NAME_8 |
Filename for each entry. Unique case-insensitive 8.3 names: up to eight letters/digits/underscores/hyphens, optionally a dot and up to three extension characters. No folders; Windows reserved names are rejected. |
|
USB_MSC_SIZE_1 … USB_MSC_SIZE_8 |
Fixed published length in bytes, 1–1041408 per file, subject to the combined disk limit below. Does not allocate a RAM array of that size. |
|
USB_MSC_WRITE_1 … USB_MSC_WRITE_8 |
Allow in-place writes to that existing file. Off means read-only. Your application must store accepted bytes before completing the request. |
The setting numbers start at 1, while runtime file indices start at 0: settings ending _1 describe runtime USB_MSC_File = 0; _8 describes file index 7.
Starter files are DEVICE.TXT/128 bytes/read-only, STATUS.CSV/128 bytes/read-only, and SETTINGS.BIN/64 bytes/writable. Entries 4–8 start as FILE4.BIN through FILE8.BIN, each 512 bytes and read-only.
All files together may occupy at most 2034 sectors of 512 bytes. Round each file's length up separately to a whole sector, then add those sector counts. This is a 1,041,408-byte allocation ceiling, not eight times that capacity. Creating, deleting, renaming, resizing and formatting are unsupported.
Created with the Personal Edition of HelpNDoc: Experience the Power and Ease of Use of HelpNDoc for CHM Help File Generation