Hello,
I am getting some really strange problems when using the ported usbaudio keil code from this zip file
ics.nxp.com/.../mcb1700.code.bundle.lpc1769.lpcxpresso.zip
with the LPC1769xpresso and the embedded artists base board, it is appearing as a usb composite device, do you think perhaps the usbdesc.c needs to be changed for the newer processor 1769. all jumpers and power seem to be correct.
The NXP LPC1769 site ( " href= "http://ics.nxp.com/support/documents/microcontrollers/zip/mcb1700.code.bundle.lpc17xx.keil.zip"> ics.nxp.com/.../mcb1700.code.bundle.lpc17xx.keil.zip
2) MCB1700 Sample Code Bundle for LPC1769 Peripherals using LPCXpresso, V2.00 (Jan 10, 2011) ics.nxp.com/.../mcb1700.code.bundle.lpc1769.lpcxpresso.zip
I believe the first one is provided by Keil, because the USBAudio example is same as the example distributed with Keil MDK-ARM. The second one, on your first post, seems to be ported from Keil example for LPCXpresso IDE (ie. GCC) (by NXP LPCXpresso team?)
I compared the source files of both bundles for USBAudio. Most of changes are fine. They are based on the difference of packed structure declaration. Just uint8_t --> uint32_t change in USB_ReqSetConfiguration() and USB_ReqSetInterface() (usbcore.c), as pointed out on above post, has introduced bug. Another problem is the mapping to USB DMA RAM In this part of the code, these arrays are mapped to the DMA RAM, starting from 0x2007 c000 But "#pragma arm section" is good just for Keil. GCC will ignore it.
usbhw.c #pragma arm section zidata = "USB_RAM" uint32_t UDCA[USB_EP_NUM]; /* UDCA in USB RAM */ uint32_t DD_NISO_Mem[4*DD_NISO_CNT]; /* Non-Iso DMA Descriptor Memory */ uint32_t DD_ISO_Mem [5*DD_ISO_CNT]; /* Iso DMA Descriptor Memory */ #pragma arm section zidata
For GCC, above code is ported as,
uint32_t UDCA[USB_EP_NUM] __attribute__ ((section ("USB_RAM"))); /* UDCA in USB RAM */ uint32_t DD_NISO_Mem[4*DD_NISO_CNT] __attribute__ ((section ("USB_RAM"))); /* Non-Iso DMA Descriptor Memory */ uint32_t DD_ISO_Mem [5*DD_ISO_CNT] __attribute__ ((section ("USB_RAM"))); /* Iso DMA Descriptor Memory */
Also, you have to declare USB_RAM section (ORIGIN = 0x2007c000) in \USBAudio\Debug\USBAudio_Debug_mem.ld In this linker script, RamAHB32 occupies this section. Move RamAHB32 to upper address and make room for USB_RAM. The LENGTH of USB_RAM section is, err.., count up above arrays ;-)
Tsuneo
I just had to use a .axf file to flash the lpcxpresso 1769 instead of a bin file, I built the .axf with the sample bundle with .102 at the end LPC17xxSampleSoftware.102