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]
CThunk.h 7346 Revisions Annotate
CallChain.cpp 2369 Revisions Annotate
CallChain.h 5067 Revisions Annotate
Callback.h 166695 Revisions Annotate
CircularBuffer.h 3043 Revisions Annotate
FunctionPointer.h 2753 Revisions Annotate
PlatformMutex.h 1114 Revisions Annotate
SingletonPtr.h 2728 Revisions Annotate
Transaction.h 2015 Revisions Annotate
critical.h 874 Revisions Annotate
mbed_alloc_wrappers.cpp 11455 Revisions Annotate
mbed_application.c 3566 Revisions Annotate
mbed_application.h 1563 Revisions Annotate
mbed_assert.c 988 Revisions Annotate
mbed_assert.h 4002 Revisions Annotate
mbed_board.c 2952 Revisions Annotate
mbed_critical.c 9392 Revisions Annotate
mbed_critical.h 15361 Revisions Annotate
mbed_debug.h 1836 Revisions Annotate
mbed_error.c 1032 Revisions Annotate
mbed_error.h 1915 Revisions Annotate
mbed_interface.c 2852 Revisions Annotate
mbed_interface.h 4057 Revisions Annotate
mbed_lib.json 818 Revisions Annotate
mbed_mem_trace.c 3999 Revisions Annotate
mbed_mem_trace.h 5185 Revisions Annotate
mbed_preprocessor.h 1401 Revisions Annotate
mbed_retarget.cpp 26683 Revisions Annotate
mbed_retarget.h 5371 Revisions Annotate
mbed_rtc_time.cpp 2398 Revisions Annotate
mbed_rtc_time.h 2639 Revisions Annotate
mbed_semihost_api.c 4332 Revisions Annotate
mbed_semihost_api.h 2638 Revisions Annotate
mbed_sleep.h 2874 Revisions Annotate
mbed_stats.c 1795 Revisions Annotate
mbed_stats.h 2618 Revisions Annotate
mbed_toolchain.h 7406 Revisions Annotate
mbed_wait_api.h 1555 Revisions Annotate
mbed_wait_api_no_rtos.c 1097 Revisions Annotate
mbed_wait_api_rtos.cpp 1449 Revisions Annotate
platform.h 958 Revisions Annotate
rtc_time.h 874 Revisions Annotate
semihost_api.h 898 Revisions Annotate
sleep.h 856 Revisions Annotate
toolchain.h 890 Revisions Annotate
wait_api.h 874 Revisions Annotate