All of lore.kernel.org
 help / color / mirror / Atom feed
* kgdb debug with ttyUSB0 instead of ttyS0
@ 2017-04-25 21:11 Oliver Graute
  2017-04-25 22:02 ` Mandeep Sandhu
  2017-04-26  4:37 ` Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Oliver Graute @ 2017-04-25 21:11 UTC (permalink / raw)
  To: kernelnewbies

Hello list,

i'am using a null modem cable with two usb to serial converts on both
ends between my develop and my target machine. The connection is fine.
On both machines the serial interface is /dev/ttyUSB0 for this connection.

On the target machine I try to enable kgdboc

echo ttyUSB0 > /sys/module/kgdboc/parameters/kgdboc

but only got:

echo write error: No such device

if I try:

echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc

is not complaining. Some ideas why ttyUSB0 can't be used with kgdb? 

Best regards,

Oliver

^ permalink raw reply	[flat|nested] 7+ messages in thread

* kgdb debug with ttyUSB0 instead of ttyS0
  2017-04-25 21:11 kgdb debug with ttyUSB0 instead of ttyS0 Oliver Graute
@ 2017-04-25 22:02 ` Mandeep Sandhu
  2017-04-26  4:37 ` Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Mandeep Sandhu @ 2017-04-25 22:02 UTC (permalink / raw)
  To: kernelnewbies

>
> echo ttyUSB0 > /sys/module/kgdboc/parameters/kgdboc
>
> but only got:
>
> echo write error: No such device
>

Is the USB-to-serial device detected on your target? Do you see a ttyUSB0
device node on your target? You can look at the kernel logs on your target
when you insert the device. If the kernel has the drivers for it, you
should see a device node being created.

-mandeep



>
> if I try:
>
> echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
>
> is not complaining. Some ideas why ttyUSB0 can't be used with kgdb?
>
> Best regards,
>
> Oliver
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170425/b0cebc56/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* kgdb debug with ttyUSB0 instead of ttyS0
  2017-04-25 21:11 kgdb debug with ttyUSB0 instead of ttyS0 Oliver Graute
  2017-04-25 22:02 ` Mandeep Sandhu
@ 2017-04-26  4:37 ` Greg KH
  2017-04-26 11:23   ` Oliver Graute
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2017-04-26  4:37 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Apr 25, 2017 at 11:11:38PM +0200, Oliver Graute wrote:
> Hello list,
> 
> i'am using a null modem cable with two usb to serial converts on both
> ends between my develop and my target machine. The connection is fine.
> On both machines the serial interface is /dev/ttyUSB0 for this connection.
> 
> On the target machine I try to enable kgdboc
> 
> echo ttyUSB0 > /sys/module/kgdboc/parameters/kgdboc
> 
> but only got:
> 
> echo write error: No such device
> 
> if I try:
> 
> echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
> 
> is not complaining. Some ideas why ttyUSB0 can't be used with kgdb?

USB needs interrupts in order to run properly, which kgdb doesn't enable
when you stop the target, for obvious reasons :)

Stick to a "real" serial connection and you should be fine.

good luck!

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* kgdb debug with ttyUSB0 instead of ttyS0
  2017-04-26  4:37 ` Greg KH
@ 2017-04-26 11:23   ` Oliver Graute
  2017-04-26 12:49     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Graute @ 2017-04-26 11:23 UTC (permalink / raw)
  To: kernelnewbies

On 26/04/17, Greg KH wrote:
> On Tue, Apr 25, 2017 at 11:11:38PM +0200, Oliver Graute wrote:
> > Hello list,
> > 
> > i'am using a null modem cable with two usb to serial converts on both
> > ends between my develop and my target machine. The connection is fine.
> > On both machines the serial interface is /dev/ttyUSB0 for this connection.
> > 
> > On the target machine I try to enable kgdboc
> > 
> > echo ttyUSB0 > /sys/module/kgdboc/parameters/kgdboc
> > 
> > but only got:
> > 
> > echo write error: No such device
> > 
> > if I try:
> > 
> > echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
> > 
> > is not complaining. Some ideas why ttyUSB0 can't be used with kgdb?
> 
> USB needs interrupts in order to run properly, which kgdb doesn't enable
> when you stop the target, for obvious reasons :)

ok that make sense

> Stick to a "real" serial connection and you should be fine.

thats not so easy. Even the old notebooks today lacks a "real" serial
connection. Perhaps I should use a raspberry as target. There I can get
a serial over the gpios.

Best Regards,

Oliver

^ permalink raw reply	[flat|nested] 7+ messages in thread

* kgdb debug with ttyUSB0 instead of ttyS0
  2017-04-26 11:23   ` Oliver Graute
@ 2017-04-26 12:49     ` Greg KH
  2017-04-26 21:11       ` Joe Smith
  2017-04-29 11:51       ` Oliver Graute
  0 siblings, 2 replies; 7+ messages in thread
From: Greg KH @ 2017-04-26 12:49 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Apr 26, 2017 at 01:23:55PM +0200, Oliver Graute wrote:
> On 26/04/17, Greg KH wrote:
> > On Tue, Apr 25, 2017 at 11:11:38PM +0200, Oliver Graute wrote:
> > > Hello list,
> > > 
> > > i'am using a null modem cable with two usb to serial converts on both
> > > ends between my develop and my target machine. The connection is fine.
> > > On both machines the serial interface is /dev/ttyUSB0 for this connection.
> > > 
> > > On the target machine I try to enable kgdboc
> > > 
> > > echo ttyUSB0 > /sys/module/kgdboc/parameters/kgdboc
> > > 
> > > but only got:
> > > 
> > > echo write error: No such device
> > > 
> > > if I try:
> > > 
> > > echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
> > > 
> > > is not complaining. Some ideas why ttyUSB0 can't be used with kgdb?
> > 
> > USB needs interrupts in order to run properly, which kgdb doesn't enable
> > when you stop the target, for obvious reasons :)
> 
> ok that make sense
> 
> > Stick to a "real" serial connection and you should be fine.
> 
> thats not so easy. Even the old notebooks today lacks a "real" serial
> connection. Perhaps I should use a raspberry as target. There I can get
> a serial over the gpios.

Why do you need to use a notebook where Linux works already for kgdb?
That's traditionally only used to bring up new hardware platforms.

Also, there is USB serial debugging cables as there is a special mode in
the USB 2 and 3 controllers that can be enabled to handle serial
messages without interrupts for console/printk early messages that
people use.  The cables are not cheap to enable this, but worth it if
you have to debug this type of target system.

Good luck!

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* kgdb debug with ttyUSB0 instead of ttyS0
  2017-04-26 12:49     ` Greg KH
@ 2017-04-26 21:11       ` Joe Smith
  2017-04-29 11:51       ` Oliver Graute
  1 sibling, 0 replies; 7+ messages in thread
From: Joe Smith @ 2017-04-26 21:11 UTC (permalink / raw)
  To: kernelnewbies

The options you suggested are not clear to me. Can you elaborate how I
would debug live kernel when all I have on the two systems is usb. Can you
list the cable that I can use/order.

Thanks.

On Wed, Apr 26, 2017 at 5:49 AM, Greg KH <greg@kroah.com> wrote:

> On Wed, Apr 26, 2017 at 01:23:55PM +0200, Oliver Graute wrote:
> > On 26/04/17, Greg KH wrote:
> > > On Tue, Apr 25, 2017 at 11:11:38PM +0200, Oliver Graute wrote:
> > > > Hello list,
> > > >
> > > > i'am using a null modem cable with two usb to serial converts on both
> > > > ends between my develop and my target machine. The connection is
> fine.
> > > > On both machines the serial interface is /dev/ttyUSB0 for this
> connection.
> > > >
> > > > On the target machine I try to enable kgdboc
> > > >
> > > > echo ttyUSB0 > /sys/module/kgdboc/parameters/kgdboc
> > > >
> > > > but only got:
> > > >
> > > > echo write error: No such device
> > > >
> > > > if I try:
> > > >
> > > > echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
> > > >
> > > > is not complaining. Some ideas why ttyUSB0 can't be used with kgdb?
> > >
> > > USB needs interrupts in order to run properly, which kgdb doesn't
> enable
> > > when you stop the target, for obvious reasons :)
> >
> > ok that make sense
> >
> > > Stick to a "real" serial connection and you should be fine.
> >
> > thats not so easy. Even the old notebooks today lacks a "real" serial
> > connection. Perhaps I should use a raspberry as target. There I can get
> > a serial over the gpios.
>
> Why do you need to use a notebook where Linux works already for kgdb?
> That's traditionally only used to bring up new hardware platforms.
>
> Also, there is USB serial debugging cables as there is a special mode in
> the USB 2 and 3 controllers that can be enabled to handle serial
> messages without interrupts for console/printk early messages that
> people use.  The cables are not cheap to enable this, but worth it if
> you have to debug this type of target system.
>
> Good luck!
>
> greg k-h
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
JS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170426/b98a4473/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* kgdb debug with ttyUSB0 instead of ttyS0
  2017-04-26 12:49     ` Greg KH
  2017-04-26 21:11       ` Joe Smith
@ 2017-04-29 11:51       ` Oliver Graute
  1 sibling, 0 replies; 7+ messages in thread
From: Oliver Graute @ 2017-04-29 11:51 UTC (permalink / raw)
  To: kernelnewbies

On 26/04/17, Greg KH wrote:
> Why do you need to use a notebook where Linux works already for kgdb?
> That's traditionally only used to bring up new hardware platforms.

I just used a old notebook as target to learn how-to debug with kgdb.
inspired by the debugging Chapter 4 in the LDD3 Book.
 
> Also, there is USB serial debugging cables as there is a special mode in
> the USB 2 and 3 controllers that can be enabled to handle serial
> messages without interrupts for console/printk early messages that
> people use.  The cables are not cheap to enable this, but worth it if
> you have to debug this type of target system.

can you point us to such a cable?

Best Regards,

Oliver

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-04-29 11:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 21:11 kgdb debug with ttyUSB0 instead of ttyS0 Oliver Graute
2017-04-25 22:02 ` Mandeep Sandhu
2017-04-26  4:37 ` Greg KH
2017-04-26 11:23   ` Oliver Graute
2017-04-26 12:49     ` Greg KH
2017-04-26 21:11       ` Joe Smith
2017-04-29 11:51       ` Oliver Graute

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.