AnsweredAssumed Answered

LPC51U68 USB Power Saving & DFU?

Question asked by Andy Ho on Mar 18, 2019
Latest reply on Mar 28, 2019 by Andy Ho

Hi,

I am using LPC51U68 to for joystick application. Joystick now can work perfectly, but still having several issues need to solve, and can't find example in SDK or document, hope I can get help here, thanks:

 

1. For power management, how to modify USB related code to send report only when data change?

    all usb example in SDK ( mouse,keyboard....etc) always send usb report in callback function, no chance to enter low power mode, so I modify the code (refer AN4748.pdf) but without success: 

 

in USB_DeviceHidMouseAction(){

.....

if(button_changed){

        return USB_DeviceHidSend(g_UsbDeviceHidMouse.hidHandle, USB_HID_MOUSE_ENDPOINT_IN, g_UsbDeviceHidMouse.buffer,  USB_HID_MOUSE_REPORT_LENGTH);

else {

       return kStatus_USB_Success; // stuck here

}

....

}

if move the statement to while () in main, and set USB_DEVICE_CONFIG_USE_TASK = 1, usb can't be enumerate

main(){

....

while(1){

......

if(button_changed){

USB_DeviceTaskFn(g_UsbDeviceHidMouse.deviceHandle);

}

......

}

}

please guide me how to do it, and provide the example code in AN4748.pdf 

 

2. Can't find HID power saving example code:

Some MCU provide HID mouse with power saving example, it means mouse will get idle to save power if no mouse movement or left/right click, it save many time to study USB stack.

Use LPCxpresso SDK, I don't know how to do it, USB stack documents provide no much help, maybe study how to merge USB Hid mouse + power_ manage_lpc + utick_wakeup example code? but I know it's not working for my project because it's not for USB power saving. 

So are there any LPC MCU have example code to do HID + mcu power saving using LPCXpresso ? because most of app note found are not coding using LPCXpresso SDK, maybe assembly or LPCOPEN,LPCware, like AN3565.pdf, AN4748.pdf,  no 51u68 ,so maybe can provide example or point out which MCU SDK I can refer to.

 

3. Device firmware update without XXLINK

Same as 2, I am searching for example or guide for firmware update without LPCXpresso, e.g. DFU, flashloader..., are there any document to guide user how many ways and how to do it step by step? it is not possible to design a product like 51u68 LPCXpresso demo board which need another usb and LPC4322 ( even don't know how it can do firmware update).

 

Regards,

Outcomes