Red Pill or Blue Pill?

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
stevestrong
Posts: 1502
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Red Pill or Blue Pill?

Post by stevestrong » Sat Apr 08, 2017 8:48 am

Check the soldering of the USB connectors.
Also, you should first erase the whole flash and then burn the STM32duino bootloader.
It should work after these steps.

X-death
Posts: 8
Joined: Fri May 27, 2016 9:50 am

Re: Red Pill or Blue Pill?

Post by X-death » Sat Apr 08, 2017 8:27 pm

STM32duino bootloader seems to works but when it's load my program usb failed.

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

Re: Red Pill or Blue Pill?

Post by stevestrong » Sat Apr 08, 2017 8:55 pm

Which method do you use to upload?
Usb serial should work if you use srm32duino bootloader method.

X-death
Posts: 8
Joined: Fri May 27, 2016 9:50 am

Re: Red Pill or Blue Pill?

Post by X-death » Sat Apr 15, 2017 10:28 am

When the bootlaoder is active i can use it for upload my own bin , it's works fine.
But when it's switch onto my own program the USB HID don't works...

User avatar
SukkoPera
Posts: 23
Joined: Tue Jun 07, 2016 11:02 pm
Location: Turin, Italy
Contact:

Re: Red Pill or Blue Pill?

Post by SukkoPera » Sat Apr 15, 2017 11:21 pm

Got myself a couple of Black Pills, I can confirm that https://raw.githubusercontent.com/roger ... 0_pb12.bin works nicely.

I have noticed that the CDC Serial does not wait for connection like it does on the Leonardo though, if I do the usual:

Code: Select all

 while (!Serial)
    ;
The program just goes on as if Serial was actually open, but it isn't. Is this normal? Does it happen with other STM32 boards too?

User avatar
Pito
Posts: 1498
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Red Pill or Blue Pill?

Post by Pito » Sun Apr 16, 2017 6:19 am

Try

Code: Select all

while(!Serial.available());
or

Code: Select all

while (!Serial) { SysCall::yield()};
with SdFat lib.
Pukao Hats Cleaning Services Ltd.

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

Re: Red Pill or Blue Pill?

Post by stevestrong » Sun Apr 16, 2017 9:18 am

For the USB serial we have:

Code: Select all

while ( !Serial.isConnected() ) ;

User avatar
SukkoPera
Posts: 23
Joined: Tue Jun 07, 2016 11:02 pm
Location: Turin, Italy
Contact:

Re: Red Pill or Blue Pill?

Post by SukkoPera » Sun Apr 16, 2017 5:44 pm

@Pito: Those are different things

@stevestrong: That works fine, thanks! But then this is a deviation from the Arduino API, why?

victor_pv
Posts: 1599
Joined: Mon Apr 27, 2015 12:12 pm

victor_pv

Post by victor_pv » Sun Apr 16, 2017 11:34 pm

SukkoPera wrote:@Pito: Those are different things

@stevestrong: That works fine, thanks! But then this is a deviation from the Arduino API, why?
The arduino API changes all the time, I bet when leaflabs added that function to libmaple there was no equivalent in the arduino API.

You can add the function to the corresponding file and submit a PR to Roger's repo, so it's available going forward.

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

Re: Red Pill or Blue Pill?

Post by stevestrong » Mon Apr 17, 2017 7:34 am

I have not seen any platform on which while ( !Serial ) ; actually works as expected (wait till serial connection is established).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest