diff options
| author | hathach <[email protected]> | 2026-06-29 10:16:25 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-06-29 10:16:25 +0700 |
| commit | 4b1c8d16f72bb5d8f2eb8a2e8dde35abdd2f2a88 (patch) | |
| tree | 3db175aa3d96c92a44fab764dba59f473096c4b4 /examples/device/msc_dual_lun | |
| parent | 0a25cc27d7d3699536f6df01e80af3eb0423ce58 (diff) | |
docs: add build-doc tooling and a README for every example
Documentation tooling:
- Add the `build-doc` skill and `tools/build_doc.py` wrapper for local
Sphinx builds (clean / -W / open).
- Enable Markdown (MyST) in conf.py and auto-collect
examples/{device,host,dual}/*/README.md into a 3-level Examples nav
(Examples > Device/Host/Dual > example), noting each page's source
location and normalizing headings to a single H1.
- Remove the stale `.claude/commands/build-doc.md`; point the AGENTS.md
Documentation section at the skill.
Example docs:
- Add a README.md for every device/host/dual example: what it does, USB
interface table, notable tusb_config.h settings, generic CMake + Make
build steps, and how to try it.
- Fold each *_freertos variant into its base README, noting the FreeRTOS
source path and any RTOS-specific behavior.
Generated docs/examples/ output is git-ignored. Builds clean with
`sphinx-build -W`.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'examples/device/msc_dual_lun')
| -rw-r--r-- | examples/device/msc_dual_lun/README.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/examples/device/msc_dual_lun/README.md b/examples/device/msc_dual_lun/README.md new file mode 100644 index 000000000..5433a8737 --- /dev/null +++ b/examples/device/msc_dual_lun/README.md @@ -0,0 +1,47 @@ +# MSC Dual LUN + +A USB Mass Storage device that presents two logical units (LUNs), each a small in-RAM FAT12 disk. + +## What it does + +- Exposes two LUNs, each a 8 KB FAT12 RAM disk containing a `README.TXT` file (`TinyUSB 0` and `TinyUSB 1` volumes). +- Both disks are read/write by default, so host changes are written back to RAM (unless built read-only). +- Pressing the board button marks LUN1 as "not ready" to simulate removable media being absent (e.g. SD card removed). +- Reports a custom SCSI inquiry: vendor `TinyUSB`, product `Mass Storage`, revision `1.0`. +- Runs under no-OS, FreeRTOS or ThreadX (USB device and LED blink as separate tasks under an RTOS). +- LED blink rate indicates bus state (not mounted / mounted / suspended). + +## USB Descriptors + +| Interface | Class driver | +|-----------|--------------| +| 0 | MSC (mass storage) | + +## Configuration + +Notable `tusb_config.h` settings: + +```c +#define CFG_TUD_MSC 1 +#define CFG_TUD_MSC_EP_BUFSIZE 512 +``` + +## Building + +CMake: + +```bash +mkdir build && cd build +cmake -DBOARD=raspberry_pi_pico .. +cmake --build . +``` + +Make: + +```bash +make BOARD=raspberry_pi_pico all +``` + +## Try it + +After plugging in, two removable drives appear on the host, each containing a `README.TXT`. Open or modify the files to exercise reads and writes. Press the board button to make the second drive report "not ready" (medium not present). |
