How to enable the S32G OTG function (Both Host Mode and Device Mode)

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

How to enable the S32G OTG function (Both Host Mode and Device Mode)

跳至解决方案
5,034 次查看
StanleyShen
Contributor IV

Hi

We want to use the OTG function in S32G,

Firstly, we use the default dts configuration(host mode only), it seems that the  device was detected successfully.

 

StanleyShen_2-1681098949966.png

StanleyShen_1-1681099067371.png

 

StanleyShen_0-1681099048350.png

 

QA1:OTG-Host Mode
But we  tried to change it to OTG mode, the OTG cable(BUS) was detecded and the device was not
 
StanleyShen_2-1681099284151.png

 

StanleyShen_3-1681099296696.png

 

StanleyShen_0-1681125406371.pngStanleyShen_1-1681125438767.png

 

QA2: OTG-Device Mode

When we use the normal microUSB -> TypeA cable(not OTG Cable) and connect to computer,

from debug sysfs, it seems that the mod was changed to gedget mode,

but nothing message output to dmesg and the computer(windows 11) no any response.

StanleyShen_2-1681125879295.png

 

So could you tell us if we make mistake somewhere and how to fix it?

thank you.

Env.

CPU S32G274A

Soft  BSP33.0 ( yocto fsl-auto make ARCH=arm64 s32gen1_defconfig )

 

 

 

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
4,835 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @StanleyShen,

I discussed with the internal team and knew that the OTG feature is not supported currently in BSP and there is no plan to develop it.

 

Thanks,

Mayank s Patel

在原帖中查看解决方案

0 项奖励
回复
14 回复数
4,886 次查看
StanleyShen
Contributor IV

It seems that “bsp36.0-5.10.158-rt” was not working properly either

0 项奖励
回复
4,865 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @StanleyShen,

Hope you are doing well.

Have you checked the same functionality in previous BSP Versions?

Previous and current BSP versions are behaving the same?

 

Thanks,

Mayank s Patel

0 项奖励
回复
4,844 次查看
StanleyShen
Contributor IV

Hi @MayanksPatel 

Have you checked the same functionality in previous BSP Versions

No, I  haven't do it before. But I can try BSP30.0 today.

0 项奖励
回复
4,836 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @StanleyShen,

I discussed with the internal team and knew that the OTG feature is not supported currently in BSP and there is no plan to develop it.

 

Thanks,

Mayank s Patel

0 项奖励
回复
4,823 次查看
StanleyShen
Contributor IV

Hi @MayanksPatel 

That's too bad, but thank you for your confirmation.

BTW, 

can you provide some suggestions on how to investigate this issue?

 

0 项奖励
回复
4,818 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @StanleyShen,

I am sorry, to inform you but I can't really help you with this as the feature is not developed. 

you can contact the sales team to point out the feature and its developement.

 

Thanks,

Mayank s Patel

0 项奖励
回复
4,813 次查看
StanleyShen
Contributor IV

@MayanksPatel 

OK I see, thank you all the same.

 

0 项奖励
回复
4,838 次查看
StanleyShen
Contributor IV

Hi @MayanksPatel 

No, I haven't do it before. But I can try BSP30.0 today.

I am sorry, since we are unable to download the code for BSP30.0 normally,

I am unable to confirm the behavior of BSP30.0,

https://community.nxp.com/t5/S32G/How-to-download-BSP30-0-yocto-repo-after-the-migrate-codeaurora/m-...

 

BTW:

Have you received any response from your internal team about this issue.

0 项奖励
回复
4,950 次查看
StanleyShen
Contributor IV

When I changed the dr_mode to peripheral as blow:

StanleyShen_0-1681452119992.png

replace the s32g274a-rdb2.dtb and restart the S32G-VNP-RDB2, after plug USB-A to Micro-B cable and connect it to PC,

flowing message ware output to dmesg

StanleyShen_3-1681452338838.png

and in the PC side, unkown device was  detected

StanleyShen_5-1681452666102.png

 

 

0 项奖励
回复
4,943 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @StanleyShen,

 

I have created a ticket with the internal team to discuss the case.

I will let you know once I received a response from the team.

 

 

Thanks,

Mayank s Patel

0 项奖励
回复
4,929 次查看
StanleyShen
Contributor IV

Hi Mayanks

I am really appreciate.

Also, I will continue to investigate the USB driver.

0 项奖励
回复
5,022 次查看
StanleyShen
Contributor IV

> But we tried to change it to OTG mode, the OTG cable(BUS) was detecded and the device was not

For OTG Host mode, I did some research on the driver code.

when OTG cable was plugged, the

hub_irq->hub_event would be executed and a new hub was detected as a new device,

but after it, when the USB device was plugged, the hub_irq not called.

0 项奖励
回复
4,986 次查看
MayanksPatel
NXP Employee
NXP Employee

Hi @StanleyShen,

Hope you are doing well.

I have seen the device-tree image attached by you and found that in USB dr_mode=host needs to be defined for OTG Support as the board would be the host for the pen drive you are going to access.

Change it in the device-tree and check if it is detecting or not. 

 

Thanks,

Mayank s Patel

0 项奖励
回复
4,974 次查看
StanleyShen
Contributor IV

Hi Mayank

As you see in my thread, I have already changed dr_ The mode  to OTG, but it still does not work properly.

both Host role and device role are failed(Pls refer to the description of QA1 and QA2)

thinks

 

0 项奖励
回复