Bluepill F4 board, anyone still working on it?

If you made your own board, post here, unless you built a Maple or Maple mini clone etc
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: Bluepill F4 board, anyone still working on it?

Post by Pito »

64b or 32 fpu is basically the "same" speed.
64b vs. 32b in sw - 64b is ~2x slower and the lib code is ~2x larger.

PS: added the whetstone built with Roger's core but with the xpack-arm-none-eabi-gcc-9.2.1-1.1, F407ZET @168MHz, FPU on,

default

Code: Select all

Loops: 1000 Iterations: 10 Duration: 8396 millisec.   0 clocks
C Converted Single Precision Whetstones: 119.10 mflops
0       0       0       1.00    -1.00   -1.00   -1.00   0
12000   14000   12000   -0.13   -0.18   -0.43   -0.48   12000
14000   12000   12000   0.02    -0.03   -0.04   -0.09   14000
345000  1       1       1.00    -1.00   -1.00   -1.00   345000
210000  1       2       6.00    6.00    -0.04   -0.09   210000
32000   1       2       0.09    0.09    0.09    0.09    32000
899000  1       2       1.00    1.00    1.00    1.00    899000
616000  1       2       3.00    2.00    3.00    -0.09   616000
0       2       3       1.00    -1.00   -1.00   -1.00   0
93000   2       3       1.00    1.00    1.00    1.00    93000
-O3

Code: Select all

Loops: 1000 Iterations: 10 Duration: 4580 millisec.   0 clocks
C Converted Single Precision Whetstones: 218.34 mflops
0       0       0       1.00    -1.00   -1.00   -1.00   0
12000   14000   12000   -0.13   -0.18   -0.43   -0.48   12000
14000   12000   12000   0.02    -0.03   -0.04   -0.09   14000
345000  1       1       1.00    -1.00   -1.00   -1.00   345000
210000  1       2       6.00    6.00    -0.04   -0.09   210000
32000   1       2       0.09    0.09    0.09    0.09    32000
899000  1       2       1.00    1.00    1.00    1.00    899000
616000  1       2       3.00    2.00    3.00    -0.09   616000
0       2       3       1.00    -1.00   -1.00   -1.00   0
93000   2       3       1.00    1.00    1.00    1.00    93000
LTO does not work.
Pukao Hats Cleaning Services Ltd.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill F4 board, anyone still working on it?

Post by ag123 »

it works STM32F401 black pill - steve's libmaple core
https://youtu.be/LEJK8lathQc

and happy new year everyone :D

Beginning Whetstone benchmark at 84 MHz ... -Os

Loops:10000, Iterations:1, Duration:15026.61 millisec
C Converted Single Precision Whetstones:66.55 Mflops

Beginning Whetstone benchmark at 84 MHz ... -O3

Loops:10000, Iterations:1, Duration:8381.00 millisec
C Converted Single Precision Whetstones:119.32 Mflops

getting that much Mflops for only 84 mhz for $3 still feel quite worth it :lol:

Code: Select all

#include <Arduino.h>
#include <usb_serial.h>
#include "whetstone.h"

void checkcmd(void);
void printtempvbat(void);
void enablefpu(void);
void fade();

//int ledPin = 33; // LED connected to 'pin' 33 on maple mini
//int ledPin = 6; // LED connected to 'pin' PA5 olimexino
int ledPin = LED_BUILTIN; //PA6
int led1 = LED_BUILTIN; //PA7

#define PER 20
#define REP 10

int print = false;
int8_t led = 0;
bool dir = false;
int8_t n = PER;
int cnt = 0;

// the setup() method runs once when the sketch starts
void setup() {

//	enablefpu();

	SerialUSB.begin(0);

	//initialize the digital pin as an output:
	pinMode(ledPin, OUTPUT);
	pinMode(led1, OUTPUT);
	digitalWrite(ledPin, HIGH);

	// ADC_CCR_VBATE;  // f401 allows only vbat or temp sensor read, setting VBATE reads vbat
	ADC_COMMON->CCR |= ADC_CCR_TSVREFE; //| ADC_CCR_VBATE;    // enable VREFINT, VBAT or temp sensor

	//adc_calibrate(ADC1);
	adc_set_sampling_time(ADC1, ADC_SMPR_480); // sample time for temp sensor


}

void blinks(int8 led_pin) {
	bool led = true;
	for(int i=0; i<10;i++) {
		digitalWrite(led_pin, led);
		led = ~led;
		delay(100);
	}
}

// Enable the FPU (Cortex-M4 - STM32F4xx and higher)
// http://infocenter.arm.com/help/topic/com.arm.doc.dui0553a/BEHBJHIG.html
//void enablefpu() {
//	  __asm volatile
//	  (
//	    "  ldr.w r0, =0xE000ED88    \n"  /* The FPU enable bits are in the CPACR. */
//	    "  ldr r1, [r0]             \n"  /* read CAPCR */
//	    "  orr r1, r1, #( 0xf << 20 )\n" /* Set bits 20-23 to enable CP10 and CP11 coprocessors */
//	    "  str r1, [r0]              \n" /* Write back the modified value to the CPACR */
//	    "  dsb                       \n" /* wait for store to complete */
//	    "  isb"                          /* reset pipeline now the FPU is enabled */
//	  );
//}

//the loop() method runs over and over again, 
//as long as maple has power
void loop() {

	checkcmd();
	if (print && n == 0) printtempvbat();
	fade();
}

void fade() {
  digitalWrite(LED_BUILTIN,led);
  led = ~led & 1;
  if(led)
    delay(PER-n);
  else
    delay(n);
  if(cnt>REP) {
    if(dir) {
      n++;
      if(n>PER) {
        dir = false;
        n = PER;
      }
    } else {
      n--;
      if(n<0) {
        dir = true;
        n = 0;
      }
    }
    cnt = 0;
  } else
    cnt++;
}


void printtempvbat() {
	//SerialUSB.println("Hello world F407");

	//ADC1 channel 18 is vrefint 1.23v
	uint16_t vrefint = adc_read(ADC1, 17);
	Serial.print("Vref int (1.21v):");
	Serial.print(vrefint);
	Serial.println();

	//ADC1 channel 16 is temperature sensor
	uint16_t vtemp = adc_read(ADC1, 18);
	Serial.print("temp sensor:");
	Serial.print(vtemp);
	Serial.println();

	uint16_t mv = (1210 * vtemp) / vrefint;
	Serial.print("mvolt:");
	Serial.print(mv);
	Serial.println();

	// specs 5.3.22 temp sensor characteristics
	// V 25 deg ~ 0.76v
	// slope 2.5 mv/C
	uint16_t v25 = 760;
	float temp = (mv - v25) * 1.0 / 2.5 + 25.0;
	Serial.print("temp:");
	Serial.print(temp);
	Serial.println();

}

void checkcmd() {
	if(Serial.available()) {
		char r = Serial.read();
		if(r=='p') {
			print = true;
		} else if (r=='s') {
			print = false;
		} else if (r=='w') {
			whetstone(84); //84 mhz
		}
	}
}

void blinks() {
	for (int i = 0; i < 5; i++) {
		digitalWrite(LED_BUILTIN, HIGH);
		delay(100);
		digitalWrite(LED_BUILTIN, LOW);
		delay(100);
	}
}
whetstone.h, whetstone.cpp
https://github.com/stevstrong/Arduino_S ... /whetstone

serial commands:
'p' print temperature
's' stop printing
'w' run whetstone benchmark

install:
- press reset + boot0
- release reset, hold boot0
- check for dfu device

Code: Select all

dfu-util -a 0 -s 0x8000000 -D blackpill_f401o3.bin
a recent dfu-util is needed
http://dfu-util.sourceforge.net/
or stm32cubeprogrammer
https://github.com/stm32duino/wiki/wiki ... programmer
Attachments
blackpill_f401o3.bin.zip
(21.49 KiB) Downloaded 319 times
Last edited by ag123 on Fri Jan 03, 2020 4:28 am, edited 5 times in total.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Bluepill F4 board, anyone still working on it?

Post by fpiSTM »

It is also suported with ST core ;)
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill F4 board, anyone still working on it?

Post by ag123 »

i'd try that out soon, happy new year :D
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: Bluepill F4 board, anyone still working on it?

Post by Pito »

As above with -O3 and with your setting: 10000 loops, iterations 1

Code: Select all

Loops: 10000 Iterations: 1 Duration: 4171 millisec.   0 clocks
C Converted Single Precision Whetstones: 239.75 mflops
0       0       0       1.00    -1.00   -1.00   -1.00   0
120000  140000  120000  -0.00   0.00    -0.00   0.00    120000
140000  120000  120000  -0.00   0.00    0.00    0.00    140000
3450000 1       1       1.00    -1.00   -1.00   -1.00   3450000
2100000 1       2       6.00    6.00    0.00    0.00    2100000
320000  1       2       0.00    0.00    0.00    0.00    320000
8990000 1       2       1.00    1.00    1.00    1.00    8990000
6160000 1       2       3.00    2.00    3.00    0.00    6160000
0       2       3       1.00    -1.00   -1.00   -1.00   0
930000  2       3       1.00    1.00    1.00    1.00    930000
PF 2020!
Pukao Hats Cleaning Services Ltd.
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: Bluepill F4 board, anyone still working on it?

Post by Pito »

ag123 wrote: Tue Dec 31, 2019 4:00 pm it works STM32F401 black pill - steve's libmaple core
Looks nice..
Quality?
Fake stm32F401 chip? :D
Does it fit into the solderless breadboard fine?
Pukao Hats Cleaning Services Ltd.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill F4 board, anyone still working on it?

Post by ag123 »

Pito wrote: Tue Dec 31, 2019 7:35 pm Looks nice..
Quality?
Fake stm32F401 chip? :D
Does it fit into the solderless breadboard fine?
pretty good quality, that 32k crystal is so tiny and has a mirror reflective surface
and the 25mhz crystal isn't those cheap bulky tin cans
both of them looked like those
https://support.epson.biz/td/api/doc_ch ... AN&lang=en
https://support.epson.biz/td/api/doc_ch ... 8T&lang=en
legendary jap epson crystals, we'd maybe try to measure it against NIST atomic clocks :lol:
https://www.youtube.com/watch?v=lzHqhNoyx2o
pcb routing looks good
the stm32f401 doesn't look fake :lol:

i've not soldered it yet, but it looks to fit the breadboards, the other nice thing is there is a smd solder pads for a spi flash
i'm going to try this 8MB psram instead
https://www.aliexpress.com/item/33028533291.html

the ad that i bought the board from is this, the f411 board cost ~$1 more, there are several vendors selling it, so one may like to do a search instead
https://www.aliexpress.com/item/4000103610226.html
Last edited by ag123 on Wed Jan 01, 2020 4:20 am, edited 3 times in total.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill F4 board, anyone still working on it?

Post by ag123 »

seem like this is the board layout
board layout
board layout
board1.png (40.92 KiB) Viewed 6599 times
note that the 3rd button on the right named key isn't there
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill F4 board, anyone still working on it?

Post by ag123 »

this seemed to be a relevant schematic, i've not verified all the details, some details seemed a little different
Image
Bingo600
Posts: 86
Joined: Sat Dec 21, 2019 3:56 pm

Re: Bluepill F4 board, anyone still working on it?

Post by Bingo600 »

ag123 wrote: Tue Dec 31, 2019 4:00 pm it works STM32F401 black pill - steve's libmaple core
https://youtu.be/LEJK8lathQc

and happy new year everyone :D
Happy new year.

Does usb-serial , bootloader & upload work too ?

I'll have to try (on the 11') when i get back home

/Bingo
Last edited by Bingo600 on Wed Jan 01, 2020 11:25 am, edited 1 time in total.
Post Reply

Return to “Custom design boards”