FRDM-MCXN947: Detection of Disconnection of USB1_HS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FRDM-MCXN947: Detection of Disconnection of USB1_HS

ソリューションへジャンプ
597件の閲覧回数
John_Adams
Contributor I

Hi,


I would like to ask, on the FRDM-MCXN947 board I am using USB1_HS with OTG USB, I am trying to detect the connection and disconnection of this USB. Connection detection works fine, so I use this function:

 

 

usb_device_notification_t USB_State(usb_device_struct_t *pDeviceHandle)
{
	usb_device_ehci_state_struct_t *ehciState;
	ehciState = (usb_device_ehci_state_struct_t *)(pDeviceHandle->controllerHandle);

	if (0U != (ehciState->registerBase->OTGSC & USBHS_OTGSC_BSV_MASK))
    {
		return kUSB_DeviceNotifyAttach;
    }
	return kUSB_DeviceNotifyDetach;
}

 

 

However, for some reason this USB OTG register does not detect the disconnection correctly. Is it possible to use some other register to detect the disconnection?

 

Thank you for any advise!

John Adams

ラベル(1)
0 件の賞賛
返信
1 解決策
578件の閲覧回数
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @John_Adams,

Please refer to the following community post on how to enable the detach detection: What is the best way to detect attaching and detaching of an usb cable between RT1020 (device) and a...

It is referring an RT1020, but it is the same process for the MCXN947.

BR,
Edwin.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
579件の閲覧回数
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @John_Adams,

Please refer to the following community post on how to enable the detach detection: What is the best way to detect attaching and detaching of an usb cable between RT1020 (device) and a...

It is referring an RT1020, but it is the same process for the MCXN947.

BR,
Edwin.

0 件の賞賛
返信