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

cpu/esp8266: Moved stdio_init before periph_init #12225

Merged
merged 1 commit into from Sep 14, 2019

Conversation

maribu
Copy link
Member

@maribu maribu commented Sep 14, 2019

Contribution description

Added a call to stdio_init() right before calling `periph_init().

Testing procedure

Flash and run e.g. examples/default or examples/hello-world and see if stdio is working again

Issues/PRs references

Fixes bug introduced in #11367

@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Sep 14, 2019
@maribu
Copy link
Member Author

maribu commented Sep 14, 2019

@gschorcht, @benpicco: My ESP8266s and ESP32s are all at office, so this and #12224 are completely untested so far ;-)

@benpicco
Copy link
Contributor

Hm, no matter where I stick this in in startup.c, I can't get stdin to work.

If I put it back into sys/newlib_syscalls_default/syscalls.c:_init(), it's working, but not when even placing it right next to

    #ifdef MODULE_NEWLIB_SYSCALLS_DEFAULT
    _init();
    #endif

in cpu/esp8266/startup.c:ets_run()

- This guarantees that DEBUG() is available early in boot process
- Forgotten in RIOT-OS#11367, this fixes broken stdio
@maribu
Copy link
Member Author

maribu commented Sep 14, 2019

@benpicco: Please test again.

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I see double.
I'll ponder why all the init functions are there twice at another time, now this is working again.

Tested on esp8266-esp-12x.

@maribu
Copy link
Member Author

maribu commented Sep 14, 2019

Thanks for testing and nothing the bug, and the bug in the bugfix :-D

@maribu maribu merged commit 95a2081 into RIOT-OS:master Sep 14, 2019
@maribu maribu deleted the esp8266-early-stdio branch September 14, 2019 10:34
@gschorcht
Copy link
Contributor

I think I see double.
I'll ponder why all the init functions are there twice at another time, now this is working again.

Tested on esp8266-esp-12x.

There are two different startup functions for ESP8266, one if bare metal implementation without the terrible Espressif SDK is used used and one if the Espressif SDK is used (#if MODULE_ESP_SDK ... #else ... #endif). Since the Espressif SDK for ESP8266 is a horror it should be used only if it is really required, e.g., when the WiFi interface is used. Because the startup in both cases differs a lot, there is no common init function.

@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants