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

Feedback from the terminal window after Hard resetting. #22

Closed
AlesJaklic opened this issue Aug 12, 2017 · 6 comments
Closed

Feedback from the terminal window after Hard resetting. #22

AlesJaklic opened this issue Aug 12, 2017 · 6 comments

Comments

@AlesJaklic
Copy link

AlesJaklic commented Aug 12, 2017

I receive no feedback in the terminal window after the message "Hard resetting..." after flashing the firmware and clearing the flash (Windows 7). Serial set to 115200. I expected to see a message from the Nodemcu board: "Formatting the file system. Please wait..." or something. I simply wait for 2 to 3 minutes, so that this initial formatting has time to finish :) and then disconnect and reconnect the USB power to the Nodemcu board and everything is OK. Am I doing something wrong or is this common on Windows?

@marcelstoer
Copy link
Owner

marcelstoer commented Aug 12, 2017

Formatting the file system isn't part of the flashing process. It will happen (if necessary) once you boot the device. You'll see that message if the device is connected to a serial console (e.g. ESPlorer) when it boots.

@AlesJaklic
Copy link
Author

AlesJaklic commented Aug 12, 2017

But the software does Hard reset ... so I imagine the process of booting and Formatting the file system starts right away (assuming that the Flash was erased before flashing), there is no time to connect to some other serial console manually. If I disconnect the board right after the Hard resetting message I end up with unusable firmware, if I wait for a few minutes and then disconnect I get correct LUA prompt on LuaLoader. This may all sound as naïve superstition :), but it is highly reproducible for me.

@marcelstoer
Copy link
Owner

marcelstoer commented Aug 12, 2017

Ah, I see...now I understand the issue.

It's actually not my software that does the hard reset but esptool.py (I merely built the GUI and a standalone binary for it) 😉 It does that by default but this is configurable.

A hard reset is like pressing the reset button on a devkit or otherwise restarting the device in normal mode i.e. not bootloader for flashing. So, your observation is absolutely correct. After the hard reset NodeMCU starts and formats the file system if necessary. It has internal logic to determine whether formatting is necessary.

The problem is that esptool.py hung up on the serial connection after it triggered the hard reset. Hence, you won't see the NodeMCU boot messages.

I see how not resetting could be useful but let me discuss this with the esptool.py folks first.

@marcelstoer marcelstoer reopened this Aug 12, 2017
@AlesJaklic
Copy link
Author

AlesJaklic commented Aug 12, 2017

I made a simple experiment using additional USB-to-Serial converter (COM11) at 115200 to capture the TX pin of the Nodemcu board during flashing and after the Hard resetting on (COM6).

formatting

It shows clearly that the "Formatting file system. Please wait ..." is under way right after the Hard resetting ... and if you disconnect the board during this, you get corrupted Nodemcu. It took less than a minute to format 4MB flash. So a quick and dirty workaround is to notify the user, to wait a few minutes before disconnecting the board after the "Hard resetting ..." message :)

@marcelstoer
Copy link
Owner

Clever, it proves what I stated in the previous comment.

@marcelstoer
Copy link
Owner

I see how not resetting could be useful but let me discuss this with the esptool.py folks first.

They agree with me -> I'll remove reset call.

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

No branches or pull requests

2 participants