8000 docs/esp8266,esp32: Correct description of esp.osdebug(). · micropython/micropython@a6154ef · GitHub
[go: up one dir, main page]

Skip to content

Commit a6154ef

Browse files
committed
docs/esp8266,esp32: Correct description of esp.osdebug().
The behaviour described in the docs was not correct for either port. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 557da49 commit a6154ef

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

docs/library/esp.rst

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,18 @@ Functions
6262

6363
.. function:: flash_erase(sector_no)
6464

65-
.. function:: osdebug(level)
65+
.. function:: osdebug(uart_no, [level])
6666

67-
Turn esp os debugging messages on or off.
67+
Change the level of OS serial debug log messages.
6868

69-
The *level* parameter sets the threshold for the log messages for all esp components.
70-
The log levels are defined as constants:
69+
On ESP8266, this output is initially disabled. On ESP32, it is initially
70+
enabled for Error output only.
71+
72+
``uart_no`` is the number of the UART peripheral which should receive
73+
OS-level output. On ESP32, this parameter must be set to ``0``.
74+
75+
The optional *level* parameter is only supported on ESP32. It sets the threshold
76+
for the log messages for ESP-IDF components. The log levels are defined as constants:
7177

7278
* ``LOG_NONE`` -- No log output
7379
* ``LOG_ERROR`` -- Critical errors, software module can not recover on its own
@@ -77,6 +83,15 @@ Functions
7783
* ``LOG_VERBOSE`` -- Bigger chunks of debugging information, or frequent messages
7884
which can potentially flood the output
7985

86+
.. note:: ``LOG_DEBUG`` and ``LOG_VERBOSE`` are not compiled into the
87+
MicroPython binary by default, to save size. A custom build with a
88+
modified "``sdkconfig``" source file is needed to see any output
89+
at these log levels.
90+
91+
.. note:: Log output on ESP32 is automatically suspended in "Raw REPL" mode,
92+
to prevent communications issues. This means OS level logging is not
93+
seen when using ``mpremote run`` and similar tools.
94+
8095
.. function:: set_native_code_location(start, length)
8196

8297
**Note**: ESP8266 only

0 commit comments

Comments
 (0)
0