Skip to content

printf() doesnt produce any output #491

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

Closed
pastcompute opened this issue Jun 30, 2015 · 3 comments
Closed

printf() doesnt produce any output #491

pastcompute opened this issue Jun 30, 2015 · 3 comments

Comments

@pastcompute
Copy link
Contributor

Using a very simple program Serial.begin(); Serial.println("Hello World"); works, but Serial.begin(); printf("Hello, world\n"); produces no output.

I had a look at the code, printf() ends up calling ets_vprintf so I assume that that call is not working either.

I haven't done anything unusual yet, just an ESP201 module.

Is there some (undocumented) call to enable mixing of ets_printf with Serial? I know when using the SDK there is some trickery involved in making a workable printf function on the uart in various cases...

@igrr
Copy link
Member

igrr commented Jun 30, 2015

Serial.setDebugOutput(true); should enable ets_printf output through Serial.

@igrr
Copy link
Member

igrr commented Jun 30, 2015

extern "C" void system_set_os_print(int);

void setup() {
  system_set_os_print(...);
}

@pastcompute
Copy link
Contributor Author

No worries. thanks that worked. I add a pull request to mention setDebugOutput in the readme

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

No branches or pull requests

2 participants