Timing of serial gadget (g_serial) attaches to USB host

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

Timing of serial gadget (g_serial) attaches to USB host

1,126 次查看
tanoue
Contributor III

Hi, everyone.

I would like to use serial gadget (g_serial) with our product based on L5.15.32_2.0.0.

 

To prevent communication data from being dropped between the USB function and the USB host, it is necessary to detect that the USB function is attached to the USB host before starting communication.

For example, if USB Function starts transmitting as soon as /dev/ttyGS0 is created, USB Host may miss data.

 

How to know timing of serial gadget attaches to USB host?

Are there any logs, messages or interfaces for this solution?

0 项奖励
回复
4 回复数

1,097 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @tanoue 

I hope you are doing well.

->After attaching the g_serial device one can give the command given below.

  • dmesg -w

->This command will help you get all the information related to the kernel including time on your console.

Thanks & Regards

Sanket Parekh

0 项奖励
回复

1,080 次查看
tanoue
Contributor III

Hi, @Sanket_Parekh 

 

Thank you for your replying.

I had already knew dmesg command, and it showed below logs.

[ 71.265672] g_serial gadget: Gadget Serial v2.4
[ 71.270354] g_serial gadget: g_serial ready

It let me know g_serial loaded only.

I don't see the timing of serial gadget attaches to USB host with these logs.

 

Is there any other way, such as enabling debug logging somewhere?

 

Best regards

tanoue

 

 

标记 (1)
0 项奖励
回复

1,062 次查看
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @tanoue,

I hope you are doing well.

To see the specific timing-related information one can use the below command.

->Enable human-readable timestamps using the -T (--ctime) option. The option removes the nanosecond accuracy from the output, but the timestamps are easier to follow.

  • sudo dmesg -T

->One can choose the timestamp format using the below command

  • sudo dmesg --time-format=iso
Please Share The Observation for the same.


Thanks & Regards,

Dhruvit Vasavada.

0 项奖励
回复

1,023 次查看
tanoue
Contributor III

Hi, @Dhruvit .

 

The following logs are outputs with your advises.

These show only timestamp details but these don't show the timings of attach to USB Host.

It is not the solution for my request.

 

sudo dmesg -T

[Tue Jul 20 03:50:09 2021] g_serial gadget: Gadget Serial v2.4
[Tue Jul 20 03:50:09 2021] g_serial gadget: g_serial ready

 

sudo dmesg --time-format=iso

2021-07-20T03:50:09,901985+00:00 g_serial gadget: Gadget Serial v2.4
2021-07-20T03:50:09,906588+00:00 g_serial gadget: g_serial ready

 

Best Regards.

tanoue.

0 项奖励
回复