Skip to content
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

everything seems to work fine but I cant input anything #178

Open
thivmcthiv opened this issue May 23, 2023 · 3 comments
Open

everything seems to work fine but I cant input anything #178

thivmcthiv opened this issue May 23, 2023 · 3 comments

Comments

@thivmcthiv
Copy link

My os: Ubuntu 22

Problem:
I cant input anything, and when I type in characters to the console, nothing is echoed.

I tried running the kernel in qemu, and on my rpi4, but neither worked.

Example output that seems to be working fine from 09:

[    0.208975] mingo version 0.9.0
[    0.209061] Booting on: Raspberry Pi 4
[    0.209462] Current privilege level: EL1
[    0.209938] Exception handling state:
[    0.210382]       Debug:  Masked
[    0.210772]       SError: Masked
[    0.211162]       IRQ:    Masked
[    0.211552]       FIQ:    Masked
[    0.211942] Architectural timer resolution: 18 ns
[    0.212516] Drivers loaded:
[    0.212853]       1. BCM PL011 UART
[    0.213275]       2. BCM GPIO
[    0.213633] Timer test, spinning for 1 second
[    1.214163] Echoing input now

I thought maybe it was just my terminal so I wrote some rust to try sending bytes to /dev/ttyUSB0 where the rpi4 was connected:

//using serialport 3.0.0
fn write_to_serial_device(input: &str) {
    let port_name = "/dev/ttyUSB0";
    let mut settings: SerialPortSettings = Default::default();
    settings.timeout = Duration::from_millis(100);
    settings.baud_rate = 9600;
    match serialport::open_with_settings(port_name, &settings) {
        Ok(mut port) => {
            if let Err(e) = writeln!(port, "{}", input) {
                eprintln!("Error writing to serial port {}: {}", port_name, e);
            } else {
                println!("Successfully wrote to serial port {}", port_name);
            }
        }
        Err(e) => {
            eprintln!("Error opening serial port {}: {}", port_name, e);
        }
    }
}

that code didnt report any errors when executing, but still nothing was echoed in the console after running it.

fair warning, It is entirely possible that I am just misunderstanding something or making a dumb mistake because I have never worked with embedded rust before this so let me know if I shouldn't have opened this issue :))

@Tim-C1
Copy link

Tim-C1 commented May 27, 2023

I think you should test your uart on your rpi4 and your usb-to-tty converter works well, I encounter the same problem when I purchase a old rpi3.

@yonchicy
Copy link

yonchicy commented Dec 9, 2023

do you solve it ? I got the same problem on pi 3

@Tim-C1
Copy link

Tim-C1 commented Dec 13, 2023

do you solve it ? I got the same problem on pi 3

I remember my pi3's serial interface is malfunctioned, so I buy a new pi4 and everything works fine

I think you can test your serial interface on pi3 with some loop back test to see if it's hardware issue, also the usb to serial converter may also be considered as a source of issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants