LPC54018, USB1 highspeed, USB stall during bulk transfer in.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC54018, USB1 highspeed, USB stall during bulk transfer in.

4,536 次查看
jukka1
Contributor III

Hi,

I am experiencing a mysterious issue with USB bulk transfer.

The source code is modified from lpcxpresso54s018_host_cdc_freertos example.

LPC54018 USB1 (host) is connected to SierraWireless RC7620 modem.

Everything works fine until a longer TCP data transfer happens from modem to host.
Then the transfer ends in USB functional stall at bulk transfer in.

E.g FTP transfer of 466 byte file from FTP server to LPC succeeds, but FTP transfer of 468 byte file always ends in USB stall.

The modem operation is verified with LPC18S37, it works without problems.

So it seems that the reason for the problem is USB stack and/or USB1 in LPC54018.

Has anybody any glue, what could be the reason for this kind of behaviour?

 

0 项奖励
回复
9 回复数

4,203 次查看
jukka1
Contributor III

We succeeded in fixing the issue by removing the following lines from https://github.com/nxp-mcuxpresso/mcux-sdk-examples/blob/main/lpcxpresso54s018/usb_examples/usb_host...

        if (cdcInstance->bulkInMaxPacketSize == dataLength)
        {
            /* host will prime to receive zero length packet after recvive one maxpacketsize */
            USB_HostCdcDataRecv(g_cdc.classHandle, NULL, 0, USB_HostCdcDataInCallback, &g_cdc);
        }

 

We did not yet analyse deeply, what was wrong with the bulk transfer transaction.

But probably RC7620 modem caused USB stall in bulk in, when it received a zero byte payload in bulk out.

 

BR,

jukka

0 项奖励
回复

4,460 次查看
jukka1
Contributor III

Hi,

I am working with SDK_2_13_0_LPC54018. I downloaded it a couple of weeks ago from NXP site.

 

BR,

jukka

0 项奖励
回复

4,442 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi jukka1,

There is no related known USB issue in 2_13_0.

We need to know the detail steps of how to reproduce this issue with nxp demo board and sdk?

Thanks,

Jun Zhang

0 项奖励
回复

4,436 次查看
jukka1
Contributor III

Hi Jun Zhang,

OK.

Yes, I understand. That is why I am about to arrange a simplified setup.

But I have another issue with that setup. I opened a new discussion about it (LPC54018-USB1-highspeed-problem-when-running-SDK-example). Weird, that also that issue is related to USB stall, although most probably the root cause is not the same.

BTW, do you know what are the acceptable values for USB_HOST_SEND_RECV_PER_TIME (in host_cdc.h)?

I am currently using a value 300U for it.

 

BR,

jukka

 

0 项奖励
回复

4,336 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

For USB_HOST_SEND_RECV_PER_TIME, Please test the value with 64 or 32

0 项奖励
回复

4,189 次查看
jukka1
Contributor III

We have used now value 512 and even 768 for USB_HOST_SEND_RECV_PER_TIME.

Then it works better for our use cases.

 

BR,

jukka

0 项奖励
回复

4,380 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

host_hdc.h, is that NXP SDK file?

0 项奖励
回复

4,365 次查看
jukka1
Contributor III

Oops sorry, the file name is host_cdc.h.

I corrected it also to the message above.

So host_hdc.h => host_cdc.h.

0 项奖励
回复

4,466 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi jukka1 

Which version of SDK do you work with?

Thanks

Jun Zhang

 

0 项奖励
回复