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

ravedude serial console does not show any output on windows #227

Closed
RandoSY opened this issue Nov 19, 2021 · 8 comments
Closed

ravedude serial console does not show any output on windows #227

RandoSY opened this issue Nov 19, 2021 · 8 comments
Labels
ravedude windows Related to usage on Windows host systems.

Comments

@RandoSY
Copy link

RandoSY commented Nov 19, 2021

This is a great project, thanks for posting!

Very new to rust, but amazed how easy to get setup and testing. Seem to be building OK, but wondering where to set/place -P to COM12 statement, I've been using the RAVEDUDE_PORT env variable clumsily from the command line to get it flashing OK.

Here's a Windows 11 run, that hangs with no serial output from UNO seen.

C:\Users\randa\Desktop\avr-hal-main\examples\arduino-uno>cargo run --bin uno-i2cdetect
Finished dev [optimized + debuginfo] target(s) in 0.12s
Running ravedude uno -cb 57600 C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf
Board Arduino Uno
Programming C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf => COM12

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf"
avrdude: writing flash (1600 bytes):

Writing | ################################################## | 100% 0.04s

avrdude: 1600 bytes of flash written
avrdude: verifying flash memory against C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf:
avrdude: load data flash data from input file C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf:
avrdude: input file C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf contains 1600 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 1600 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.

Programmed C:\Users\randa\Desktop\avr-hal-main\target\avr-atmega328p\debug\uno-i2cdetect.elf
Console COM12 at 57600 baud


There it hangs and I don't see any output from the port. TeraTerm has same results.

Ideas?

@RandoSY
Copy link
Author

RandoSY commented Nov 19, 2021

I just noticed....

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

???

@Rahix
Copy link
Owner

Rahix commented Nov 20, 2021

Hm, just to rule out any oddities; did you try the uno-usart example?

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

Yeah, we don't program the fuses right now... Try flashing a program with Arduino IDE first to set them, just in case.

@RandoSY
Copy link
Author

RandoSY commented Nov 20, 2021

Thank you for the kind consideration of your prompt reply!

I know from hard won experience to get on a good, stable Ubuntu 20.04 machine for testing.

Once I had jumped through all the hoops to install rust, and ravedude, it runs like a champ on a low cost UNO clone.
So excited to bring this sophisticated software technology to the Arduino hardware platform!

Programmed /home/rasyoung/Codetest/AVR/Rust AVR/avr-hal-main/target/avr-atmega328p/debug/uno-i2cdetect.elf

 Console /dev/ttyUSB0 at 57600 baud

Write direction test:

  • 0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

Read direction test:

  • 0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- 57
    ^Z
    [2]+ Stopped cargo run --bin uno-i2cdetect

Begs the question what slight irregularity is keeping the Windows 11 console from working properly?

@Rahix Rahix changed the title So close to working :-( ravedude serial console does not show any output on windows Nov 21, 2021
@Rahix Rahix added the ravedude label Nov 21, 2021
@Rahix
Copy link
Owner

Rahix commented Nov 21, 2021

Maybe related to #176?

@Rahix Rahix added the windows Related to usage on Windows host systems. label Feb 8, 2022
@Fundevoge
Copy link
Contributor

This seems to be an issue with serialport: When changing the buffer size from 4098 to 1 solved the problem for me.
console.rs, line 24: let mut buf = [0u8; 4098];
Might not be the most efficient solution, maybe adding a cli argument to determine the buffer size could be an option.

@Rahix
Copy link
Owner

Rahix commented Aug 28, 2023

How about #[cfg(target_os = "windows")] (not sure what the exact cfg line was) for the single-byte buffer? Can you send a PR?

@Fundevoge
Copy link
Contributor

Seems good, did exactly that in #433

@Rahix
Copy link
Owner

Rahix commented Aug 29, 2023

Fixed by #433.

@Rahix Rahix closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ravedude windows Related to usage on Windows host systems.
Projects
None yet
Development

No branches or pull requests

3 participants