Modification of Mbed-dev library for LQFP48 package microcontrollers: STM32F103C8 (STM32F103C8T6) and STM32F103CB (STM32F103CBT6) (Bluepill boards, Maple mini etc. )

Fork of mbed-STM32F103C8_org by Nothing Special

Library for STM32F103C8 (Bluepill boards etc.).
Use this instead of mbed library.
This library allows the size of the code in the FLASH up to 128kB. Therefore, code also runs on microcontrollers STM32F103CB (eg. Maple mini).
But in the case of STM32F103C8, check the size of the resulting code would not exceed 64kB.

To compile a program with this library, use NUCLEO-F103RB as the target name. !

Changes:

  • Corrected initialization of the HSE + crystal clock (mbed permanent bug), allowing the use of on-board xtal (8MHz).(1)
  • Additionally, it also set USB clock (48Mhz).(2)
  • Definitions of pins and peripherals adjusted to LQFP48 case.
  • Board led LED1 is now PC_13 (3)
  • USER_BUTTON is now PC_14 (4)

    Now the library is complete rebuilt based on mbed-dev v160 (and not yet fully tested).

notes
(1) - In case 8MHz xtal on board, CPU frequency is 72MHz. Without xtal is 64MHz.
(2) - Using the USB interface is only possible if STM32 is clocking by on-board 8MHz xtal or external clock signal 8MHz on the OSC_IN pin.
(3) - On Bluepill board led operation is reversed, i.e. 0 - led on, 1 - led off.
(4) - Bluepill board has no real user button

Information

After export to SW4STM (AC6):

  • add line #include "mbed_config.h" in files Serial.h and RawSerial.h
  • in project properties change Optimisation Level to Optimise for size (-Os)
Download repository: zip gz

Files at revision 148:8b0b02bf146f

Name Size Actions
[up]
AnalogIn.cpp 762 Revisions Annotate
AnalogIn.h 3058 Revisions Annotate
AnalogOut.h 3682 Revisions Annotate
BusIn.cpp 2465 Revisions Annotate
BusIn.h 3009 Revisions Annotate
BusInOut.cpp 3261 Revisions Annotate
BusInOut.h 3438 Revisions Annotate
BusOut.cpp 2727 Revisions Annotate
BusOut.h 3133 Revisions Annotate
CAN.cpp 2740 Revisions Annotate
CAN.h 7460 Revisions Annotate
DigitalIn.h 2900 Revisions Annotate
DigitalInOut.h 3905 Revisions Annotate
DigitalOut.h 3231 Revisions Annotate
DirHandle.h 3252 Revisions Annotate
Ethernet.cpp 1719 Revisions Annotate
Ethernet.h 4608 Revisions Annotate
FileBase.cpp 2769 Revisions Annotate
FileBase.h 1581 Revisions Annotate
FileHandle.h 3868 Revisions Annotate
FileLike.h 4557 Revisions Annotate
FilePath.cpp 1905 Revisions Annotate
FilePath.h 1198 Revisions Annotate
FileSystemLike.cpp 2421 Revisions Annotate
FileSystemLike.h 3914 Revisions Annotate
FlashIAP.cpp 4050 Revisions Annotate
FlashIAP.h 4449 Revisions Annotate
I2C.cpp 3537 Revisions Annotate
I2C.h 5141 Revisions Annotate
I2CSlave.cpp 1538 Revisions Annotate
I2CSlave.h 4095 Revisions Annotate
InterruptIn.cpp 2756 Revisions Annotate
InterruptIn.h 4563 Revisions Annotate
InterruptManager.cpp 3562 Revisions Annotate
InterruptManager.h 5257 Revisions Annotate
LocalFileSystem.cpp 6892 Revisions Annotate
LocalFileSystem.h 3342 Revisions Annotate
LowPowerTicker.h 1133 Revisions Annotate
LowPowerTimeout.h 1101 Revisions Annotate
LowPowerTimer.h 1087 Revisions Annotate
PortIn.h 2409 Revisions Annotate
PortInOut.h 2906 Revisions Annotate
PortOut.h 2585 Revisions Annotate
PwmOut.h 5231 Revisions Annotate
RawSerial.cpp 2470 Revisions Annotate
RawSerial.h 2693 Revisions Annotate
SPI.cpp 5087 Revisions Annotate
SPI.h 8352 Revisions Annotate
SPISlave.cpp 1401 Revisions Annotate
SPISlave.h 3139 Revisions Annotate
Serial.cpp 1226 Revisions Annotate
Serial.h 2565 Revisions Annotate
SerialBase.cpp 6716 Revisions Annotate
SerialBase.h 8760 Revisions Annotate
Stream.cpp 3227 Revisions Annotate
Stream.h 2100 Revisions Annotate
Ticker.cpp 1253 Revisions Annotate
Ticker.h 4223 Revisions Annotate
Timeout.cpp 752 Revisions Annotate
Timeout.h 1397 Revisions Annotate
Timer.cpp 2052 Revisions Annotate
Timer.h 2100 Revisions Annotate
TimerEvent.cpp 1471 Revisions Annotate
TimerEvent.h 1525 Revisions Annotate