Muhammad Saad Nawaz

USB powering mechanism using non-KSDK components

Discussion created by Muhammad Saad Nawaz Employee on Jun 11, 2015

Hi everybody,

 

The power mechanism is controllable in Kinetis SDK components implementing Freescale USB Stack (check box available in fsl_usb_descriptor component) but I couldn't find it in other processor expert components like FSL_USB_STACK. It took me a while to figure out a way to control power mechanism of USB using non-SDK components.

 

Powering mechanism is catered inside configuration descriptors in USB 2.0 standard. In FSL USB Stack, this is implemented in g_config_descriptor() function inside usb_descriptor.c and is enabled for all three powering options (Bus-powered, Self-powered and Remote wake-up). There is no option available in Processor Expert to change it to any specific powering option but once your code is generated from Processor Expert, you can simply update the code in usb_descriptor.c to enable any of the powering option you want:

 

1. Open usb_descriptor.c file in Generated Code folder,

2. In g_config_descriptor, change attributes from BUS_POWERED|SELF_POWERED|(REMOTE_WAKEUP_SUPPORT<<REMOTE_WAKEUP_SHIFT) to any single type to enable only that particular type.

 

Feedback would be appreciated.

 

Regards,

Saad

Outcomes