- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
serial: uart_native_pty: IRQ support #93957
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
serial: uart_native_pty: IRQ support #93957
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tpambor :)
A few comments below
759d257    to
    4038f73      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tpambor
eec212a    to
    0370879      
    Compare
  
    | Rebased on main to fix merge conflict in  | 
| @tpambor something is not working as it should.. | 
| @tpambor I can see that in this case I just put above,  | 
0370879    to
    df7771a      
    Compare
  
    | 
 @aescolar I fixed the end of file detection. I think  | 
| 
 I think you are right. 
 it would seem the shell drops the initial input(?) | 
| 
 At least not in the uart driver. I added some debug prints and get identical following output with and without sleep. With the sleep I also get the help output. Data from the first read is flushed on start of shell, see Line 1444 in 0e3cd5b 
 | 
df7771a    to
    34e2bb7      
    Compare
  
    | With polling mode, this currently works because data is polled every 10ms using a timer. The first data becomes available only after the timer elapses once. In contrast, with interrupt mode, data is received immediately and flushed (due to being data received before activating the shell). To address this, I tested two solutions, both of which restore expected behavior for: 
 
  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overall this is ok.
Let's wait a couple of hours to see what @jakub-uC says about
https://discord.com/channels/720317445772017664/937768560137220155/1404782521719328798
As I think we do not need to do anything here to work around that shell behavior
Add support for the interrupt-driven API. Interrupts are emulated using a polling thread. Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Wait for prompt before sending command to ensure shell is ready. Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
34e2bb7    to
    b2de0dc      
    Compare
  
    | @aescolar I detailed a bit more the documentation. | 
| 
 | 
| This somehow breaks interaction between pytest and the shell. This is a snippet from running   | 
| 
 @henrikbrixandersen There was a similar problem with the sensor shell. The problem was that the tests did not wait until the shell was ready, see b2de0dc. I imagine something similar is happening for the can shell. I tried to do a hotfix #94424 | 
| I have opened a PR for reverting this until the problem is fully understood: #94426 | 



Add support for the interrupt-driven API to uart_native_pty.
Interrupts are emulated using a polling thread.