ROM USB CDC example for LPC1347

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by AchimKraus on Mon Feb 17 04:59:36 MST 2014

I tried to understand the ROM USB CDC example in „NXP_LPC1347_2012_02_22.zip“ from LPCXpresso 6.1.4_194_Linux-x86 for the LPC1347. Studying the source makes me wonder:

1. line 381 in main.c

   /* initilize call back structures */
   memset((void*) &usb_param, 0, sizeof(USBD_API_INIT_PARAM_T));
   usb_param.usb_reg_base = LPC_USB_BASE;
   usb_param.mem_base = 0x10001000;
   usb_param.mem_size = 0x1000;

0x10001000 points into the middle of the 8K SRAM, right? And there is no need to protect this area from being used in an other way? Or does this simple example just probably not use this memory?

2. Is it possible to use the 2K USB SRAM with
   usb_param.mem_base = 0x20004000; // RAM
   usb_param.mem_size = 0x800; // 2K;
   or is that area reserved for an internal use of the USB?

3. line 427 in main.c
   /* allocate transfer buffers */
   g_vCOM.rxBuf = (uint8_t*) (cdc_param.mem_base
   g_vCOM.txBuf = (uint8_t*) (cdc_param.mem_base
   cdc_param.mem_size -= (4 * USB_HS_MAX_BULK_PACKET);
   Is it really possible to use those buffer, which are passed in as parameter to hw->init and cdc->init?
   Which effect has altering the mem_size? Must the mem_base be adjusted as well?

I just search the forum but I may have missed the already given information on that issues.
So would alos be glad to be pointed to already given answers.

Thanks and best regards