console log do not output after uart cable plug out and re-connect

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

console log do not output after uart cable plug out and re-connect

Jump to solution
3,712 Views
vecio_lin
Contributor II

Dear Nxp

      i use the imx6solo and  run the linux , the kernel is 4.14.78.

      the ttymxc0 is the debug port, i pass the parameter "console=ttymxc0,115200 consoleblank=0" from the uboot.

      i run a application for communicate with mcu in the uart1, and i use a usb-to-serial board to connect the device`s uart0(/dev/ttymxc0) and pc, run the securtCRT in the PC to get the log.

      i find that when i plug the usb-to-serial cable in the pc side out,  the application is not running any more. and after i re-connect them, it`s not any output in my pc.

      I tried some scenarios:

      after the device boot, i run a shell script in the rcS.

      the shell script is :

                  #!/bin/sh

                  while :
                  do
                        sleep 1
                        echo "test"
                  done

      okay, This is a very simple code, output the "test" log into the console every one second.

      take the same action as above, the log is do not print.

      but the kernel is running well when the issue happend, i can still login in the /dev/pts0 through ssh.

      and i get the dmesg when the issue happended.

      the dmesg:

[ 180.024102] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.052841] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.093800] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.123029] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.158774] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.187857] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.227248] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.258045] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.296945] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.325548] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.362950] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.393041] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.431757] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.460637] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.499317] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
[ 180.968935] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)

         and i get the state of /dev/ttymxc0:

normal:

root@imx6solosabresd:~# stty -F /dev/ttymxc0
speed 115200 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol =
; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -icrnl -imaxbel
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

after issue:
root@imx6solosabresd:~# stty -F /dev/ttymxc0
speed 115200 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol =
; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint ixoff -imaxbel
-iexten

      and after i re-connect them , the uart is not any output, but when i enter "ctrl + c" or "ctrl + q".

      i can see the application run again and log out normal again.

      this is a strange question, look like the application run from the console is freezed.

      i don`t have any idea about it, hope the nxp community can help me.

Thanks, vecio.lin.   

0 Kudos
1 Solution
3,540 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Vecio,

   网上有同行也遇到类似的问题,其他平台也有类似的情况,你看看这个:

http://www.voidcn.com/article/p-qktsverg-bau.html 

硬件加下拉可以解决这个问题。

我觉得你看看情况,如果必要性不是太大,就不要修改硬件了。

Have a  nice day!

B.R,

weidong

View solution in original post

0 Kudos
11 Replies
3,540 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Vecio,

The issue should be caused by SecurCRT, After you re-connect USB TO UART bridge to PC, you can disable current connection firstly, then enable it again.

I also use SecurCRT, and I often operate it like above.

In addition, when debugging board, try your best not to plug it in or out repeatedly.

Hope the information is helpful to you.

Have a nice day!

B.R,

Weidong

0 Kudos
3,540 Views
vecio_lin
Contributor II

hi wigros,

but i also try other serial tool,like Xshell,putty,mtputty,the result is same as securCRT.

and i tried chips from other platforms , no such problem。 

and i can`t understand why the entire application running in the console will be blocked.

i run an application for communicate with mcu in the uart1, and feed the mcu dog regularly through uart1。

after the issue happend, my mcu can`t get any response from the imx6, it will cause the mcu think the imx6 is died, and reset the imx6 through the reset pin.

hope to have a deeper explanation, thanks.

br

vecio lin.

0 Kudos
3,540 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Vecio,

    Could you draw a diagram of your connetions and paste it here?

weidong

0 Kudos
3,540 Views
vecio_lin
Contributor II

hi wigros,

      of course. the diagram is shown below.

 pastedImage_1.png

BR

vecio.lin.

0 Kudos
3,540 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Vecio,

It is recommended to test by another method:
Write a program that prints a string of strings every 1 second in C and run it on the board. Test again and see the results.

Have a nice day!

B.R,

Weidong

0 Kudos
3,540 Views
vecio_lin
Contributor II

hi wigros,

   the shell script just a sample way i test.

   and my application is write by C, and print the log every 1 second. the program will feed the mcu`s wacthdog every 1 second.

   so the result is same as the shell script.

BR,

Vecio lin.

0 Kudos
3,540 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi  Vecio,

   I found you are in Chinese, so let me discuss it with you in Chinese, if you can't understand Chinese well, let me know.

我还有点疑问就:

1. 这个现象和UART1-->MCU是否有关系?

2. 我看到你的连接是I.MX6S板子UART0---<UART TO USB>---USB OF PC,因此你有一个USB转串口的线或者板子。当您从PC上拔掉USB to UART线时,再插上,发现terminal中端没有显示了。这是您现在遇到的问题。

3. 我是这样考虑的,您是否可以试试:

在terminal软件正常显示时,您把I.MX6S UART0和USB TO UART桥断开,而PC端你不要拔下来,然后过一会儿再把I.MX6S UART0和USB TO UART再连接起来看看是否可以显示(尽管UART接口不允许热插拔,但是测试一下是可以的。);或者您可以在板子UART0与USB TO UART断开时,测量UART0_TXD是否有信号出来也可以。

通过这样的实验,就是想知道是板子端UART0造成的,还是USB TO UART转换桥造成的。我们EVK板子上,直接把转换桥画在板子上了,用法和你的类似。

I.MX6Q/D/DL/S使用的客户特别多,有的客户设计高铁应用,使用UART0做debug口,其余4个口用于RS485,通信环境很复杂,没听他们反馈类似的问题。所以,我也很好奇这个现象。

Have a nice day!

B.R,

Weidong

0 Kudos
3,540 Views
vecio_lin
Contributor II

Hi Wigros,

      uart0跟usb to uart断开,这时候txd有一段数据,之后就再也没有任何数据了。

      txd拔出后的这段数据,我看dmesg。

sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)

      应该跟这个有关系。

0 Kudos
3,541 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Vecio,

   网上有同行也遇到类似的问题,其他平台也有类似的情况,你看看这个:

http://www.voidcn.com/article/p-qktsverg-bau.html 

硬件加下拉可以解决这个问题。

我觉得你看看情况,如果必要性不是太大,就不要修改硬件了。

Have a  nice day!

B.R,

weidong

0 Kudos
3,540 Views
vecio_lin
Contributor II

hi wigros,

   尝试加了硬件下拉确实复现概率降低了,目前不打算修改硬件了,出厂的时候把uart直接给disable掉。

   感谢您的耐心解答。

 

Have a  nice day!

BR

vecio.lin

0 Kudos
3,540 Views
vecio_lin
Contributor II

hi wigros,

   

1. 这个现象和UART1-->MCU是否有关系?

   与uart1-> mcu 没有关系,只是我们的应用有这个内容而已。

2. 我看到你的连接是I.MX6S板子UART0---<UART TO USB>---USB OF PC,因此你有一个USB转串口的线或者板子。当您从PC上拔掉USB to UART线时,再插上,发现terminal中端没有显示了。这是您现在遇到的问题。

   terminal端没有应用的log显示,内核的log是可以正常显示的。

   并且从init.d/rcS运行起来应用没有正常在跑,如何判断没有正常在跑,是因为我们的应用会跟通过uart1跟mcu进行喂狗操作,但是mcu没有收到喂狗的信息,最终把系统复位了。

3. 我是这样考虑的,您是否可以试试:

在terminal软件正常显示时,您把I.MX6S UART0和USB TO UART桥断开,而PC端你不要拔下来,然后过一会儿再把I.MX6S UART0和USB TO UART再连接起来看看是否可以显示(尽管UART接口不允许热插拔,但是测试一下是可以的。);或者您可以在板子UART0与USB TO UART断开时,测量UART0_TXD是否有信号出来也可以。

   这个有尝试,如果吧uart0跟usb to uart再连接起来的话,可以正常显示。

   uart0跟usb to uart断开,这个我去再测试一下uart0_txd的信号。

0 Kudos