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
McDiver
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

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

Tommy

User avatar
Roberthh
Posts: 3667
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() (http://docs.micropython.org/en/latest/l ... sconnected).
On ESP32 and ESP8266 this is not possible, since the connect through UART.

Post Reply