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?
Hello @tanoue
I hope you are doing well.
->After attaching the g_serial device one can give the command given below.
->This command will help you get all the information related to the kernel including time on your console.
Thanks & Regards
Sanket Parekh
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
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.
->One can choose the timestamp format using the below command
Thanks & Regards,
Dhruvit Vasavada.
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.