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

PlatformIO: silence postmortem stackdump for boards using serial #1664

Merged
merged 5 commits into from
Mar 29, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Mar 29, 2019

Dummify hardcoded ets_printf / ets_printf_P from postmortem.
It uses serial to print stackdump whenever board reboots after an error, and we do not want that when using serial connection with some external device chip.

ref: https://github.com/esp8266/Arduino/blob/f139519061bdb81dfc6d41e9cd704fd455f1647a/cores/esp8266/core_esp8266_postmortem.cpp#L85
SuperHouse/esp-open-rtos#188

@mcspr
Copy link
Collaborator Author

mcspr commented Mar 29, 2019

tested locally with espurna-core bin and Serial.begin(115200) in setup(). erase.config in telnet session prints small stack-trace to the serial in normal builds, and no longer does with this one

edit
We can't call Serial.end(), because our custom crash callback is called after serial printing is done.

Another option hinted via this linker flag:
https://github.com/esp8266/Arduino/blob/a3ea816e65029f0d79bdc19d84971f5de3858b01/tools/platformio-build.py#L88
system_restart_local is split into two functions: __wrap_system_restart_local (custom Arduino implementation) and __real_system_restart_local (original sdk function). But our callback function will not be called, so we will need to reimplement part of it and again replace it using objcopy.

Just removing printf seems easier to understand later.

@xoseperez xoseperez merged commit 0a8b2ab into xoseperez:dev Mar 29, 2019
@mcspr mcspr deleted the pio/silence-uart branch March 29, 2019 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants