C++工程移植官方高速USB设备失败!

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

C++工程移植官方高速USB设备失败!

593 Views
lichengxiang
Contributor I

最近移植官方例程lpcxpresso54628_dev_msc_sdcard_freertos,搭配官方提供的LPCXpresso546xx开发板。由于例程给出的是C工程代码,我需要用C++工程,所以新创建一个C++工程,把例程移植到C++代码里。C++代码中只调用原来例程中的主函数,其余代码全部移植官方例程。编译下载之后,发现可以实现USB的全速设备,当在usb_device_config.h把宏定义改为高速设备时,会出现USB设备未识别。。。。求解!(后面附移植后的代码,求大神指导usb2.pngusb3.pngusb4.pngusb1.png

Labels (1)
0 Kudos
3 Replies

434 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI

Let's talk about NXP official SDK demo code dev_msc_sdcard_freertos first.

How does it works if you enable USB1 in the same way?

Have a nice day

Jun Zhang

0 Kudos

434 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

I have verified this SDK demo code can work for HS USB without problem by changing the device configuration as

/*! @brief LPC USB IP3511 FS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511FS (0U)

/*! @brief LPC USB IP3511 HS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511HS (1U)

From the error message you had, the problem should be USB1 initialization failed. 

I suggest you compare the USB1 config registers setting in debugger with comparing the same of the SDK USB demo.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

434 Views
lichengxiang
Contributor I

I have try many times,I transplant all code from the SDK demo,include initialization code.I check the BOARD_InitPins(),They are the same.If you direct run SDK demo by changing the device configuration,I know that is OK.Could you verify the demo that I have uploaderde?  I check the code in debugger  mode,it is run ok.It could run USB1_IRQHandle() when I set the breakpoints.I didn't find any abnormalities.Could you help me to look at it, please?Snipaste_2019-09-25_09-28-21.pngSnipaste_2019-09-25_09-28-57.png

0 Kudos