RobotDyn Black Pill APM32F103CB 128KB

Post Reply
mrburnette
Posts: 134
Joined: Thu Dec 19, 2019 1:23 am

RobotDyn Black Pill APM32F103CB 128KB

Post by mrburnette »

Several posts have been made around the Black Pill from RobotDyn that uses the non-STM manufactured APM32F103CB. This post is a semi-continuation from my posts here: viewtopic.php?p=2900#p2900

I have Blue Pills that are at least 3 years old acquired from AliExpress. They have worked flawlessly except a couple have required their soldering to be reflowed; I have hotair on the shop bench and that has worked adequately. Of course, the bunch have the 10K (wrong value) resistor that needs to be reworked if USB is intended to work.

For the few tests that I have done, I am putting the results in this thread. If I make a comparison, it will generally be made in respect to the Blue Pill.

Please note: This is not a recommendation to purchase, an advertisement for any vendor or manufacturer. This post is not intended to consider any unresolved licensing or royalty payment issues (if any.) The post is just a public service since many forum members were inquisitive if this recently released uC performed in the "compatible" mode. Advanced features and extended instruction set/capabilities will not be explored. As they say, "Your mileage may vary."


The Black Pill came in an anit-static bag marked as shown below:
DSCF2143.gif
DSCF2143.gif (73.63 KiB) Viewed 307 times
Test Setup
Blue Pill --- Reference device ---
- NO bootloader
- Sketch loaded by USB-Serial generic module shown:
DSCF2150.gif
DSCF2150.gif (56.8 KiB) Viewed 305 times
Black Pill
Test Device
NO bootloader
- Sketch loaded by USB-Serial generic module shown:
DSCF2148.gif
DSCF2148.gif (69.24 KiB) Viewed 305 times
Continue in next post
Last edited by mrburnette on Sun May 24, 2020 1:02 pm, edited 1 time in total.

mrburnette
Posts: 134
Joined: Thu Dec 19, 2019 1:23 am

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by mrburnette »

Continuation from post above

Roger's Core was used for testing, the most recent.

General notes
1) Black Pill came preloaded with blink sketch, said sketch worked when board was powered over micro-USB.
2) Overall quality of board was very good; I observed no visible defects.
3) The watch crystal is marked YX32GBC and is shock-mounted with a drop of adhesive/epoxy (no soldered to ground pad.)
4) The BOOT0 (for flashing via serial) is the jumper closest to the RESET button.
5) For the test, one micro-USB cable provided power & USB-CDA while a second USB mini cable connected to the USB-Serial module for programming via the IDE selection: Tools / Upload Method / "Serial"

Test 1

The board comes with a 32K crystal, I decided to test the time/alarm:

Code: Select all

Using library RTClock at version 1.0 in folder: /home/ray/Arduino/hardware/STM32/STM32F1/libraries/RTClock 
/home/ray/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-size -A /tmp/arduino_build_983944/RealTimeClock_BlueBD.ino.elf
Sketch uses 17524 bytes (13%) of program storage space. Maximum is 131072 bytes.
Global variables use 3136 bytes (15%) of dynamic memory, leaving 17344 bytes for local variables. Maximum is 20480 bytes.
/home/ray/Arduino/hardware/STM32/tools/linux/serial_upload ttyUSB0 {upload.altID} {upload.usbID} /tmp/arduino_build_983944/RealTimeClock_BlueBD.ino.bin 
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 115200 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory

Wrote address 0x08000100 (1.46%) Wrote address 0x08000200 (2.92%) Wrote address 0x08000300 (4.38%) Wrote address 0x08000400 (5.84%)
Wrote address 0x08000500 (7.30%) Wrote address 0x08000600 (8.77%) Wrote address 0x08000700 (10.23%) Wrote address 0x08000800 (11.69%)
Wrote address 0x08000900 (13.15%) Wrote address 0x08000a00 (14.61%) Wrote address 0x08000b00 (16.07%) Wrote address 0x08000c00 (17.53%)
Wrote address 0x08000d00 (18.99%) Wrote address 0x08000e00 (20.45%) Wrote address 0x08000f00 (21.91%) Wrote address 0x08001000 (23.37%) 
Wrote address 0x08001100 (24.83%) Wrote address 0x08001200 (26.30%) Wrote address 0x08001300 (27.76%) Wrote address 0x08001400 (29.22%)
Wrote address 0x08001500 (30.68%) Wrote address 0x08001600 (32.14%) Wrote address 0x08001700 (33.60%) Wrote address 0x08001800 (35.06%)
Wrote address 0x08001900 (36.52%) Wrote address 0x08001a00 (37.98%) Wrote address 0x08001b00 (39.44%) Wrote address 0x08001c00 (40.90%) 
Wrote address 0x08001d00 (42.36%) Wrote address 0x08001e00 (43.83%) Wrote address 0x08001f00 (45.29%) Wrote address 0x08002000 (46.75%) 
Wrote address 0x08002100 (48.21%) Wrote address 0x08002200 (49.67%) Wrote address 0x08002300 (51.13%) Wrote address 0x08002400 (52.59%)
Wrote address 0x08002500 (54.05%) Wrote address 0x08002600 (55.51%) Wrote address 0x08002700 (56.97%) Wrote address 0x08002800 (58.43%) 
Wrote address 0x08002900 (59.90%) Wrote address 0x08002a00 (61.36%) Wrote address 0x08002b00 (62.82%) Wrote address 0x08002c00 (64.28%) 
Wrote address 0x08002d00 (65.74%) Wrote address 0x08002e00 (67.20%) Wrote address 0x08002f00 (68.66%) Wrote address 0x08003000 (70.12%) 
Wrote address 0x08003100 (71.58%) Wrote address 0x08003200 (73.04%) Wrote address 0x08003300 (74.50%) Wrote address 0x08003400 (75.96%) 
Wrote address 0x08003500 (77.43%) Wrote address 0x08003600 (78.89%) Wrote address 0x08003700 (80.35%) Wrote address 0x08003800 (81.81%) 
Wrote address 0x08003900 (83.27%) Wrote address 0x08003a00 (84.73%) Wrote address 0x08003b00 (86.19%) Wrote address 0x08003c00 (87.65%) 
Wrote address 0x08003d00 (89.11%) Wrote address 0x08003e00 (90.57%) Wrote address 0x08003f00 (92.03%) Wrote address 0x08004000 (93.49%) 
Wrote address 0x08004100 (94.96%) Wrote address 0x08004200 (96.42%) Wrote address 0x08004300 (97.88%) Wrote address 0x08004400 (99.34%) 
Wrote address 0x08004474 (100.00%) Done.

Starting execution at address 0x08000000... done.
Changing the serial port on ArduinoIDE to ACM0 (virtual USB)

Code: Select all

 --- alarm --- 
Time + interrupt counts: 530.22224 (530, 0, 65, 65)
Time + interrupt counts: 532.5297 (532, 0, 65, 65)
Time + interrupt counts: 535.21141 (535, 0, 66, 66)
 --- alarm --- 
Time + interrupt counts: 538.12243 (538, 0, 66, 66)
Time + interrupt counts: 541.28086 (541, 0, 66, 66)
Time + interrupt counts: 543.11163 (543, 0, 67, 67)
 --- alarm --- 
Time + interrupt counts: 546.2271 (546, 0, 67, 67)
Time + interrupt counts: 549.18118 (549, 0, 67, 67)
Wow, that works! Here is the sketch:

Code: Select all

/*
 *  test-rtc.c
 *  
 *  Example program that sets up the Real Time Clock and then blinks the
 *  LED in patterns for seconds and alarm interrupts.
 *
 *  Created by  Rod Gilchrist on 11-12-24.
    Ray Burnette: 20150521:

   Arduino GUI 1.8.12 on Linux Mint 18.3 Linux Mint 20200521
    Using library RTClock at version 1.0 in folder: /home/ray/Arduino/hardware/STM32/STM32F1/libraries/RTClock 
    Sketch uses 10820 bytes (8%) of program storage space. Maximum is 131072 bytes.
    Global variables use 2032 bytes (9%) of dynamic memory, leaving 18448 bytes for local variables. Maximum is 20480 bytes.ry.
   */

#include "RTClock.h"

#define BOARD_LED_PIN PC13  // Blueboard

int globAlmCnt = 0;
int globOvCnt = 0;
int globSecCnt = 0;
int specAlmCnt = 0;
int lastGlobAlmCnt = -1;
int lastSpecAlmCnt = -1;

void rtc_sec_intr() { if (rtc_is_second()) globSecCnt++; }
void rtc_ovf_intr() { if (rtc_is_overflow()) globOvCnt++; }
void rtc_glob_alm_intr() { if (rtc_is_alarm()) globAlmCnt++; }
void rtc_spec_alm_intr() { if (rtc_is_alarm()) specAlmCnt++; }

void setup() {
   // http://forums.leaflabs.com/topic.php?id=1437
   // slow! div speed. NOTE! 512 is stop/hang when USB not connected!
   // rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_256);
   // Normal speed:
   // rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1);
  Serial.begin(19200);
  pinMode(BOARD_LED_PIN, OUTPUT);
	delay(5000);
	Serial.println("RealTimeClock_BlueBD: begin RTC blink");
	delay(1000);	

	rtc_init(RTCSEL_LSI);
	rtc_set_prescaler_load(0x7fff);
	rtc_set_count(0);
	
	rtc_attach_interrupt(RTC_SECONDS_INTERRUPT, rtc_sec_intr);
	rtc_attach_interrupt(RTC_OVERFLOW_INTERRUPT, rtc_ovf_intr); // expected every 128000 seconds
	rtc_attach_interrupt(RTC_ALARM_GLOBAL_INTERRUPT, rtc_glob_alm_intr);
	rtc_attach_interrupt(RTC_ALARM_SPECIFIC_INTERRUPT, rtc_spec_alm_intr);
}

void loop() {
	int i,n;
	
	Serial.print("Time + interrupt counts: ");
	Serial.print(rtc_get_count());
	Serial.print(".");
	Serial.print(rtc_get_divider());
	Serial.print(" (");
	Serial.print(globSecCnt);
	Serial.print(", ");
	Serial.print(globOvCnt);
	Serial.print(", ");
	Serial.print(globAlmCnt);
	Serial.print(", ");
	Serial.print(specAlmCnt);
	Serial.println(")");

	delay(1000);

	digitalWrite(BOARD_LED_PIN, 1);
	if ((lastSpecAlmCnt != specAlmCnt) || (lastGlobAlmCnt != globAlmCnt)){
		lastGlobAlmCnt = globAlmCnt;
		lastSpecAlmCnt = specAlmCnt;

		Serial.println(" --- alarm --- ");
		for (i=0;i<3;i++) { digitalWrite(BOARD_LED_PIN, 0); delay(100); digitalWrite(BOARD_LED_PIN, 1); delay(100);}
		n = rtc_get_count() + 5;
		rtc_set_alarm(n);
	}
	
	delay(1000);
	digitalWrite(BOARD_LED_PIN, 0);
}
Tested: USB (CDA), Serial 1 print output, interrupt, serial programming, ArduinoIDE ability to work through a non-BOOTLOADER scenario.

Observations: Looks like a blue board that works out of the anti-static packaging.
Screenshot from 2020-05-23 14-12-40.png
Screenshot from 2020-05-23 14-12-40.png (69.06 KiB) Viewed 296 times
Last edited by mrburnette on Sat May 23, 2020 10:00 pm, edited 1 time in total.

mrburnette
Posts: 134
Joined: Thu Dec 19, 2019 1:23 am

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by mrburnette »

Placeholder for I2C / SPI @ some future time.
Note 20200524: I have a Baite Maple Mini clone with a real STM32F103 running a BMP180 & ILI9341 using Adafruit libraries and hardware SPI. Works fine for years.

Code: Select all

SPI1 Signal		(pin) MAPLE MINI 	APM32F103CB	ILI9341 J2
MOSI			(4)	PA_7		PA_7		(6)
MISO			(5)	PA_6		PA_6		(9)
SCK			(6)	PA_5		PA_5		(7)
NSS			(7)	PA_4		PA_4
TFT DC			(12)	PC_15				(5)
TFT CS			(13)	PC_14				(3)
TFT RST			(14)	PC_13				(4)
Gnd								(2)
Vcc								(1)
.

I did have to edit the Maple Mini version since I was going to "Generic" ... that is NO PIN NUMBERS!!! It is a bad, bad, bad habit anyway :lol:

Here is the full ILI9341 constructor: Note, this changes the implementation to software_SPI

Code: Select all

Adafruit_ILI9341 lcd = Adafruit_ILI9341(PC14, PC15, PA7, PA5, PC13, PA6);
Tested soft-SPI and I2C(1) ... in a very simple use-case.
DSCF2151.gif
DSCF2151.gif (80.33 KiB) Viewed 255 times
That's it folks ... for hobby use, I see no major issues. For the "advertised advanced features", you will need to enhance the Arduino "Generic STM32F103C" or use the professional tools available. For weekend hobby stuff, if your needs are simple, use the ArduinoIDE, Roger's core, and standard STM32F103 features and maybe you'll be OK. For full compatibility, I cannot answer that question with just a few test runs.

I may revisit the hardware SPI instantiation in the Adafruit ILI9341 code ... it is a very old library, not the newest stuff Ladyada has out on github. The takeaway is that if you have Maple Mini code, there is a bit more work than a recompile and upload.


Best,

Ray

Code: Select all

Sketch uses 29516 bytes (22%) of program storage space. Maximum is 131072 bytes.
Global variables use 3784 bytes (18%) of dynamic memory, leaving 16696 bytes for local variables. Maximum is 20480 bytes.
/home/ray/Arduino/hardware/STM32/tools/linux/serial_upload ttyUSB0 {upload.altID} {upload.usbID} /tmp/arduino_build_384328/APM_BP180_GLCD_24.ino.bin 
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 115200 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory

Wrote address 0x08000100 (0.87%) 
Wrote address 0x08000200 (1.73%) 
Wrote address 0x08000300 (2.60%) 
Wrote address 0x08000400 (3.47%) 
Wrote address 0x08000500 (4.34%) 
Wrote address 0x08000600 (5.20%) 
Wrote address 0x08000700 (6.07%) 
Wrote address 0x08000800 (6.94%) 
Wrote address 0x08000900 (7.81%) 
Wrote address 0x08000a00 (8.67%) 
Wrote address 0x08000b00 (9.54%) 
Wrote address 0x08000c00 (10.41%) 
Wrote address 0x08000d00 (11.28%) 
Wrote address 0x08000e00 (12.14%) 
Wrote address 0x08000f00 (13.01%) 
Wrote address 0x08001000 (13.88%) 
Wrote address 0x08001100 (14.74%) 
Wrote address 0x08001200 (15.61%) 
Wrote address 0x08001300 (16.48%) 
Wrote address 0x08001400 (17.35%) 
Wrote address 0x08001500 (18.21%) 
Wrote address 0x08001600 (19.08%) 
Wrote address 0x08001700 (19.95%) 
Wrote address 0x08001800 (20.82%) 
Wrote address 0x08001900 (21.68%) 
Wrote address 0x08001a00 (22.55%) 
Wrote address 0x08001b00 (23.42%) 
Wrote address 0x08001c00 (24.29%) 
Wrote address 0x08001d00 (25.15%) 
Wrote address 0x08001e00 (26.02%) 
Wrote address 0x08001f00 (26.89%) 
Wrote address 0x08002000 (27.75%) 
Wrote address 0x08002100 (28.62%) 
Wrote address 0x08002200 (29.49%) 
Wrote address 0x08002300 (30.36%) 
Wrote address 0x08002400 (31.22%) 
Wrote address 0x08002500 (32.09%) 
Wrote address 0x08002600 (32.96%) 
Wrote address 0x08002700 (33.83%) 
Wrote address 0x08002800 (34.69%) 
Wrote address 0x08002900 (35.56%) 
Wrote address 0x08002a00 (36.43%) 
Wrote address 0x08002b00 (37.30%) 
Wrote address 0x08002c00 (38.16%) 
Wrote address 0x08002d00 (39.03%) 
Wrote address 0x08002e00 (39.90%) 
Wrote address 0x08002f00 (40.76%) 
Wrote address 0x08003000 (41.63%) 
Wrote address 0x08003100 (42.50%) 
Wrote address 0x08003200 (43.37%) 
Wrote address 0x08003300 (44.23%) 
Wrote address 0x08003400 (45.10%) 
Wrote address 0x08003500 (45.97%) 
Wrote address 0x08003600 (46.84%) 
Wrote address 0x08003700 (47.70%) 
Wrote address 0x08003800 (48.57%) 
Wrote address 0x08003900 (49.44%) 
Wrote address 0x08003a00 (50.30%) 
Wrote address 0x08003b00 (51.17%) 
Wrote address 0x08003c00 (52.04%) 
Wrote address 0x08003d00 (52.91%) 
Wrote address 0x08003e00 (53.77%) 
Wrote address 0x08003f00 (54.64%) 
Wrote address 0x08004000 (55.51%) 
Wrote address 0x08004100 (56.38%) 
Wrote address 0x08004200 (57.24%) 
Wrote address 0x08004300 (58.11%) 
Wrote address 0x08004400 (58.98%) 
Wrote address 0x08004500 (59.85%) 
Wrote address 0x08004600 (60.71%) 
Wrote address 0x08004700 (61.58%) 
Wrote address 0x08004800 (62.45%) 
Wrote address 0x08004900 (63.31%) 
Wrote address 0x08004a00 (64.18%) 
Wrote address 0x08004b00 (65.05%) 
Wrote address 0x08004c00 (65.92%) 
Wrote address 0x08004d00 (66.78%) 
Wrote address 0x08004e00 (67.65%) 
Wrote address 0x08004f00 (68.52%) 
Wrote address 0x08005000 (69.39%) 
Wrote address 0x08005100 (70.25%) 
Wrote address 0x08005200 (71.12%) 
Wrote address 0x08005300 (71.99%) 
Wrote address 0x08005400 (72.86%) 
Wrote address 0x08005500 (73.72%) 
Wrote address 0x08005600 (74.59%) 
Wrote address 0x08005700 (75.46%) 
Wrote address 0x08005800 (76.32%) 
Wrote address 0x08005900 (77.19%) 
Wrote address 0x08005a00 (78.06%) 
Wrote address 0x08005b00 (78.93%) 
Wrote address 0x08005c00 (79.79%) 
Wrote address 0x08005d00 (80.66%) 
Wrote address 0x08005e00 (81.53%) 
Wrote address 0x08005f00 (82.40%) 
Wrote address 0x08006000 (83.26%) 
Wrote address 0x08006100 (84.13%) 
Wrote address 0x08006200 (85.00%) 
Wrote address 0x08006300 (85.87%) 
Wrote address 0x08006400 (86.73%) 
Wrote address 0x08006500 (87.60%) 
Wrote address 0x08006600 (88.47%) 
Wrote address 0x08006700 (89.33%) 
Wrote address 0x08006800 (90.20%) 
Wrote address 0x08006900 (91.07%) 
Wrote address 0x08006a00 (91.94%) 
Wrote address 0x08006b00 (92.80%) 
Wrote address 0x08006c00 (93.67%) 
Wrote address 0x08006d00 (94.54%) 
Wrote address 0x08006e00 (95.41%) 
Wrote address 0x08006f00 (96.27%) 
Wrote address 0x08007000 (97.14%) 
Wrote address 0x08007100 (98.01%) 
Wrote address 0x08007200 (98.88%) 
Wrote address 0x08007300 (99.74%) 
Wrote address 0x0800734c (100.00%) Done.

Starting execution at address 0x08000000... done.

madias
Posts: 31
Joined: Thu Dec 26, 2019 11:51 pm

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by madias »

Dear Ray!

Thanks for quick testing this new APM MCU. I recognized it while ordering the next 10+ bunch of black pills of Robotdyn (the one and only STM32 (chinese) seller I trust meanwhile).
The price is hot and a "free" FPU (while not used by stm32duino at the moment) sounds interesting.
Only drawback:
Running power consumption: 340mA/MHz
:)
(Might be meant: mμcro?)

But beside joking and wrong specs: Did you measure the power consumption? (Maybe if the FPU is not disabled by default the consumption might be higher than on STM32F103xx)

Anyway: I going to order some of this pills

Matthias

stas2z
Posts: 123
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by stas2z »

There is no FPU inside, already discussed here

User avatar
Bakisha
Posts: 24
Joined: Fri Dec 20, 2019 6:50 pm
Contact:

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by Bakisha »

Can it be overclocked to 128Mhz?

mrburnette
Posts: 134
Joined: Thu Dec 19, 2019 1:23 am

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by mrburnette »

madias wrote:
Tue Jun 02, 2020 7:55 am
...
But beside joking and wrong specs: Did you measure the power consumption? (Maybe if the FPU is not disabled by default the consumption might be higher than on STM32F103xx)
...
DSCF2154.gif
DSCF2154.gif (72.72 KiB) Viewed 61 times
With ILI9341 backlight: 230mA
Without backlight: 40mA

The BMP & ILI9341 were left active, sketch running, just no backlight.
DSCF2156.gif
DSCF2156.gif (55.85 KiB) Viewed 61 times
Hope that clears things a bit.

mrburnette
Posts: 134
Joined: Thu Dec 19, 2019 1:23 am

Re: RobotDyn Black Pill APM32F103CB 128KB

Post by mrburnette »

Bakisha wrote:
Tue Jun 02, 2020 8:59 am
Can it be overclocked to 128Mhz?
I did not test overclocking... it would have required a specialized setup as USB is not active with Roger's core at 128MHz.

Yes, it would be nice to know, but then that begs the questions, "is it stable when overclocked", "do you need a heatsink", and so forth. Honestly, these were cheap little boards and look useful. I have real STM32F103 MM and Blues, so I had no specific need other than I have a friend that is constantly needing "this or that" done and my supply of parts is always depleting ... he could care less if it is a clone, as long as it gets the job done.

I would refer you to the AMP32F103 xx reference manual for the published specifications for their tool set.
Manufacturer's product page: https://www.apexmic.com/en/newproduct/apm2/16
The datasheet is APM32F103x8xB Data Sheet V1.0.2.pdf and clocks in at a bit over 9MB in size.


Ray

Post Reply

Return to “STM32F1 based boards”