Skip to content

Commit

Permalink
hw/usb/tinyusb: Fix sysinit levels so that tinyusb gets initialized
Browse files Browse the repository at this point in the history
before console uses it

hw/usb/tinyusb: Fix sysinit levels so that tinyusb gets initialized
before console uses it

- Changing cdc_console sysinit to 502 adding a new syscfg
  CONSOLE_USB_CDC_SYSINIT_STAGE for CDC USB console
  and use that instead
- Also add restrictions so that usbd is never inited after
  cdc_console
  • Loading branch information
vrahane committed Oct 6, 2023
1 parent b78d14a commit ed7c3da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hw/usb/tinyusb/cdc_console/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ pkg.deps:
- "@apache-mynewt-core/hw/usb/tinyusb/cdc"

pkg.init:
usb_cdc_console_pkg_init: 'MYNEWT_VAL(CONSOLE_SYSINIT_STAGE)'
usb_cdc_console_pkg_init: 'MYNEWT_VAL(CONSOLE_USB_CDC_SYSINIT_STAGE)'
7 changes: 7 additions & 0 deletions hw/usb/tinyusb/cdc_console/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@ syscfg.defs:
syscfg.vals:
USBD_CDC_CONSOLE: 1

syscfg.defs:
CONSOLE_USB_CDC_SYSINIT_STAGE:
description: >
Initialize USB CDC Console at the specified sysinit level
value: 502

syscfg.restrictions:
- "USBD_CDC_CONSOLE"
- CONSOLE_USB_CDC_SYSINIT_STAGE > USBD_SYSINIT_STAGE
2 changes: 2 additions & 0 deletions hw/usb/tinyusb/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ syscfg.defs:
description: >
Sysinit stage for USB device functionality.
value: 500
restrictions:
- CONSOLE_USB_CDC_SYSINIT_STAGE > USBD_SYSINIT_STAGE
USBD_STD_DESCRIPTORS:
description: >
Include descriptor support. This allows to easily use CDC, MSC, HID device
Expand Down

0 comments on commit ed7c3da

Please sign in to comment.