Red Pill or Blue Pill?

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
Post Reply
User avatar
RogerClark
Posts: 6662
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Nov 02, 2015 1:50 am

@jcw
Edit - fixed my comment above about trying to use USBserial.
There is a lot of history around USBSerial

We (well actually I ) got rid of its usage in the sketch, as it was non-standard.

When Leaflabs wrote the libmaple core, none of the AVR boards had onboard usb serial, so LeafLabs for some reason chose to call the serial over usb by a different name.

But in 2014 when I looked at it, in the light of the AVR Leonardo and the Due, it made more sense / more compatibility to map the Serial USB to Serial for the Maple mini.

I agree it can be confusing, that the upload method changes this, but I assumed that if you are using an external device to upload that inherently has serial i.e a Serial to USB converter or the BMP, then it makes sense to assume you are doing this for a reason and want to not use the onboard USB

The confusion is that the BMP does both. Its both a debugger and also has Serial USB.

STlink does not have USB Serial, so it made sense to enable it for STLink.



So, yes it can be confusing, but I suspect its because you are using the BMP ;-) if you were using STLink you'd not have noticed a conflict ;-)

User avatar
mrburnette
Posts: 1795
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Red Pill or Blue Pill?

Post by mrburnette » Mon Nov 02, 2015 1:57 am

RogerClark wrote: <...>
So, yes it can be confusing, but I suspect its because you are using the BMP ;-) if you were using STLink you'd not have noticed a conflict ;-)
For we Maple Mini owners, it works just like the Arduino Pro Micro. It all works rather well, IMO.

Ray

jcw
Posts: 171
Joined: Mon Oct 26, 2015 8:16 am

Re: Red Pill or Blue Pill?

Post by jcw » Mon Nov 02, 2015 2:11 am

Ray,

I've flashed a Maple Mini with the 2.0 boot loader, and I can see the upload progress bars, but the code either doesn't start, or the next upload doesn't start, or the IDE loses track of the serial port (I'm on Mac OSX). This is after overcoming my confusion with BMP. So it's been anything but smooth sailing for me so far. I'd really love to just be able to upload over USB.

But USB and the boot loader don't seem to want to be friends with me!
I do have some hope that maybe November will be better...

-jcw

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

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Nov 02, 2015 2:32 am

@jcw

Try running the reset script manually, and see if the Maple mini resets

Ah. Another possible issue was the name of the TTY port. I can't quite remember the details, but there was an issue with the TTY driver on OSX which we had issues with.

I recall needing to change something in STM32Flash as the TTY port was not getting called the correct name.

I will try to find a Maple mini with the new bootloader on it, and test with my 2 different Mac's later, in case we now have a problem which we didnt use to have

User avatar
Rick Kimball
Posts: 987
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Red Pill or Blue Pill?

Post by Rick Kimball » Mon Nov 02, 2015 2:36 am

I've found that most people use Serial for debug output. If you use a debugger you can often dispense with Serial all together. Even when you do want serial output, directing it to a UART makes your code smaller and does not use CPU cycles as does the USB UART.
-rick

jcw
Posts: 171
Joined: Mon Oct 26, 2015 8:16 am

Re: Red Pill or Blue Pill?

Post by jcw » Mon Nov 02, 2015 3:04 am

RogerClark wrote:So, yes it can be confusing, but I suspect its because you are using the BMP ;-)
The current approach implies that an STM32 board plus BMP are not usable for a sketch which will run standalone (if that sketch needs to communicate with the outside world). IOW, I can't build a sketch with USB in it, upload it with the BMP, remove the BMP, and use it. Are you really sure that this is as intended?

-jcw

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

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Nov 02, 2015 3:14 am

No that was not the intention.

Rick.... Would you mind if we enabled USB serial for BMP ?

Or can we just add an option for this via a menu, and default it to Off

User avatar
Rick Kimball
Posts: 987
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Red Pill or Blue Pill?

Post by Rick Kimball » Mon Nov 02, 2015 3:28 am

Would you mind if we enabled USB serial for BMP ?
I'm fine with that.
-rick

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

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Nov 02, 2015 4:10 am

Thanks Rick

We'll find out what @jcw wants when he wakes up in about 8 hours ;-)

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

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Nov 02, 2015 5:53 am

@jcw

I'll PM you.

But what board are you using ??

A Maple mini or a Generic STM32F103C

If you are using a Maple mini board, but have selected the Generic STM32F103C option, its not going to work, because the USB reset stuff will not be correct for a Maple mini.

I have a feeling that what you are really asking for is the BMP option on the Maple mini.

But as we have tried to keep things as simple as possible for new users, the Maple mini does not that option.

If you want to use BMP on a Maple mini you'd need to add the upload menu from the Generic F103C to the Maple mini board section, in boards.txt, but you'll need to remove the define for "Generic Bootloader" as this means actually tells the build process that your board doesnt have the Maple hardware and that it should reset the board via GPIO on the USB pin.

I know this name is somewhat confusing, and perhaps we should called this internal define by a more meaningful name, (and it could be changed), but what it really means is "Does not have maple USB reset hardware"

However thats a really long name.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests