8000 ESP32: "phy: phy_version" log message in raw mode · Issue #5119 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

ESP32: "phy: phy_version" log message in raw mode #5119

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

Open
nickzoic opened this issue Sep 18, 2019 · 2 comments
Open

ESP32: "phy: phy_version" log message in raw mode #5119

nickzoic opened this issue Sep 18, 2019 · 2 comments

Comments

@nickzoic
Copy link
Contributor

Log messages are supposed to all be suppressed in raw mode (See PR #3817)
but this "phy: phy_version" message sneaks through. The interjected log message upsets all the usual REPL-bashing tools like ampy and mpy-utils.

This is on the official 1.11 build from https://micropython.org/downloads#esp32 . Brought to my attention by Seon @UnexpectedMaker and Jim @jimmo

To replicate, go into raw REPL with ctrl-A:

Type "help()" for more information.
>>>
raw REPL; CTRL-B to exit
>```

At raw repl, type (invisibly):

import network
network.WLAN().active(1)

... then hit Ctrl-D:

```OKI (9836120) phy: phy_version: 4007, 9c6b43b, Jan 11 2019, 16:45:07, 0, 0
>
@nickzoic
Copy link
Contributor Author
nickzoic commented Sep 18, 2019

Related discussion on ESP-IDF repo at espressif/esp-idf#1855 was closed, but without fixing the root cause.

#3817 silences messages by using esp_log_set_vprintf but this particular log message avoids it because it is printed directly via ESP_EARLY_LOGI rather than via esp_log_write.

Note comments in $ESP_IDF/components/esp32/lib_printf.c:

 * used by WiFi libraries in the `lib` directory.
 * These function are used to catch any output which gets printed
 * by libraries, and redirect it to ESP_LOG macros.
 *
 * Eventually WiFi libraries will use ESP_LOG functions internally
 * and these definitions will be removed.

We could presumably provide our own lib_printf.c which overrides these functions to call into the esp_log_write mechanism ...

@dpgeorge
Copy link
Member

Hmm, so one option would be to just disable logging, using ESP_LOG_NONE. But that's probably a last resort since logging is useful.

I wonder if we can define LOG_LOCAL_LEVEL to be a dynamic value so the level can be changed at runtime? Eg:

#define LOG_LOCAL_LEVEL (log_local_level_variable)
int log_local_level_variable;

That will probably make the firmware really big because the levels can't be optimised out by the compiler.

Failing that we would need to provide our own implementation of the lib_printf.c file.

tannewt added a commit to tannewt/circuitpython that referenced this issue Apr 21, 2023
Add address_little_endian for epaper displays with little endian
(low byte first) addresses.

Also clears allocated display and display bus memory so it has a
known state. The acep member wasn't always set so it varied
accidentally.

Fixes micropython#7560. May fix micropython#7778. Fixes micropython#5119.
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
0