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 (69.06 KiB) Viewed 24939 times