-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Slow serial baudrates cause exceptions / WDT #7746
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
Comments
Note: probably yield() needed in this while: Arduino/cores/esp8266/uart.cpp Line 477 in 8b662ed
|
or this one (might be lighter): Arduino/cores/esp8266/uart.cpp Line 509 in 8b662ed
|
Adding |
@devyte if(!LittleFS.begin()) |
@HakamSaffour
|
it seems to be working (using the alternative print function), no crash any more. |
True. Would it be wise to do that in Arduino/cores/esp8266/uart.cpp Line 509 in 8b662ed
while (size--)
uart_do_write_char(uart_nr, pgm_read_byte(buf++));
if (can_yield() && 100*size/(baud/10) > 0) {
// it takes more than 0.01s to print this string => yielding between chars
// ( <=> (1000*size)/baud>0 <~> (size<<10)/baud > 0 )
while (size--) {
uart_do_write_char(uart_nr, pgm_read_byte(buf++));
yield();
}
} else {
while (size--) {
uart_do_write_char(uart_nr, pgm_read_byte(buf++));
}
} |
I replaced 'baud' with 'baud_rate' but I did not find 'can_yield', any hint? if (can_yield() && 100*size/(uart->baud_rate/10) > 0) { |
In |
Hello @d-a-v Thank you for your solution. I made the modifications in uart.cpp - as mentioned by you - and I tried this code Sketch https://github.com/esp8266/Arduino/blob/master/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino and it looks to be working without any problem at baudrate = 110 and also at baud rate = 115200 shall I make a merge request to uart.cpp ? |
@HakamSaffour sure, please throw a PR our way. I'm not sure the exact changes, but this might also fix a problem w/MDNS debugging at 9600 baud (another issue open to document it) where I think it has the same overflow due to its chattiness. |
Wow... welcome to the 1970s! I haven't seen 110baud since I used an ASR33 Teletype over an acoustic-coupled modem time-sharing on an old Sperry Univac 9000 computer. Two tin cans and a piece of string is a more efficient method of data transfer... no wonder the issue never came up until now. |
Last week I had an user report WDT crashes when running software serial at 1200 baud. |
cc @dok-net |
fix for Slow serial baudrates cause exceptions / WDT credit goes to @d-a-v Reference issue: esp8266#7746 Signed-off-by: Hakam Saffour <[email protected]>
A PR is created. |
Basic Infos
Platform
Settings in IDE
Problem Description
I want to use LittleFS to save some data coming from serial port at baudrate 110, N81
I tested the provided example in:
https://github.com/esp8266/Arduino/tree/master/libraries/LittleFS/examples/LittleFS_Timestamp
and it works fine at baudrate 115200
but when changing baudrate to 110, the code seems to retart (exception)
I need to have a running FS at baudrate of 110, because I can not change the baudrate of the device I am connected to.
Sketch
https://github.com/esp8266/Arduino/blob/master/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
Debug Messages
@ Baudrate 110

@baudrate 115200

The text was updated successfully, but these errors were encountered: