Modification of Mbed-dev library for LQFP48 package microcontrollers: STM32F103C8 (STM32F103C8T6) and STM32F103CB (STM32F103CBT6) (Bluepill boards, Maple mini etc. )
Fork of mbed-dev by
Warning!
This library is unable to work due to huge changes in the mbed toolchain. Do not use with mbed online!
New wersion:
Import librarymbed-STM32F103C8
Modification of Mbed-dev library for LQFP48 package microcontrollers: STM32F103C8 (STM32F103C8T6) and STM32F103CB (STM32F103CBT6) (Bluepill boards, Maple mini etc. )
Import librarymbed-STM32F103C8
Modification of Mbed-dev library for LQFP48 package microcontrollers: STM32F103C8 (STM32F103C8T6) and STM32F103CB (STM32F103CBT6) (Bluepill boards, Maple mini etc. )
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 clock (mbed 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)
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
targets/cmsis/TOOLCHAIN_IAR/cmain.S
- Committer:
- mega64
- Date:
- 2016-08-29
- Revision:
- 145:54b3c5994df6
- Parent:
- 0:9b334a45a8ff
File content as of revision 145:54b3c5994df6:
/************************************************** * * Part two of the system initialization code, contains C-level * initialization, thumb-2 only variant. * * Copyright 2006 IAR Systems. All rights reserved. * * $Revision: 59783 $ * **************************************************/ ; -------------------------------------------------- ; Module ?cmain, C-level initialization. ; SECTION SHT$$PREINIT_ARRAY:CONST:NOROOT(2) SECTION SHT$$INIT_ARRAY:CONST:NOROOT(2) SECTION .text:CODE:NOROOT(2) PUBLIC __cmain ;; Keep ?main for legacy reasons, it is accessed in countless instances of cstartup.s around the world... PUBLIC ?main EXTWEAK __iar_data_init3 EXTWEAK __iar_argc_argv EXTERN __low_level_init EXTERN __call_ctors EXTERN main EXTERN exit EXTERN __iar_dynamic_initialization EXTERN mbed_sdk_init EXTERN SystemInit THUMB __cmain: ?main: ; Initialize segments. ; __segment_init and __low_level_init are assumed to use the same ; instruction set and to be reachable by BL from the ICODE segment ; (it is safest to link them in segment ICODE). FUNCALL __cmain, __low_level_init bl __low_level_init cmp r0,#0 beq ?l1 FUNCALL __cmain, __iar_data_init3 bl __iar_data_init3 MOVS r0,#0 ; No parameters FUNCALL __cmain, mbed_sdk_init BL mbed_sdk_init MOVS r0,#0 ; No parameters FUNCALL __cmain, __iar_dynamic_initialization BL __iar_dynamic_initialization ; C++ dynamic initialization ?l1: REQUIRE ?l3 SECTION .text:CODE:NOROOT(2) PUBLIC _main PUBLIC _call_main THUMB __iar_init$$done: ; Copy initialization is done ?l3: _call_main: MOVS r0,#0 ; No parameters FUNCALL __cmain, __iar_argc_argv BL __iar_argc_argv ; Maybe setup command line FUNCALL __cmain, main BL main _main: FUNCALL __cmain, exit BL exit END