Hi,
There are several LPC54628 example projects using the USB ROM stack. I'm working with the CDC project "lpcxpresso54628_rom_dev_cdc_bm".
All the USB ROM examples are configured for full speed operation; I want to change the CDC example to high speed.
After making what I think are the necessary modifications, the call to the Init function in the ROM api fails with error code 0x4000A (ERR_USBD_BAD_MEM_BUF, /**< Bad alignment of buffer passed. */)
The new HS configuration descriptor is properly word aligned.
Has anyone used the ROM stack in high speed mode? Any suggestions or maybe a boiler plate example to share?
Thanks
Joe
Hi all,
I know this is an old topic, but I ran into the same issue. Is there anyone who can share the sources to the solution (or a link to it)?
My final goal is to get the HID based on the ROM stack working for HS USB. Is there anyone who managed to get this up and running?
Thanks in advance.
Daan
Hi Elijah,
Thanks for the quick reply. I'm willing to accept the 64 byte report size limitation (although it is a pity that NXP didn't document this any ware). I took the source shared by Joe in this thread and modified the endpoint descriptors to the correct endpoint size, but I still end up with result 0x4000A (ERR_USBD_BAD_MEM_BUF).
I have no idea how to debug this issue, so any working examples would be appreciated.
BR,
Daan
Any ideas on how to debug this memory buffer issue? Or is there anyone willing to share a working example (highspeed USB using the ROM stack)?
Thanks in advance.
Hi Joe
To change SDK USB demo from FS USB (USB0) to HS USB (USB1), we need to change file :usb_device_config.h
--------------------------
/*! @brief LPC USB IP3511 FS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)
/*! @brief LPC USB IP3511 HS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)
-----------------------
rebuild the project. USB1 should work.
if this can't meet your requirement, please let us know the steps of how to reproduce your issue based on the SDK demo code.
Thanks,
Jun Zhang
Hi
Thanks for the response. Your suggested solution only applies when working with SDK examples which use the firmware USB stack. My issue is with the examples that use the ROM based USB stack.
In particular I tested with the SDK example "lpcxpresso54628_rom_dev_cdc_bm" This example is written for full speed USB and if compiles and runs correctly on my dev card.
To convert the example to high speed I added an HS device config descriptor, a device qualifier descriptor and set up the appropriate clock source and power control. However I found that the ROM based Init() function failed when setting the USBD_API_INIT_PARAM_ parameter .usb_speed to USB_HIGH_SPEED (i.e. 1)
I have gone as far as I'm able with the available documentation and have searched on this forum and the wider Web but not found a solution.
I have zipped the source folder and posted it here so you can see the problem.
Thanks
Joe
I got your reply.
I will work on it and let you know once I work it out.
Thanks
Jun Zhang
HI
For all of usb rom demos in the released SDK, only FS is supported now and in the future.
I meant to upload my revised usb rom HS code to you. But I can't upload because of the code restriction.
If you need, please send me your email address. I will send it to you.
Thanks,
Jun Zhang
Hi,
I also need to use the USB ROM for High-Speed USB. Could you make the solution available here for anyone else to use?
Thanks,
Elijah
Hi Jun Zhang
Thanks very much for this. I would be grateful if you would send you your solution. I'll PM you my contact.
Kind Regards
Joseph
Hi Elijah
Although high speed allows a maximum bulk in/out packet size of 512 bytes, the ROM code only allows the full speed maximum packet size of 64 bytes. I think this was an oversight at the chip design stage which wasn't worth their while to correct (or document). So in the USB descriptor, set wMaxPacketSize to WBVAL(USB_FS_MAX_BULK_PACKET) that is: 64.
Hope this helps.
Joe
I just sent to your email. Please have a look.
Thanks
Jun Zhang