In the startup_stm32f10x_md.s file, a function called SystemInit is called. This function is actually defined in system_stm32f10x.c. It is designed to initialize the system clock, initialize the external SRAM, and set the interrupt vector table address.
void SystemInit (void)
{
/* Enable internal high-speed clock */
RCC->CR |= (uint32_t)0x00000001;
#ifndef STM32F10X_CL
RCC->CFGR &= (uint32_t)0xF8FF0000;
#else
RCC->CFGR &= (uint32_t)0xF0FF0000;
#endif
/* Disable PLL, disable initial clock detection, disable external high-speed clock */
RCC->CR &= (uint32_t)0xFEF6FFFF;
/* External 1-25M oscillator is not bypassed */
RCC->CR &= (uint32_t)0xFFFBFFFF;
/* USB prescaler PLL is not divided, PLL multiplier is 2, HSE is not divided, HSI/2 is used as PLL frequency */
RCC->CFGR &= (uint32_t)0xFF80FFFF;
/* Disable clock interrupt register */
#ifdef STM32F10X_CL
RCC->CR &= (uint32_t)0xEBFFFFFF;
RCC->CIR = 0x00FF0000;
RCC->CFGR2 = 0x00000000;
#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
RCC->CIR = 0x009F0000;
/* Reset CFGR2 register */
RCC->CFGR2 = 0x00000000;
#else
RCC->CIR = 0x009F0000;
#endif /* STM32F10X_CL */
/* 设置外部SRAM */
#if defined (STM32F10X_HD) || (defined STM32F10X_XL) || (defined STM32F10X_HD_VL)
#ifdef DATA_IN_ExtSRAM
SystemInit_ExtMemCtl();
#endif /* DATA_IN_ExtSRAM */
#endif
/* Configure system clock */
SetSysClock();
/*Interrupt vector offset address setting*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
#else
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
#endif
}
Previous article:Learning STM8 SPI
Next article:STM32 clock configuration, the program required to configure different crystal oscillators
Recommended ReadingLatest update time:2024-11-23 15:14
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- notify
- 【EasyARM-RT1052 Review】+ MQTTClient transplantation
- EEWorld adds double bonus to ELEXCON Shenzhen International Electronics Exhibition and sincerely invites you to participate
- The 32.768K crystal does not vibrate, so the selection is very important!
- Without calibration before testing, how much do you know about the real results?
- GUI Programmable Audio Processor
- A set of common codes suitable for small projects
- The LPC1768 board uses the CooCox compiler. The file is compiled successfully, but when linking, it prompts undefined referen...
- Logic interface technology of low power MSP430 microcontroller in 3V and 5V mixed system
- C2000 Key Technology Guide