Should the BluePill and MapleMini init code call Serial.begin

The official STMicroelectronics Arduino core
User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Should the BluePill and MapleMini init code call Serial.begin

Postby RogerClark » Thu Nov 24, 2016 7:09 am

I noticed that unlike LibMaple, if I don't call Serial.begin( in setup() I don't get Serial USB.

This is not a problem until you want to upload, because the IDE has no way to rest the board back into the bootloader unless Serial USB is running.

Perhaps at least for the Maple mini, we should replicate what LibMaple does, otherwise I can foresee a load of questions about why people can't upload.

e.g.
For the Uno etc, you do not need to call Serial.begin to be able to upload.

So perhaps if the user selects the Bootloader upload option, the code should call Serial.begin for the user.

stevestrong
Posts: 727
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Should the BluePill and MapleMini init code call Serial.begin

Postby stevestrong » Thu Nov 24, 2016 8:13 am

RogerClark wrote:if the user selects the Bootloader upload option, the code should call Serial.begin for the user.

+1

User avatar
zoomx
Posts: 352
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: Should the BluePill and MapleMini init code call Serial.begin

Postby zoomx » Fri Nov 25, 2016 1:50 pm

The UNO has the serial/USB converter that is active, so you have serial port in PC even if there is not any MCU on the board. It is an adapter built with an MCU or a chip as in clones.

Leonardo is different, since USB is built in. I don't have any Leonardo but I guess that it is the bootloader that ask the PC for a serial port maybe Leonardo uses serial load instead of DFU mode.

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Should the BluePill and MapleMini init code call Serial.begin

Postby RogerClark » Fri Nov 25, 2016 7:32 pm

I think I have a pro-micro board, which is like the Leonardo, so I will see what it does.

I think it can be USB HID as well as USB Serial, but I dont know how that works


Return to “STM Core”

Who is online

Users browsing this forum: No registered users and 1 guest