LPC5514 USB High Speed ​​device Errata Countermeasures

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

LPC5514 USB High Speed ​​device Errata Countermeasures

跳至解决方案
1,186 次查看
yamakatb
Contributor III

Hello,

Referencing "usb_device_cdc_vcom" to test receiving files from a Windows Forms application.

I have a question about how to deal with errata.
3.4 USB.3: “For the USB high-speed device controller, the detection
handshake fails when certain full-speed hubs are connected"

1. About USB_DeviceHsPhyChirpIssueWorkaround
Where can I find the source of "USB_DeviceHsPhyChirpIssueWorkaround()" mentioned in Work-around?
usb_dev_hid_mouse only has a declaration, no definition found.

2. About FORCE_FS
It says to set FORCE_FS(bit21), but I cannot confirm that it is set on the IDE, probably because it is not defined in the device file. Is there any way to set this bit?

kUSB_DeviceEventBusReset.png

detail
Device: LPC5514SDK Version: 2.11.0
Host: Windows 10 PC
Toolchain: IAR Embedded Workbench for ARM

 

标签 (2)
0 项奖励
1 解答
1,113 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello yamakatb,

About FORCE_FS bit, yes, there is bug with IDE, I will report it to IDE team.

Now you only can try to use register address to config and check:

Alice_Yang_0-1661850049172.png

Alice_Yang_1-1661850084906.png

 

BR

Alice

 

 

在原帖中查看解决方案

0 项奖励
8 回复数
1,174 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello yamakatb,

About Q1, I will confirm with our internal, then reply you.

About Q2, how about use latest IDE and SDKv2.12? Because for old UM for lpc5514, there is no FORCE_FS(bit21), it is reserved, so there is no this bit in your IDE. Please refer to new version UM to config:

Alice_Yang_0-1660210119527.png

 

 

BR

Alice

0 项奖励
1,162 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

This  source was found from LPC54 family, same example, I think the source code is same with lpc55xx, I will confirm this once I get a reply.

void USB_DeviceHsPhyChirpIssueWorkaround(void)
{
    uint32_t startFrame = USBHSD->INFO & USBHSD_INFO_FRAME_NR_MASK;
    uint32_t currentFrame;
    uint32_t isConnectedToFsHostFlag = 0U;
    if ((!isConnectedToHsHost) && (!isConnectedToFsHost))
    {
        if (((USBHSD->DEVCMDSTAT & USBHSD_DEVCMDSTAT_Speed_MASK) >> USBHSD_DEVCMDSTAT_Speed_SHIFT) == 0x01U)
        {
            USBHSD->DEVCMDSTAT = (USBHSD->DEVCMDSTAT & (~(0x0F000000U | USBHSD_DEVCMDSTAT_PHY_TEST_MODE_MASK))) |
                                 USBHSD_DEVCMDSTAT_PHY_TEST_MODE(0x05U);
            hwTick = 100;
            USB_TimerInt(0, 1);
            usb_echo("The USB device PHY chirp work-around is working\r\n");
            while (hwTick)
            {
            }
            currentFrame = USBHSD->INFO & USBHSD_INFO_FRAME_NR_MASK;
            if (currentFrame != startFrame)
            {
                isConnectedToHsHost = 1U;
            }
            else
            {
                hwTick = 1;
                USB_TimerInt(0, 1);
                while (hwTick)
                {
                }
                currentFrame = USBHSD->INFO & USBHSD_INFO_FRAME_NR_MASK;
                if (currentFrame != startFrame)
                {
                    isConnectedToHsHost = 1U;
                }
                else
                {
                    isConnectedToFsHostFlag = 1U;
                }
            }
            USBHSD->DEVCMDSTAT = (USBHSD->DEVCMDSTAT & (~(0x0F000000U | USBHSD_DEVCMDSTAT_PHY_TEST_MODE_MASK)));
            USBHSD->DEVCMDSTAT = (USBHSD->DEVCMDSTAT & (~(0x0F000000U | USBHSD_DEVCMDSTAT_DCON_MASK)));
            hwTick             = 510;
            USB_TimerInt(0, 1);
            while (hwTick)
            {
            }
            USBHSD->DEVCMDSTAT = (USBHSD->DEVCMDSTAT & (~(0x0F000000U))) | USB_DEVCMDSTAT_DCON_C_MASK;
            USBHSD->DEVCMDSTAT =
                (USBHSD->DEVCMDSTAT & (~(0x0F000000U))) | USBHSD_DEVCMDSTAT_DCON_MASK | USB_DEVCMDSTAT_DRES_C_MASK;
            if (isConnectedToFsHostFlag)
            {
                isConnectedToFsHost = 1U;
            }
        }
    }
}

 

 

BR

Alice

 

0 项奖励
1,140 次查看
yamakatb
Contributor III

Hi @Alice_Yang 

Thanks for your help.

Regarding Q1, I downloaded and tried the latest IDE and SDK2.12, but the FORCE_FS bit was not present.

Regarding Q2, I was able to get and build "USB_DeviceHsPhyChirpIssueWorkaround" from usb_dev_hid_mouse in SDK2.12 for LPC54xx.
The errata says "If full-speed host is connected or "isConnectedToFsHostFlag" is set , FORCE_FS (bit 21) of DEVCMDSTAT register should be set to force the device operating in full-speed mode.
I do not recognize where FORCE_FS is set in the API.

It also says "On "kUSB_DeviceEventDetach" event, FORCE_FS (bit 21) of DEVCMDSTAT register should be cleared.
How is the FORCE_FS set and cleared being performed?

Best regards,
yamakatb

0 项奖励
1,114 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello yamakatb,

About FORCE_FS bit, yes, there is bug with IDE, I will report it to IDE team.

Now you only can try to use register address to config and check:

Alice_Yang_0-1661850049172.png

Alice_Yang_1-1661850084906.png

 

BR

Alice

 

 

0 项奖励
1,106 次查看
yamakatb
Contributor III

Hello @Alice_Yang 

I understand the content and countermeasures.

In addition to the contents of the previous Q2, I have a question, is it likely that the contents of USB_DeviceHsPhyChirpIssueWorkaround will be changed in the future for this problem?

Best regards,
yamakatb

0 项奖励
1,093 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello yamakatb,

Sorry what about the change meaning? Do you meaning this function will be integrated into SDK, we do not add it in the future? 

 

BR

Alice

0 项奖励
1,088 次查看
yamakatb
Contributor III

Hello @Alice_Yang 

I'm sorry I didn't explain it enough.

Referring to the errata, "If a full-speed host is connected or "isConnectedToFsHostFlag" is set, the device must be forced to operate in full-speed mode by setting FORCE_FS (bit 21) in the DEVCMDSTAT register It is stated as "The device must be forced to operate in full-speed mode.

After checking the contents of the API, we could not find where FORCE_FS (bit 21) is set.

I understand that FORCE_FS is not displayed due to an IDE error.
However, I am not sure if this can be used to work around this as I cannot see a setting to FORCE_FS in the API, which is the work-around listed in the errata.

Is it not necessary to add the FORCE_FS setting using register addresses to the API?

Best regards,
yamakatb

0 项奖励
1,077 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello yamakatb,

Yes, It is very necessary, I will take ticket to SDK team about this issue.

Thanks for your sharing.

 

BR

Alice

 

0 项奖励