Red Pill or Blue Pill?

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
marekic
Posts: 8
Joined: Sun Sep 25, 2016 5:29 pm

Re: Red Pill or Blue Pill?

Post by marekic » Sat Oct 01, 2016 6:35 pm

ahull wrote:You can of course get the STM core to shutdown completely before you reach the lower limit of the RTC retention voltage, and run the whole thing on one battery rather than having a separate supply for the RTC.
I'm sorry, I'm not sure I understood you.

Currently I have a RTC module (DS3231) which has 3V button battery cell holder for retaining time, that I used with Pro Micro and tried using it with ESP8266.

I supposed that VBAT pin on STM32 board is only for RTC function of the board. Is this the case? Or is it used for other functions as well? I'm working on an aquarium controller, so I don't have the need battery powered STM32 board, I just need power for retaining time. Actually, I would prefer for the board not to do anything else but retain time when the power is disconnected.

User avatar
ahull
Posts: 1578
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Red Pill or Blue Pill?

Post by ahull » Sun Oct 02, 2016 12:56 am

The workings of the STM32 internal clock/calendar are detailed here.

The VBAT voltage preserves not only the clock but also some ram, which they call backup registers.

On boards where VBAT is hard wired to VCC then you will need to preserve VCC in order to preserve the clock and backup registers.

In a battery operated device, this can be done by putting the main processor to sleep, whereupon the power consumption drops to less than 1mA (considerably less if you implement this correctly and there are no other parts of your circuit, such as LEDs running).

This is not the best way to set things up, having a separate supply like a coin cell for VBAT is a better arrangement, but this is not possible on some boards due to the way they have been designed. If VBAT has not been hardwired to VCC, then you can add a coin cell to preserve the RTC and backup registers. If VBAT and VCC have been hardwired by the board design, then you must use other tricks.
- Andy Hull -

evildave_666
Posts: 28
Joined: Mon Apr 27, 2015 11:20 pm

Re: Red Pill or Blue Pill?

Post by evildave_666 » Tue Oct 18, 2016 10:49 am

My black pill board arrived today, net time was a little under 3 weeks to Japan, which is more than usual.

Pin row to pin row it is 0.1" wider than the blue/red pill boards. Overall it is 4mm longer and 2mm wider.
I'll solder headers on and try to bootload it tonight if I can get the baby to sleep.

marekic
Posts: 8
Joined: Sun Sep 25, 2016 5:29 pm

Re: Red Pill or Blue Pill?

Post by marekic » Wed Oct 19, 2016 8:35 pm

ahull wrote:The workings of the STM32 internal clock/calendar are detailed here.

The VBAT voltage preserves not only the clock but also some ram, which they call backup registers.

On boards where VBAT is hard wired to VCC then you will need to preserve VCC in order to preserve the clock and backup registers.
On my blue pill VCC is separate from VBAT. I only have one of these boards, I ordered four more from another seller, and we'll see if it is the same. I haven't had time to play with this yet. Anyways, thanks for your help, I'll dig into this in the following weaks.

marekic
Posts: 8
Joined: Sun Sep 25, 2016 5:29 pm

Re: Red Pill or Blue Pill?

Post by marekic » Wed Oct 19, 2016 8:42 pm

evildave_666 wrote:My black pill board arrived today, net time was a little under 3 weeks to Japan, which is more than usual.

Pin row to pin row it is 0.1" wider than the blue/red pill boards. Overall it is 4mm longer and 2mm wider.
I'll solder headers on and try to bootload it tonight if I can get the baby to sleep.
My arrived yesterday. It's also thinner than blue pill, and PCB gives impression of lesser quality. I was able to install stm32duino bootloader without any hardware modifications (but stil I haven't figured out how to setup Arduino IDE to be able to upload without ST-Link GUI on Windows - when compiling, Arduino IDE tries to run .bat files for uploading programs in wrong folders).

Onboard LED is on PB12.

I tried oscilloscope (thanks again Andrew :D ), and it works as it is (without control through serial). I'll probably add some buttons and LiPo, and mount it in a small box.
IMG_20161019_195840.jpg
IMG_20161019_195840.jpg (216.66 KiB) Viewed 1281 times

evildave_666
Posts: 28
Joined: Mon Apr 27, 2015 11:20 pm

Re: Red Pill or Blue Pill?

Post by evildave_666 » Sun Oct 23, 2016 7:49 am

I was also able to bootload the blackpill today and got usb upload and usb-serial working (on ubuntu though).

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

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Oct 24, 2016 5:49 am

My Black Pill arrived today

It seems to have a better USB connector than the BluePill in that it has through hole soldered pins holding it in place.

The downside of this board, is that the rows of pins are even wider apart than the BluePill so make it harder to use on a breadboard.

I installed the bootloader using STLink, but need to build a version that flashes PB12 as we don't currently have one with that config

Unfortunately at the moment I seem to have some build issue, I'm not sure if its a compiler version problem, as my default compiler is 4.9.3, but the IDE uses 4.8.3, so I think I better try going back to that version and confirm why any new bootloader I create doesn't seem to work correctly :-(

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

Re: Red Pill or Blue Pill?

Post by RogerClark » Mon Oct 24, 2016 6:20 am

Update.

Looks like the bootloader will not compile correctly with GCC 4.9.3 . Its probably the optimisation which is causing the problem
(I should have read my own ReadMe, as its listed in there that 4.9.x doesnt work. I am sure it can be bug fixed, as its probably one of the hardware addresses for the USB registers needs to be declared as volatile, but I don't have time to bug fix this at the moment)

So I've changed my default arm compiler back to 4.8.3 and compiled a new version of the bootloader for the BlackPill

The bootloader can be downloaded from github, here https://raw.githubusercontent.com/roger ... 0_pb12.bin


If I get time I'll also make a bootloader for the HYTiny STM32F103T, as I suspect the reason I could not make the bootloader work on that board may also have been the compiler version issue.

zmemw16
Posts: 1369
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Red Pill or Blue Pill?

Post by zmemw16 » Mon Oct 24, 2016 11:18 am

RogerClark wrote: The downside of this board, is that the rows of pins are even wider apart than the BluePill so make it harder to use on a breadboard.
daisy chain bread boards long side to long side, i use the 830(840??) hole ones with power rails each side. i've never tried it with one power rail; if not enough space, add another power rail( ??unsure, wasn't needed for my esp blocks)

of course, you'll need matching breadboards, there are at least 3 different spacing of the side tabs, i know, i have all 3 :D
some have a middle break in the power lines as well. quality of the contacts springiness is another story!
stephen

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 7:57 am

Hi all,
I request your help about the STM32 blue pill board.
I the beginning of this thread i have buyed one and you helped me for installing the bootloader (page 9).
with this board i have sucessfully completed my project an USB HID Sega Megadrive Cartridge Reader :

Image

https://github.com/X-death25/STM32_Proj ... adrive_HID

But i have buyed a pack of ten STM32 Blue pill on Aliexpress and when i solder these board on my PCB the USB enumeration fail...
i can hear the "usb fail sound".
it works just well with the same binaries on another blue pill board..
Strangly it's works fine with an old computer under Windows XP

i have tested a 1,8K resistor in parallel of PA12 & VCC3 but without sucess...
here is a picture of usb view

http://imgur.com/a/U9qLN

I don't understand were is the problem , the pcb and binaries is OK because it works with my first blue pill...
Could you help me ?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest