-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyterm on stdio_cdc_acm stops working after a few seconds #16077
Comments
To narrow down the problem, please report on the following:
|
The worst thing is, nothing is disconnected from what I see:
|
OK thanks, that narrows it down already a bit. Just to verify that it's not any other build system related issue, please try running just If that also runs into the error conditions, next steps based from there are to try:
|
Ok so, with I took the liberty of adding an infinite loop at the end of the main with a
As you can see, at 14:22:19 it recovers but obviously something happened before. It takes approximately 18 seconds everytime. I tried it a few dozen times. I tried using
So, there's the Fedora log after that line, it's a bit hard to read, but we can see the strace output> write(1, "Welcome to pyterm!\nType '/exit' "..., 41) = 41 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, TIOCGWINSZ, {ws_row=24, ws_col=141, ws_xpixel=0, ws_ypixel=0}) = 0 ioctl(0, TIOCSWINSZ, {ws_row=24, ws_col=141, ws_xpixel=0, ws_ypixel=0}) = 0 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0 select(1, [0], NULL, NULL, NULL) = 1 (in [0]) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) read(0, "/", 1) = 1 select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0 write(1, "/", 1) = 1 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, 8) = 0 select(1, [0], NULL, NULL, NULL) = 1 (in [0]) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) read(0, "e", 1) = 1 select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) write(1, "e", 1) = 1 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, 8) = 0 select(1, [0], NULL, NULL, NULL) = 1 (in [0]) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) read(0, "x", 1) = 1 select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) write(1, "x", 1) = 1 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, 8) = 0 select(1, [0], NULL, NULL, NULL) = 1 (in [0]) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) read(0, "i", 1) = 1 select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) write(1, "i", 1) = 1 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, 8) = 0 select(1, [0], NULL, NULL, NULL) = 1 (in [0]) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) read(0, "t", 1) = 1 select(1, [0], NULL, [0], {tv_sec=0, tv_usec=0}) = 0 (Timeout) write(1, "t", 1) = 1 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, 8) = 0 select(1, [0], NULL, NULL, NULL) = 1 (in [0]) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 pselect6(1, [0], NULL, NULL, NULL, {[], 8}) = 1 (in [0]) read(0, "\r", 1) = 1 write(1, "\n", 1) = 1 ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x7f7bd580bc30, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7bd5519970, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f7be2e45860}, 8) = 0 getpid() = 126536 write(6, "2021-02-24 14:50:52,422 # Exitin"..., 41) = 41 write(1, "2021-02-24 14:50:52,422 # Exitin"..., 41) = 41 stat("/home/nharel/.history", {st_mode=S_IFREG|0600, st_size=6, ...}) = 0 readlink("/home/nharel/.history", 0x7fff4e329870, 4096) = -1 EINVAL (Invalid argument) getpid() = 126536 openat(AT_FDCWD, "/home/nharel/.history-26536.tmp", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 12 write(12, "/exit\n", 6) = 6 close(12) = 0 readlink("/home/nharel/.history", 0x7fff4e329870, 4096) = -1 EINVAL (Invalid argument) rename("/home/nharel/.history-26536.tmp", "/home/nharel/.history") = 0 chown("/home/nharel/.history", 663613, 200471) = 0 close(6) = 0 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, {sa_handler=0x7f7be2b87d75, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f7be2e45860}, 8) = 0 sigaltstack(NULL, {ss_sp=0x55b29bdd9e80, ss_flags=0, ss_size=16384}) = 0 sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}, NULL) = 0 munmap(0x7f7bd4e11000, 593920) = 0 exit_group(0) = ? +++ exited with 0 +++ [edit: formatting of strace output] |
If you add more verbose to your output, does it still take ~ 18 seconds or less ? |
From what I can see it doesn't change anything. Ok, so further testing, if I start pyterm while the board has already been running for a while, everything works fine:
|
Phew, the behavior sounds like it's waiting for a buffer to fill without a timeout, but then doesn't. @OlegHahm, any do you have a clue? |
Just so you know, we've started using the RS232 debugger again, it's not optimal but it is working fine for us. It's a bit of a struggle now since every time we flash an riot example/test on the board with have to add the stdio_uart module. |
On Fri, Mar 05, 2021 at 03:28:52AM -0800, Nicolas wrote:
Just so you know, we've started using the RS232 debugger again, it's
not optimal but it is working fine for us. It's a bit of a struggle
now since every time we flash an riot example/test on the board with
have to add the stdio_uart module.
Is using socat (eg. as in
```
export RIOT_TERMINAL=socat
make all flash term
```
not a viable option?
It seems to work, does not need changes to any firmware, and can be set
selectively on the hosts where pyterm causes trouble, and (more
importantly to me) also shows if there is anything about the problem
that triggers in socat too (but maybe much more rarely).
|
It is a viable option, it is true. But it's a bit less handy since every time you flash or reboot the board, socat disconnects and you have to restart it manually unlike the RS232 debugger where you can flash without disconnecting anything. Since it will probably identify the problem, I'm going to use socat for a while see if anything weird occurs. Edit: I'm going to try and add some options witch socat so it reconnects automatically =) |
Ok so none of the options I tried work with socat, (forever, retry...), I get this output: I'll try to make some sort of udev rule on my machine so it automatically launches a socat command when plugged in. |
Before a udev rule, a simple |
Sorry for the long latency. If I understand correctly, the issue is that I'd say this is likely an issue in I'll close this for now since this has been stale for so long. If there still is an issue, please re-open :) |
Hello everyone,
Context
So we've decided to update our RIOT to the newest version available (ours was a 2019 version) and we're encountering a very unexpected issue.
We were originally using the Particle Xenon board with an UART debugger but since the terminal can be accessed through the USB port now, we decided to try it.
Description
Unfortunately we're encountering a really weird issue:
The terminal stops displaying anything after a few seconds. To test this we used the very simple hello-world example and added a 3-4 seconds delay at the start of the main. Without the delay, the messages are displayed correctly, with it, nothing (except the "this is riot" text at boot).
Same thing is happening with our project, after a few seconds, nothing is displayed anymore, we only get a few seconds worth of messages. And everything is still connected. I honestly do not get it.
Of course everything still works fine when using the stdio_uart module.
Funny thing is, this seems to happen only when using pyterm on Fedora... No problem on Ubuntu. Leading me to think this might be a problem related to pyterm ?
We'd use our VM on Ubuntu, but each reset/reprogramming disconnect the board when using the USB port, meaning we miss the xenon's boot and have to redirect the USB device to our VM every single time...
I can't test with different boards at the moment except other particle xenons, I have none. Anyone ever encountered such an issue ?
PS: We use the particle JTAG programmer, so no flashing through the USB yet. One problem at a time =)
The text was updated successfully, but these errors were encountered: