add simple blink for ST32F103-nolib (Makefile still under construction!)

This commit is contained in:
eddyem
2018-11-05 11:42:01 +03:00
parent 34f6afb702
commit 4defefb860
16 changed files with 1024 additions and 715 deletions

View File

@@ -115,9 +115,8 @@ TRUE_INLINE void StartHSE()
/* Enable PLL2 */
RCC->CR |= RCC_CR_PLL2ON;
/* Wait till PLL2 is ready */
while((RCC->CR & RCC_CR_PLL2RDY) == 0)
{
}
StartUpCounter = 0;
while((RCC->CR & RCC_CR_PLL2RDY) == 0 && ++StartUpCounter < 1000){}
/* PLL configuration: PLLCLK = PREDIV1 * 9 = 72 MHz */
RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
@@ -134,18 +133,16 @@ TRUE_INLINE void StartHSE()
RCC->CR |= RCC_CR_PLLON;
/* Wait till PLL is ready */
while((RCC->CR & RCC_CR_PLLRDY) == 0)
{
}
StartUpCounter = 0;
while((RCC->CR & RCC_CR_PLLRDY) == 0 && ++StartUpCounter < 1000){}
/* Select PLL as system clock source */
RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
/* Wait till PLL is used as system clock source */
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
{
}
StartUpCounter = 0;
while(((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08) && ++StartUpCounter < 1000){}
}
else // HSE fails to start-up
{

View File

@@ -451,7 +451,7 @@ typedef enum IRQn
*/
#include "core_cm3.h"
//#include "system_stm32f10x.h"
#include <stdint.h>
/** @addtogroup Exported_types

View File

@@ -22,14 +22,6 @@
#ifndef VECTOR_H
#define VECTOR_H
typedef void (*vector_table_entry_t)(void);
typedef void (*funcp_t) (void);
/* Symbols exported by the linker script(s): */
extern unsigned _data_loadaddr, _data, _edata, _ebss, _stack;
extern funcp_t __preinit_array_start, __preinit_array_end;
extern funcp_t __init_array_start, __init_array_end;
extern funcp_t __fini_array_start, __fini_array_end;
#ifndef WEAK
#define WEAK __attribute__((weak))
#endif