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

make flash doesn't preserve serial port settings #60

Closed
nkolban opened this issue Oct 25, 2016 · 5 comments
Closed

make flash doesn't preserve serial port settings #60

nkolban opened this issue Oct 25, 2016 · 5 comments
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally

Comments

@nkolban
Copy link
Contributor

nkolban commented Oct 25, 2016

When I execute make flash to flash an ESP32, I find that the serial port settings to my ESP32 aren't preserved after the flash completes. Here is a listing of the settings before a flash:

$ stty -F /dev/ttyUSB0 -a
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^H; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 100; time = 2;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

and the same settings after executing a make flash:

$ stty -F /dev/ttyUSB0 -a
speed 921600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^H; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 0; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc

I would have expected the settings to have been preserved.

@negativekelvin
Copy link
Contributor

Doesn't the port keep the settings from the last program that used/configured it? Which would be esptool.py

@nkolban
Copy link
Contributor Author

nkolban commented Oct 26, 2016

I guess what I am then querying is the semantics that using esptool.py changes the existent settings of the serial port without restoring them to their original values at termination. If we wish to define that the semantics of the serial port are "undefined" at the end of a run of esptool.py then that would be fine ... we just need clarity on what to expect ... and my un-considered expectations are that the serial port would have the same settings after running a utility as before.

@negativekelvin
Copy link
Contributor

Seems like more times than not it would be preferred that the settings stay the same as when the port was last used. Is there any precedent that a program stores and reverts the port settings? It's not something I would expect.

@projectgus
Copy link
Contributor

It seems reasonable we should restore the original serial port settings on exit. This would probably be better opened as an issue against github.com/themadinventor/esptool, but I can track it from here.

@projectgus
Copy link
Contributor

Moved to an esptool feature request.

@espressif-bot espressif-bot added Status: Opened Issue is new Resolution: Won't Do This will not be worked on Status: Done Issue is done internally and removed Status: Opened Issue is new labels Jun 20, 2022
mikkeldamsgaard pushed a commit to mikkeldamsgaard/esp-idf that referenced this issue Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

4 participants