(Sorry for my limited English and technical skills.)
Based on my experience, I think USB device controllers in LPC2148, LPC2368, and LPC1768 are very similar, or even the same.
However, the USB device controller in LPC1343 is a little different from LPC2148. It does not have Endpoint interrupt registers and Endpoint realization registers.
More surprising to me, LPC1347 and LPC11Uxx have the same USB device controller, but this USB controller is very different from LPC1343 one.
Some of the LPC13xx, LPC11Uxx have internal USB ROM driver, but some NXP USB Source Code tell me that, some of the USB ROM drivers have bug.
And more surprising to me, NXP decided to use LUFA (Lightweight USB Framework for AVRs, formerly known as MyUSB) as their USB Stack. Some Internet web-pages tell me that, some of the NXP USB example code does NOT work properly.
NXP now provides: Sample Code Bundle, CMSIS driver library, nxpUSBlib software package, LPCOpen Software Development Platform; + LPCXpresso, and ARM's mbed. So many choices confuse me badly.
I have some USBCDC experience based on bertrik's LPCUSB Stack, so I guess I would be able to port USBCDC example of LPCUSB from LPC2368/LPC1768 to LPC1343.
However, I am not so sure about the better/best approach for NXP LPC Series' USB solution; assumed that, what I need is only USBCDC functionality, and my target MCU are LPC1788, LPC1768, LPC1343, and LPC11U14.
1. Is it very difficult to port USBCDC example of LPCUSB from LPC2368/LPC1768 to LPC1343? 2. Is NXP's internal USB ROM driver with their USB Stack ready for production? 3. If I want to design a low cost, low pin count, Cortex-Mx based device, with USBCDC functionality, is there any best approach available? NXP MCU or ST MCU or others? It seems TI's Tiva is always under Preview.
> 1. Is it very difficult to port USBCDC example of LPCUSB from LPC2368/LPC1768 to LPC1343?
Not so much. The USB device engine of LPC1343 is a simplified version of traditional LPC USB SIE on LPC2368/LPC1768 (and LPC 2148). - LPC1343 doesn’t have USB DMA capability. - DMA-related registers (including DMA interrupts) have been gone away. - The device and endpoint interrupts are unified into USBDevInt-St/En/Clr/Set registers.
And then, replacing registers on LPCUSB, you’ll port it into LPC1343, without changing outline of the code flow.
> 2. Is NXP's internal USB ROM driver with their USB Stack ready for production?
The USB on-chip driver on LPC1343 is an early version of ROM driver. - It implements just HID and MSC (Mass-Storage Class). - Customization of driver functionality is not considered at all.
If you would be fully satisfied on its function, you are lucky ;-)
> 3. If I want to design a low cost, low pin count, Cortex-Mx based device, with USBCDC functionality, is there any best approach available?
I recommend you LPC11Uxx.
Tsuneo
Tsuneo,
Many thanks for your help.
I have the hardware of LPC1313(No USB) and LPC1343, so I will start working on the LPCUSB porting to LPC1343, And ignore the possibility of LPC1345/46/47 USBCDC ROM Driver.
LPC1347 is quite different from LPC1313/LPC1343; but in some way, similar to LPC11Uxx, so I guess LPC1345/46/47 are interim products to LPC11Uxx, at least for the USB functionality.
For LPC11Uxx, I found:
nxpUSBlib v0.98b.zip, LPC11Uxx Keil examples New release V1.05-LPCware_1.zip, lpcopen_v2_00a_keil_iar_nxp_lpcxpresso_11u14.zip
I guess for LPC11Uxx USBCDC development, I should use the USBCDC ROM Driver. However, I have no idea about the role of NXP LUFA USB Stack, and should I spend some time to study it.
1. Do you have any recommended USBCDC example for LPC11Uxx?
In this example: It still uses Keil USB Stack.
\LPC11Uxx Keil examples New release V1.05-LPCware\USBCDC
In this example: It uses NXP USBCDC ROM Driver.
\LPC11Uxx Keil examples New release V1.05-LPCware\USBROMDriver\USB_CDC
In this already obsolete example/library: I can see LUFA here ->
\nxpUSBlib v0.98b\libraries\LPCUSBLib\Drivers\USB\Class \nxpUSBlib v0.98b\libraries\LPCUSBLib\Drivers\USB\Core
And LUFA's hardware binding here ->
\nxpUSBlib v0.98b\libraries\LPCUSBLib\Drivers\USB\Core\LPC
But I can not find LUFA's hardware binding in this example:
\lpcopen_v2_00a_keil_iar_nxp_lpcxpresso_11u14\software\LPCUSBLib\Drivers\USB\Core
The organization of LPCOpen is very complex, maybe I missed something. I heard that by using NXP LUFA USB Stack, users are able to do the USB development with or without NXP USB ROM Driver.
2. Is NXP LUFA USB Stack good to use, so that I should study it?
3. Is the USB device engine of LPC11Uxx a further simplified version of traditional LPC USB SIE? Why is it so different? bertrik's LPCUSB Stack, NXP LUFA USB Stack, NXP USB ROM Driver, which one should I use for LPC11Uxx?
Sorry for so many questions.
Many thanks for your help. Your suggestions save me a lot of time. Many thanks.
LUFA (and LPCOpen) is premature. I can't understand what NXP is doing. However, NXP is not the only company that I can't understand. It is amazing that, solutions are getting more and more sophisticated, so that experts don't use them, whereas common developers don't know how to use them.
In this thread, 'something' disappeared.
I noticed this because I discovered 'something' might be very important, so that I went back trying to recheck 'something'. And it is gone.
Ahaha, my post was caught by admin's censorship and deleted by them ;-) They may feel I would claim LUFA too bad.
Your 'something' should be this one,
In this post, a bug on HW->init() of the ROM stack on LPC11Uxx was confirmed. www.lpcware.com/.../hw-init-and-hw-getmemsize-return-seemingly-incorrect-values HW->init() returns wrong mem_base and mem_size, which affect to allocation of following class (HID/CDC/MSC) instances.
Many thanks for your help. The porting to LPC1343 has been done, and seems work.
Saving a copy into my hard-disk should be able to avoid this kind of "It's gone" problem, however it is not easy to find an article in hard-disk with Windows Explorer, when Windows XP is replaced by Windows 7, it gets worse.