Topics

sticky Blue Pill Upgrade: RobotDyn F303CC


Khalid Baheyeldin
 
Edited

Over the past several months, some people on this mailing list have experienced issues with the Blue Pill.
These issues include:

  • Blue Pill module with only 64K of flash, rather than the 128K required for running OnStep.
  • Wrong resistor on Boot0, making flashing impossible.
So, finally, we have a solution to these issues, as well as upgrade path for those who already have a Blue Pill PCB.

Michael Ahner brought to my attention the RobotDyn STM32F303CCT6. George Cushing also did the same a few days afterwards.

and we found that it has several advantages:

  • Pin compatible with the Blue Pill (so will fit the PCB designed for the Blue Pill, without any hardware changes)
  • It has an Floating Point Unit (FPU), being an ARM Cortex M4, not M3 like the original Blue Pill
  • It has 256K of flash, so it is future proof
  • It can run OnStep with a Max Rate of 16 with the STM32Duino, so faster slewing
So it is fast and future proof, and offers a painless upgrade path for existing users.

Mike purchased a couple of units, and I added support for it in my fork, which he patiently tested out.

It is available directly from RobotDyn (link above) or AliExpress. In both cases, shipping is slower than usual, but that may be a temporary situation. When ordering, both the Arduino and ST versions work the same for OnStep, since we do not use the built-in USB port. It is up to you whether you choose the pins soldered or solder them yourself.

Today, Howard merged in my changes for this board, so OnStep master (version 4.20a and later) have all the changes needed for the RobotDyn F303CC.

If you want to try out this board, you need to install STM32Duino (search for "STM32" in the board manager). Select Generic F3 Series then RobotDyn BlackPill F303CC. You must select Optimize Fastest -O3 for optimal performance.

More information on STM32Duino is on the Wiki page for the Blue Pill (under OnStep 4), and FYSETC S6. Also see the video linked below.

Thanks to Michael Ahner who identified this module, bought a few, and patiently tested out the changes needed.

For flashing, the Boot0 pins are different from the Blue Pill. This diagram represents how they should be, relative to the USB connector. A + sign denotes the pins that should be connected:

Run Mode
    USB
   1 1+1 Boot0
   1 1+1 Boot1

Flash Mode
    USB
   1+1 1 Boot0
   1 1+1 Boot1

You should reverse the wires in the cable that goes from the Flash-Run switch to the Boot0 header, and it will work as documented in the Blue Pill Wiki. If you don't reverse the cable, then the Flash and Run are opposite to what is documented (i.e. Flash is towards the USB connector, and Run in away from the USB connector.

Here is an overview video showing the Blue Pill PCB with the RobotDyn F303 able to slew at a blazing fast 8.2 degrees per second!

Note: RobotDyn now makes two modules both named "Black Pill". One is the above, and the other is an STM32F411CE, which is used on the MaxSTM PCB designed by Howard. So, don't use just "Black Pill" referring to either board: instead, make sure you qualify by using F303 or F411.


Gerry Byrne
 

Ordering  this board from RobotDyn now. There are options to get the pinheaders soldered for a small fee. Should one do this and, if so, which option? Pinheader soldered or Arduino, pinheaders soldered?
Gerry

On Fri 23 Oct 2020, 02:18 Khalid Baheyeldin, <kbahey@...> wrote:
Over the past several months, some people on this mailing list have experienced issues with the Blue Pill.
These issues include:

  • Blue Pill module with only 64K of flash, rather than the 128K required for running OnStep.
  • Wrong resistor on Boot0, making flashing impossible.
So, finally, we have a solution to these issues, as well as upgrade path for those who already have a Blue Pill PCB.

Michael Ahner brought to my attention the RobotDyn STM32F303CCT6. George Cushing also did the same a few days afterwards.

and we found that it has several advantages:

  • Pin compatible with the Blue Pill (so will fit the0 PCB designed for the Blue Pill)
  • It has an Floating Point Unit (FPU), being an ARM Cortex M4, not M3 like the original Blue Pill
  • It has 256K of flash, so it is future proof
  • It can run OnStep with a Max Rate of 16 with the STM32Duino, so faster slewing
So it is fast and future proof, and offers a painless upgrade path for existing users.

Mike purchased a couple of units, and I added support for it in my fork, which he patiently tested out.

It is available directly from RobotDyn (link above) or AliExpress. In both cases, shipping is slower than usual, but that may be a temporary situation.

Today, Howard merged in my changes for this board, so OnStep master (version 4.20a and later) have all the changes needed for the RobotDyn F303CC.

If you want to try out this board, you need to install STM32Duino, and select Generic F3 Series then RobotDyn BlackPill F303CC. You can select Optimize Smallest -O3.

More information on STM32Duino is on the Wiki page for the Blue Pill (under OnStep 4), and FYSETC S6.

Thanks to Michael Ahner who identified this module, bought a few, and patiently tested out the changes needed.

Note: RobotDyn now makes two modules both named "Black Pill". One is the above, and the other is an STM32F411CE, which is used on the MaxSTM PCB designed by Howard. So, don't use just "Black Pill" referring to either board: instead, make sure you qualify by using F303 or F411.


--
Copernicus


Uwe Glässner
 

According to the Aliexpress page these are two different bootloader options, one with an ST firmware and one with an Arduino bootloader. I have therefore just placed an order for the soldered Arduino option and hope that is the right one.
Cheers
- Uwe


Mike Ahner
 

On Fri, Oct 23, 2020 at 12:30 AM, Gerry Byrne wrote:
Ordering  this board from RobotDyn now. There are options to get the pinheaders soldered for a small fee. Should one do this and, if so, which option? Pinheader soldered or Arduino, pinheaders soldered?
Gerry
Hi Gerry, I ordered the pinheader, not soldered directly from RobotDyn's website and used STM32duino as Khalid describes. I don't mind soldering and the modules came in a very small, flat padded envelope.

I don't know what are the differences between the "regular" version v/s the Arduino version.


Mike Ahner
 

On Fri, Oct 23, 2020 at 04:49 AM, Uwe Glässner wrote:
According to the Aliexpress page these are two different bootloader options, one with an ST firmware and one with an Arduino bootloader. I have therefore just placed an order for the soldered Arduino option and hope that is the right one.
Cheers
- Uwe
Hi Uwe,
As I mentioned to Gerry, I ordered directly from RobotDyn's page and ordered "Pinheaders not soldered". I don't know the differences, sorry but I think it won't matter. Reading thru that section again, it seems to be just a question of when the STM32duino bootloader gets loaded. I still used the Arduino IDE but installed STM32duino & the board library from Khalid's instructions here:
More information on STM32Duino is on the Wiki page for the Blue Pill (under OnStep 4), and FYSETC S6.


Khalid Baheyeldin
 

To Gerry and Uwe,

Whether you order with pins soldered or not, is up to you: if you want to save 10 minutes soldering them, and pay a few cents, then do it that way.

As for the Arduino vs. ST, it is just a pre-loaded bootloader to make it easier for those used to flashing through USB (most Arduino hardware). For the Blue Pill, we never use the built in USB connector anyway, since we flash using PA9/PA10 over the CP2102, so this is irrelevant. Just buy the cheapest option.


andrea tasselli
 

Bought a couple this morning. With pins. No bootloader. Will go on the next Blue Pill.

Andrea


Mike Gore
 

FYI - To try this out quickly and report some results I will upgrade one my STM32 BluePill modules -   I ordered the new CPU STM32F303CCT6 from Digikey  
I will swap the chip  on one of my spare BluePill boards and report back with my test results hopefully by Tuesday evening. 
I have a hot air rework station )
Presently  I am currently using a  STM32 Blue Pill on the Ontep STM32 PCB v 1.7. (using lastest software - running WiFi Server 1.15d,OnStep 4.20b, with stm32duino) - present setup works great! - This gives be a baseline.


Dave Schwartz
 

Sounds like you intend to replace just the MCU chip using SMD rework methods. This will not be feasible for practically anyone else and that is not what we mean by pin-compatible (although it may be true, we never verified that at the procesor-chip level). What has actually been done is to locate a source for a development module which is pin-for-pin compatible with the Blue Pill module. You would simply remove the Blue Pill module, insert this one, rebuild the software for the new module and go.

At present, the module can only be found from the manufacturer at https://robotdyn.com/stm32f303cct6-256-kb-flash-stm32-arm-cortexr-m4-mini-system-dev-board-3326a9dd-3c19-11e9-910a-901b0ebb3621.html or through their store on AliExpress https://robotdyn.aliexpress.com/store/1950989 where the shipping is much less but also much slower.

On 2020-10-26 1:46 a.m., Mike Gore wrote:
FYI - To try this out quickly and report some results I will upgrade one my STM32 BluePill modules - I ordered the new CPU STM32F303CCT6 from Digikey
I will swap the chip  on one of my spare BluePill boards and report back with my test results hopefully by Tuesday evening. ( I have a hot air rework station )
Presently  I am currently using a STM32 Blue Pill on the Ontep STM32 PCB v 1.7. (using lastest software - running WiFi Server 1.15d,OnStep 4.20b, with stm32duino) - present setup works great! - This gives be a baseline.


George Cushing
 

I find it best to cut the pins of the extant IC and then remove the pins. Much less chance of damaging the traces. 


Khalid Baheyeldin
 

Mike,

As Dave explained, what you intend to do (replace the chip only) is not what we did, nor what we recommend users to do.

But it would be interesting nonetheless to see if it works with the drastic SMD replacement that you will do.
Not that others will do it, but whether it works at all or not (pin assignments and such).

Let us know ...


Mike Gore
 

Hi,
I had previously ordered a few of the the robotdyn board after reading the article in instructables about doing the swap some time ago. The rework is only intended for testing - just while I wait. I am very aware this is a procedure that few could even  do. Also no one would want to do the swap as the CPU costs more then a new  board itself :-) ... At least in Canada.
Sorry if people got the wrong idea. It was just really an FYI that you'll have another tester very shortly



Mike Gore
 


Hi,
    The chip swap worked on the BluePill - ONSTEP is running fine on it - I can slew both axis just fine.
The cool thing about the new 303 CPU is that is has the exact same pin-out as the 103 did when you check the datasheets
(For the curious, please do not try this at home, please wait for the Robotdyn boards! Anyway,  I have attached a picture with the cpu removed and the new stm32f303 attached - you can see how wonderful re-flow works. I cleaned the boards with 95% ethanol,ie. rubbing alcohol, and a soft tooth brush after rework. After removing the old CPU I tinned the pads with solder then added flux and placed the chip in alignment - helps having a microscope - then used my hot air re-flow tool. Lastly I cleaned the board)

Here is the Arduino log from programming the chip - lots of free space

Sketch uses 130852 bytes (49%) of program storage space. Maximum is 262144 bytes.
Global variables use 12056 bytes (29%) of dynamic memory, leaving 28904 bytes for local variables. Maximum is 40960 bytes.
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.5.0                 
      -------------------------------------------------------------------

Serial Port ttyUSB0 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x422
BootLoader protocol version: 3.1
Device name : STM32F302xB-xC/STM32F303xB-xC/F358xx
Flash size  : 256 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M4



Memory Programming ...
Opening and parsing file: OnStep.ino.bin
  File          : OnStep.ino.bin
  Size          : 131276 Bytes
  Address       : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 64]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:40.329

RUNNING Program ...
  Address:      : 0x8000000
Start operation achieved successfully


On 10/26/2020 1:26 PM, Mike Gore wrote:
Hi,
I had previously ordered a few of the the robotdyn board after reading the article in instructables about doing the swap some time ago. The rework is only intended for testing - just while I wait. I am very aware this is a procedure that few could even  do. Also no one would want to do the swap as the CPU costs more then a new  board itself :-) ... At least in Canada.
Sorry if people got the wrong idea. It was just really an FYI that you'll have another tester very shortly



-- 
# Home: Mike Gore
# Mail: 405 Midwood Cres, Waterloo Ontario, N2L 5N4
# Phone: 519-884-4943
# Cell: 519-589-9303
# Email: magore@...
# Consulting: InfoWrite Consulting
# =========================================================
# Work: Mike Gore
# David R. Cheriton School of Computer Science, DC2609
# University of Waterloo, 200 University Ave West
# Waterloo Ontario, Canada, N2L 3G1
# Phone: 519-888-4567, x36205
# Email: magore@...


Khalid Baheyeldin
 

That is great for the skillful (and adventurous) ...

Did you compare the speed vs. a Blue Pill?
Share the results, and whether you have PULSE and what MICROSTEPS_GOTO is set for.
Also don't forget Optimize Fastest -O3

My results are in this video https://youtu.be/wQCT6ukKtL0
The F303CC is more than twice as fast when slewing as the F103.


Mike Gore
 

Initially I  used the same settings for both CPUS
I set my SLEW_RATE_BASE_DESIRED to 4 and  STEP_WAVE_FORM  to PULSE
AXIS1_DRIVER_MICROSTEPS to 32 and  AXIS1_DRIVER_MICROSTEPS_GOTO to 16
I am Using BigTree v1.2 5160 drivers.
In the Web config I picked 2X and on the control page VF.
Yes the top end slewing is much faster now and the system load in the web status page is lower.
I can watch the load change by viewing the web page while using the onstep app to do the slews.

I was using the default -Os in my last report
Here is the result for -O3
Serial Port ttyUSB0 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
                     stop-bit = 1.0, flow-control = off
Activating device: OK
Chip ID: 0x422 
BootLoader protocol version: 3.1
Device name : STM32F302xB-xC/STM32F303xB-xC/F358xx
Flash size  : 256 KBytes (default)
Device type : MCU
Device CPU  : Cortex-M4
 
 
 
Memory Programming ...
Opening and parsing file: OnStep.ino.bin
  File          : OnStep.ino.bin
  Size          : 173484 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 84]
Download in Progress:
 
 
File download complete
Time elapsed during download operation: 00:00:55.677
 
RUNNING Program ... 
  Address:      : 0x8000000
Start operation achieved successfully
 


Khalid Baheyeldin
 

On Tue, Oct 27, 2020 at 02:09 PM, Mike Gore wrote:
I set my SLEW_RATE_BASE_DESIRED to 4 and  STEP_WAVE_FORM  to PULSE
AXIS1_DRIVER_MICROSTEPS to 32 and  AXIS1_DRIVER_MICROSTEPS_GOTO to 16
Usually, you want to make them more far apart, so for _GOTO it would be 8 or even 4
for maximum speed.
I am Using BigTree v1.2 5160 drivers.
How are these working out?
Did you have to connect CLK to GND? The sellers say it is already like that, but one user
here reported he had to do it.

In the Web config I picked 2X and on the control page VF.
Yes the top end slewing is much faster now and the system load in the web status page is lower.

As I showed in the video, if you use the Android app, there is a selection called 'Goto Speed' which
allows you to set a cap on the top speed. Check Faster and Fastest vs. Default. It will tell you what
degrees/second you get.

Not that you really need those crazy speeds. Just good to know what it can be pushed to.


Mike Gore
 

Hi Khalid
  The BigTree v1.2 drivers I have do not need CLK tied to ground - they have a pull down resistor on the board that I verified by tracing it. I have played around with the GOTO slew micro-steps a bit - I had not adjusted it for the tests. I updated to speed in the App as you suggested and it reports 8 degrees per second. For testing I have my motor/worm assemblies on my bench. I will try on my scope next. I expect I may have to tweak the GOTO current but presently it is difficult to stop the stepper by hand - and my setting are conservative. RA motor is only slightly warm while set to tracking at sidereal rate.


-- 
# Home: Mike Gore
# Mail: 405 Midwood Cres, Waterloo Ontario, N2L 5N4
# Phone: 519-884-4943
# Cell: 519-589-9303
# Email: magore@...
# Consulting: InfoWrite Consulting
# =========================================================
# Work: Mike Gore
# David R. Cheriton School of Computer Science, DC2609
# University of Waterloo, 200 University Ave West
# Waterloo Ontario, Canada, N2L 3G1
# Phone: 519-888-4567, x36205
# Email: magore@...


Khalid Baheyeldin
 

Tonight I tested the RobotDyn F303CC on my Blue Pill PCB, and it performed extremely well.

Because I planned to view Mars visually, I removed the reducer from the optical train.
So I was using the full 2032 mm focal length of the C8.
And I was able to push exposures to 300 seconds with autoguiding, and still get good results.

Here are some images. Each is a single exposure, from urban light polluted skies:


Thanks to Joachim Jantz's j3colorstretch, doing a histogram stretch is now easy, and greatly increases the contrast of single exposure images.


Jay Murphy
 

With this module can we connect directly to the board with the USB?


Khalid Baheyeldin
 

On Wed, Nov 11, 2020 at 06:19 AM, Jay Murphy wrote:
With this module can we connect directly to the board with the USB?
You mean connect the USB cable directly to the F303 module's USB?
NO! It will not work, since the CP2102 is where you should connect, and it
uses PA9/PA10 pins. The USB connector uses other pins, which we use for
the motors.

And you could still burn the F303 if you connect the USB while powered
up from 12-24V

SO DO NOT DO THAT!