Hello. I got a board that needs to send data to host and on board screen. When I plug the board to a phone charger firmware wont pass the USB Init.
Is there a way to have it work both ways? I figure I could have EFM8 boot without USB Init and enable that in the UI but is there a way to have it automatic? ADC measurement of D+ D- or something?
Also Once USB Init is done it freezes after few seconds of not being connected to host. OSC Susped. I read in USB library you can turn that off but can't find much about VCPxpress other than disabling turn off in windows.
sorry i didn't understand your question here.
i suggest you elaborate the question a bit.
what do you mean by
Is there a way to have it work both ways?
what UI you meant to say here
I figure I could have EFM8 boot without USB Init and enable that in the UI but is there a way to have it automatic?
are you developing the code based on Silabs example?
why you need turn off window? do you mind to tell us what line in the library code you have found that could turn off something
I read in USB library you can turn that off but can't find much about VCPxpress other than disabling turn off in windows.
By "both ways" I mean this. When I plug board to host (windows) firmware will launch fine (USB_Init is at begging on main.) But if I plug the board to a USB phone charger, firmware will get stuck on USB_Init because there is no host. In that situation data should displayed on on board screen.
So I was thinking that by default MCU will turn on without USB_Init and let user enable USB_Init with a press of button or something. But is there a way for firmware just load even without connected host.
I believe USBxpress has a #define variable to not suspend mcu if there is no connection to host. VCPxpress does not have that. Because if host in not connected then efm8 freezes. I only use Block_Write function from VCPxpress library.
#define SLAB_USB_PWRSAVE_MODE (USB_PWRSAVE_MODE_ONVBUSOFF \ /*| USB_PWRSAVE_MODE_ONSUSPEND*/ \ | USB_PWRSAVE_MODE_FASTWAKE)
check RM of EFM8UB1, section 22.2 indicate
a. D+,D- could route to ADC.
b. it supports DCP, CDP, SDP detection.
you could try to use these function in your code.
Silabs has some example code for this feature.