bouffalolab / bouffalo_sdk

BouffaloSDK is the IOT and MCU software development kit provided by the Bouffalo Lab Team, supports all the series of Bouffalo chips. Also it is the combination of bl_mcu_sdk and bl_iot_sdk
Apache License 2.0
362 stars 128 forks source link

Please allow USB host and device at the same time #187

Open harbaum opened 10 months ago

harbaum commented 10 months ago

Please change this:

https://github.com/bouffalolab/bouffalo_sdk/blob/81a1645805de9ebb83666946d1daebbe8fcd7025/components/usb/cherryusb/CMakeLists.txt#L45

to

endif()
if(CONFIG_CHERRYUSB_HOST)

This will allow to use host and device at the same time.

My use case is a device that usually acts as a USB host. But it can optionally be connected to a PC for update. And in that case it needs to be a USB device.

I have tested this and with this change the device can switch roles and works as expected.

gamelaster commented 10 months ago

@harbaum I think it would be better to ask about this here: https://github.com/cherry-embedded/CherryUSB

harbaum commented 10 months ago

No. This CMakefile only exists in the bouffalo sdk and not in cherryusb.