-
Notifications
You must be signed in to change notification settings - Fork 7.6k
"Serial.available()" does not work after update to "Update IDF to 9a26296" from Sep 12, 2017 #645
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
I have a similar/same problem. I am new to ESP32 (just downloaded from GIT yesterday) and trying to migrate a working sketch from ESP8266. The sketch hangs (but does not crash) either in serial.available or serial.read (which no doubt calls available). It looks like a locking problem as if HAL locks are disabled it does not hang (but fails to find anything in the queue). |
As an update to my previous post, I went back to one commit prior to the "Update IDF to 9a26296" commit and serial.available still fails. I have now rolled back to 9th September commit and serial.available() is working OK. I am using Adafruit Feather ESP32 , Arduino IDE 1.8.2. |
@Outersite "serial.available()" works ok with the commit from Sep 11, 2017, ("add Microduino-esp32 (#621)", Tree: 0bce98e). "serial.available()" FAILS, (sketch hangs), with the commit from Sep 12, 2017, ("Update IDF to 9a26296", Tree: ba929be). But maybe I have missed something or there is another bug that affects your current project. |
Fixed!!! e2bd93c |
@me-no-dev But I am sorry to tell you, that the Bug still persists, the sketch still hangs when using "serial.available()"! I cleaned up everything, but no luck at all! I will try again later. |
but I so tested this ;) my Serial now works fine: void loop(){
while(Serial.available()) Serial.write(Serial.read());
} |
@me-no-dev Is there anything wrong with the following Test-Sketch? This works without problems on "Tree: 0bce98e", but leads now to constant reboot on "Tree: d27d297". uint32_t while_loop_count = 0;
uint32_t loop_count = 0;
void setup() {
Serial.begin(115200);
delay (1000);
Serial.println("Serial Port ok!");
}
void loop() {
Serial.print("loop_count: "); Serial.println(loop_count);
while (Serial.available())
{
Serial.print("inside while_loop_count, got: ");
Serial.write(Serial.read());
Serial.println();
while_loop_count++;
}
loop_count++;
delay (500);
} |
I will replace the serial driver with the one in IDF and we will see how things will go. I need to do it anyway and there were some changes in IDF that are probably causing this. |
@me-no-dev |
Visited the Great Wall and the Forbidden City in Beijing, so surely I had a great weekend! Long dream of mine :) Will try to replace the driver this week if nothing major comes in between |
Impressive! Thank you and good luck! |
Please pull the latest changes and report :) Thanks! |
@me-no-dev This means we are now able again to send serial-data or serial text-commands, of reasonable and preferably predefined max-length, from the arduino-console to the ESP32. I guess this is what most arduino-users will use the ESP32-Serial-Input for. So, thank you very much again and have a good day! |
Actually very little changed in the Serial driver. It is basically how the interrupt is defined, and not to check serials hat are not enabled. Everything else is the same. I imagine you might just need to read from serial more often, so you can get the data in smaller chunks, but really none of that changed between the versions. |
Thank you for your advice. |
I am using the most recent version and for me serial read and serial available is still not working. I wanted to send a string of characters to ESP32. |
@muktillc Keep in mind, that the esp32 unlike "normal" Arduinos has a real operating-system which is very unforgiving if you try to read or write from or to "forbidden" memory-locations and this can happen very easily! |
Finally. Got it working.
…On Sun, Nov 5, 2017 at 6:15 AM, xterminos ***@***.***> wrote:
@muktillc <https://github.com/muktillc>
I am sorry but I can not confirm this.
I tested all my "weird" serial-stuff and everything worked as expected!
I tested on Tree: 126674c
<126674c>
from Oct 30, 2017.
Keep in mind, that the esp32 unlike "normal" Arduinos has a real
operating-system which is very unforgiving if you try to read or write from
or to "forbidden" memory-locations and this can happen very easily!
At the beginning I often had all kinds of strange bugs with
character-arrays and loops.
Programs that allways worked flawlessly on every normal Arduino did silly
things on the esp32.
For example: Your loop counts to 100 and everything is ok, ... your loop
counts to 101 -> strange things happen! I then assumed everything, even a
damaged esp32. But the culprits always were wrong indexes when I tried to
access buffers or char-arrays, one Byte can make the difference between
success and debugging-hell.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#645 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aetc8DVp4Iiwn3WXOBK_f4CAZ1HfQZ_Yks5szZjDgaJpZM4PdLU4>
.
|
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: 12/jul/2017
IDE name: Arduino IDE 1.84
Flash Frequency: 80Mhz
Upload Speed: 921600
Description:
As far as I can see "Serial.available()" no longer works after I updated to "Update IDF to 9a26296" from Sep 12, 2017. As soon as I try to send some chars from the arduino-serial-monitor the sketch hangs!
Sketch:
This is a slightly modified "SerialEvent"-Example from the Arduino-IDE built-in examples.
Debug Messages:
none
The text was updated successfully, but these errors were encountered: