Timing of serial gadget (g_serial) attaches to USB host

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timing of serial gadget (g_serial) attaches to USB host

604 Views
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 Kudos
4 Replies

575 Views
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 Kudos

558 Views
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

 

 

Tags (1)
0 Kudos

540 Views
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 Kudos

501 Views
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 Kudos