nxpUSBlib Virtual Serial Device Example on Diolan board LPC-4350-DB1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

nxpUSBlib Virtual Serial Device Example on Diolan board LPC-4350-DB1

515 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gmora on Wed Feb 05 08:13:12 MST 2014
Hi,

I'm trying to run Virtual Serial Device Example on DIOLAN Board LPC-4350-DB1 ( LPC4350 MCU and external flash Spansion S29AL016J).
I added code to example for implement led D3 blinking by RIT_Timer, and PWM on GPIO5[3] by timer2 and timer3.
I set BSP build configuration to "LPC4350_HITEX_A4, but I have adapted the SetupHardware() and bsp_init() functions for Diolan hardware as follows:


void bsp_init(void)
{
uint32_t Core_Clock;
/* Set up core clock */
CGU_Init();

//Board HITEX:
/* Initialize the external memory controller */
vEMC_InitSRDRAM(SDRAM_BASE_ADDR, SDRAM_WIDTH, SDRAM_SIZE_MBITS, SDRAM_DATA_BUS_BITS, SDRAM_COL_ADDR_BITS);

//Commented for DIOLAN booard:
/* Turn on 5V USB VBUS TODO Should be Host-only */
//scu_pinmux(0x9, 5, MD_PUP | MD_EZI, FUNC2);// P9_5 USB1_VBUS_EN, USB1 VBus function
//scu_pinmux(0x2, 5, MD_PLN | MD_EZI | MD_ZI, FUNC2);// P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION

/*
#if (BOARD == BOARD_HITEX_A4)
scu_pinmux(0x6, 3, MD_PUP | MD_EZI, FUNC1);// P6_3 USB0_PWR_EN, USB0 VBus function
#else
scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7);// USB0 VBus function
#endif
*/
}

void SetupHardware(void)
{

//Board DIOLAN LPC-4350-DB1:
#if defined (__CC_ARM)  || defined(__ICCARM__) // FIXME KEIL related
  SystemInit();
#endif
bsp_init();
MyLEDs_Init();
Init_IO_Port();
GPIO_SetValue(D6_GPIO_PORT, D6_GPIO_MASK);
USB_Init();

#if defined(USB_DEVICE_ROM_DRIVER)
UsbdCdc_Init();
#endif
USB_Connect();
}


For both CDL and Example_VirtualDevice I set the build configuration to “LPC43xx_M4”.
For Example_VirtualDevice I set target processor to LPC4350 and configured the flash as:
Location=0x1C000000 (start address), size=0x200000 and driver flash= LPC18_43_Diolan_S29AL016J70T.cfx.

I use LPCXpresso v5.2.6 [Build 2137] [2013-07-08] and nxpUSBlib v0.98b.

My problem is that, when I try to run the example in debug mode (LPC-LINK), my computer no longer recognizes the device. My impression is that the program has not been downloaded because the led D3 does not blink.
Instead, if I reduce the code from 48K of the complete example to 33K by eliminating all calls to usb driver function, the download is ok and the program runs after board restart also.
Moreover I see that if I not configure the external flash on the mcu settings, the full (48K) example_virtualdevice works in debug, the virtual device is recognized and the communication on virtual com is ok.

Any help is appreciated to solve this issue.

Thanks in advance

gmora

0 Kudos
Reply
0 Replies