Booting normal or serial/usb

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Posts: 2
Joined: Mon May 07, 2018 12:17 pm

Booting normal or serial/usb

Post by McDiver » Fri Aug 09, 2019 11:22 am

In my code i need to check if the module booted in normal mode or with usb/serial connected.
How can i check that ?


User avatar
Posts: 2467
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Booting normal or serial/usb

Post by Roberthh » Fri Aug 09, 2019 11:42 am

Which board are you using? On STM32 board, you can check whether USB is connected e.g. with pyb.USB_VCP.isconnected() ( ... sconnected).
On ESP32 and ESP8266 this is not possible, since the connect through UART.

Post Reply