Skip to content

usb: Support OBMF over USB 0.91 - #212

Merged
maxdog988 merged 2 commits into
Nuvoton-Israel:dev-tmpfrom
minying0829:dev-tmp
Mar 3, 2026
Merged

maxdog988 merged 2 commits into
Nuvoton-Israel:dev-tmpfrom
minying0829:dev-tmp

Conversation

@minying0829

Copy link
Copy Markdown

[OBMF] Support OBMF class over USB spec 0.91 in the Device side

  • Update interface class codes from 0xFE/0x00/0x01 to 0xEF/0x09/0x01.
  • Extend the Functional Descriptor:
    • Replace bReserved with bMultimessageSupport
    • Add wMaxWrInterruptSize
    • Descriptor struct size: 12 bytes -> 14 bytes
  • Support 4 endpoint layouts (2/3/3/4 EPs):
    • Bulk only
    • Bulk + Interrupt IN
    • Bulk + Interrupt OUT
    • Bulk + Interrupt IN + Interrupt OUT
  • Add "OCP OBMF" string descriptor and assign its index dynamically to iInterface of the USB Interface Descriptor in obmf_interface_config().
  • Add validation in obmf_out_cb:
    • Silently drop transfers shorter than the minimum OBMF-ICP header (< 3 bytes)
  • Add Interrupt IN write bounds checking:
    • Reject data_len > CONFIG_OBMF_INTERRUPT_IN_EP_MPS
  • Add Interrupt OUT callback obmf_int_out_cb():
    • validate header then call ops->int_read()
  • Add some new configurations to the Kconfig.obmf
    • Split OBMF_INTERRUPT_EP_SUPPORT into:
      • OBMF_INTERRUPT_IN_EP_SUPPORT (default y)
      • OBMF_INTERRUPT_OUT_EP_SUPPORT (default n)
    • Add OBMF_MULTIMESSAGE_SUPPORT (default n).
    • Provide independent OBMF_INTERRUPT_IN/OUT_EP_MPS settings per interrupt endpoint.
  • Set some new configurations to the prj.conf
    • Replace CONFIG_OBMF_INTERRUPT_EP_SUPPORT=n with:
      • CONFIG_OBMF_INTERRUPT_IN_EP_SUPPORT=n
      • CONFIG_OBMF_INTERRUPT_OUT_EP_SUPPORT=n

Signed-off-by: Mia Lin <mimi05633@gmail.com>
- Update OBMF functional descriptor bcdOCPOBMFVersion: 0x0091 -> 0x0100.
- Drop multi-message build-time option and set single-message support:
  - Remove #if CONFIG_OBMF_MULTIMESSAGE_SUPPORT branches
  - Set OBMF_MULTIMESSAGE_VAL to 0x00 (single-message support)
  - Remove Kconfig option OBMF_MULTIMESSAGE_SUPPORT (no longer configurable).
- Rework obmf_status_cb() to clear obmf_buf on USB_DC_RESET and USB_DC_CLEAR_HALT status

Signed-off-by: Mia Lin <mimi05633@gmail.com>
@maxdog988
maxdog988 merged this pull request into Nuvoton-Israel:dev-tmp Mar 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants