Questions regarding the examples of keyboard2mouse.

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

Questions regarding the examples of keyboard2mouse.

261 Views
inse1979
Contributor I

When I run the keyboard2mouse example on the LPC55S69-EVK with the default settings, it works perfectly.

However, its current operation seems to be:

PC <--> LPCIP3511HS <--> LPC55S69 <--> OHCI <--> Keyboard

But I want to modify the operation mode to:
PC <--> LPCIP3511FS<-->LPC55s69<--> IP3516HS <--> Keyboard

So I tried the following modification:
usb_host_config.h:
#define USB_HOST_CONFIG_OHCI 0U
#define USB_HOST_CONFIG_IP3516HS 1U

usb_device_config.h
#define USB_DEVICE_CONFIG_LPCIP3511FS 1U
#define USB_DEVICE_CONFIG_LPCIP3511HS 0U

I encountered the following error message:

arm-none-eabi/bin/ld.exe: region `USB_RAM' overflowed by 3840 bytes

Memory region Used Size Region Size %age Used

PROGRAM_FLASH: 83524 B 630 KB 12.95%

SRAM: 29408 B 256 KB 11.22%

SRAMX: 0 GB 32 KB 0.00%

USB_RAM: 20224 B 16 KB 123.44%

SRAM4: 0 GB 16 KB 0.00%

How to solve this problem ?

0 Kudos
Reply
1 Reply

240 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi inse1979 

According to the error message "USB_RAM: 20224 B 16 KB 123.44%", your USB_RAM is overfolow. The reason is that, when you switch your USB Host controller from OHCI -> IP3516HS, the USB_RAM requirement exceeds 16k, which results in the overflow error.

IP3516HS driver needs more USB_RAM memory because its increased complexity.

While USB_RAM is only 16KB, your configuration is 20224B which is over the limit.

I ever tested the the same with SDK demos, switching USB demo from USB0. see article sections 2.1 and 2.2 of following article. There's no issue.

https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/LPC-ALL-Summary-of-Switching-USB-demo-fr...

Therefore, I suggest you optimize your code by disabling unnecessary USB classes or points to release more memory. Or reduce USB devices or endpoints or buffer sizes.

Hope this helps,

Jun Zhang

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2173247%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EQuestions%20regarding%20the%20examples%20of%20keyboard2mouse.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173247%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CFONT%20size%3D%222%22%3EWhen%20I%20run%20the%20keyboard2mouse%20example%20on%20the%20LPC55S69-EVK%20with%20the%20default%20settings%2C%20it%20works%20perfectly.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EHowever%2C%20its%20current%20operation%20seems%20to%20be%3A%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%222%22%3EPC%20%26lt%3B--%26gt%3B%20LPCIP3511HS%20%26lt%3B--%26gt%3B%20LPC55S69%20%26lt%3B--%26gt%3B%20OHCI%20%26lt%3B--%26gt%3B%20Keyboard%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EBut%20I%20want%20to%20modify%20the%20operation%20mode%20to%3A%3C%2FFONT%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CFONT%20size%3D%222%22%3EPC%20%26lt%3B--%26gt%3B%20LPCIP3511FS%26lt%3B--%26gt%3BLPC55s69%26lt%3B--%26gt%3B%20IP3516HS%20%26lt%3B--%26gt%3B%20Keyboard%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3ESo%20I%20tried%20the%20following%20modification%3A%3C%2FFONT%3E%3CBR%20%2F%3E%3CSTRONG%3E%3CFONT%20size%3D%222%22%3Eusb_host_config.h%3A%3C%2FFONT%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20%3CSTRONG%3EUSB_HOST_CONFIG_OHCI%3C%2FSTRONG%3E%200U%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20%3CSTRONG%3EUSB_HOST_CONFIG_IP3516HS%3C%2FSTRONG%3E%201U%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%222%22%3Eusb_device_config.h%3C%2FFONT%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20%3CSTRONG%3EUSB_DEVICE_CONFIG_LPCIP3511FS%3C%2FSTRONG%3E%201U%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20%3CSTRONG%3EUSB_DEVICE_CONFIG_LPCIP3511HS%3C%2FSTRONG%3E%200U%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3EI%20encountered%20the%20following%20error%20message%3A%3C%2FFONT%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CBLOCKQUOTE%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3Earm-none-eabi%2Fbin%2Fld.exe%3A%20region%20%60USB_RAM'%20overflowed%20by%203840%20bytes%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3EMemory%20region%20Used%20Size%20Region%20Size%20%25age%20Used%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3EPROGRAM_FLASH%3A%2083524%20B%20630%20KB%2012.95%25%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3ESRAM%3A%2029408%20B%20256%20KB%2011.22%25%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3ESRAMX%3A%200%20GB%2032%20KB%200.00%25%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3EUSB_RAM%3A%2020224%20B%2016%20KB%20123.44%25%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSPAN%3ESRAM4%3A%200%20GB%2016%20KB%200.00%25%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3EHow%20to%20solve%20this%20problem%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2173377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Questions%20regarding%20the%20examples%20of%20keyboard2mouse.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2173377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3Binse1979%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAccording%20to%20the%20error%20message%20%22%3CSPAN%3EUSB_RAM%3A%2020224%20B%2016%20KB%20123.44%25%3C%2FSPAN%3E%22%2C%20your%20USB_RAM%20is%20overfolow.%20The%20reason%20is%20that%2C%20when%20you%20switch%20your%20USB%20Host%20controller%20from%20OHCI%20-%26gt%3B%20IP3516HS%2C%20the%20USB_RAM%20requirement%20exceeds%2016k%2C%20which%20results%20in%20the%20overflow%20error.%3C%2FP%3E%0A%3CP%3EIP3516HS%20driver%20needs%20more%20USB_RAM%20memory%20because%20its%20increased%20complexity.%3C%2FP%3E%0A%3CP%3EWhile%20USB_RAM%20is%20only%2016KB%2C%20your%20configuration%20is%2020224B%20which%20is%20over%20the%20limit.%3C%2FP%3E%0A%3CP%3EI%20ever%20tested%20the%20the%20same%20with%20SDK%20demos%2C%20switching%20USB%20demo%20from%20USB0.%20see%20article%20sections%202.1%20and%202.2%20of%20following%20article.%20There's%20no%20issue.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FLPC-Microcontrollers-Knowledge%2FLPC-ALL-Summary-of-Switching-USB-demo-from-USB0-to-USB1%2Fta-p%2F1428522%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FLPC-Microcontrollers-Knowledge%2FLPC-ALL-Summary-of-Switching-USB-demo-from-USB0-to-USB1%2Fta-p%2F1428522%3C%2FA%3E%3C%2FP%3E%0A%3CP%3ETherefore%2C%26nbsp%3BI%20suggest%20you%20optimize%20your%20code%20by%20disabling%20unnecessary%20USB%20classes%20or%20points%20to%20release%20more%20memory.%20Or%20reduce%20USB%20devices%20or%20endpoints%20or%20buffer%20sizes.%3C%2FP%3E%0A%3CP%3EHope%20this%20helps%2C%3C%2FP%3E%0A%3CP%3EJun%20Zhang%3C%2FP%3E%3C%2FLINGO-BODY%3E