資源簡介
本例程是編寫STM32L151_IAP遠(yuǎn)程實際時的測試程序,已經(jīng)實現(xiàn)串口接收、FLASH擦寫、跳轉(zhuǎn)到APP程序,希望對大家有所幫助。

代碼片段和文件信息
/**
??******************************************************************************
??*?@file????system_stm32l1xx.c
??*?@author??MCD?Application?Team
??*?@version?V1.2.0
??*?@date????16-May-2014
??*?@brief???CMSIS?Cortex-M3?Device?Peripheral?Access?layer?System?Source?File.
??*??????????This?file?contains?the?system?clock?configuration?for?STM32L1xx?Ultra
??*??????????Low?Power?devices?and?is?generated?by?the?clock?configuration
??*??????????tool?“STM32L1xx_Clock_Configuration_V1.1.0.xls“.
??*?????????????
??*?1.??This?file?provides?two?functions?and?one?global?variable?to?be?called?from?
??*?????user?application:
??*??????-?SystemInit():?Setups?the?system?clock?(System?clock?source?PLL?Multiplier
??*??????????????????????and?Divider?factors?AHB/APBx?prescalers?and?Flash?settings)
??*??????????????????????depending?on?the?configuration?made?in?the?clock?xls?tool.?
??*??????????????????????This?function?is?called?at?startup?just?after?reset?and?
??*??????????????????????before?branch?to?main?program.?This?call?is?made?inside
??*??????????????????????the?“startup_stm32l1xx_xx.s“?file.
??*????????????????????????
??*??????-?SystemCoreClock?variable:?Contains?the?core?clock?(HCLK)?it?can?be?used
??*??????????????????????????????????by?the?user?application?to?setup?the?SysTick?
??*??????????????????????????????????timer?or?configure?other?parameters.
??*?????????????????????????????????????
??*??????-?SystemCoreClockUpdate():?Updates?the?variable?SystemCoreClock?and?must
??*?????????????????????????????????be?called?whenever?the?core?clock?is?changed
??*?????????????????????????????????during?program?execution.???
??*??????
??*?2.?After?each?device?reset?the?MSI?(2.1?MHz?Range)?is?used?as?system?clock?source.
??*????Then?SystemInit()?function?is?called?in?“startup_stm32l1xx_xx.s“?file?to
??*????configure?the?system?clock?before?to?branch?to?main?program.????
??*????
??*?3.?If?the?system?clock?source?selected?by?user?fails?to?startup?the?SystemInit()
??*????function?will?do?nothing?and?MSI?still?used?as?system?clock?source.?User?can?
??*????add?some?code?to?deal?with?this?issue?inside?the?SetSysClock()?function.
??*?
??*?4.?The?default?value?of?HSE?crystal?is?set?to?8MHz?refer?to?“HSE_VALUE“?define
??*????in?“stm32l1xx.h“?file.?When?HSE?is?used?as?system?clock?source?directly?or
??*????through?PLL?and?you?are?using?different?crystal?you?have?to?adapt?the?HSE
??*????value?to?your?own?configuration.
??*?
??*?5.?This?file?configures?the?system?clock?as?follows:??
??*=============================================================================
??*?????????????????????????System?Clock?Configuration
??*=============================================================================
??*????????System?Clock?source??????????|?PLL(HSE)
??*-----------------------------------------------------------------------------
??*????????SYSCLK???????????????????????|?32000000?Hz
??*-----------------------------------
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????24914??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\CMSIS?END?USER?LICENCE?AGREEMENT.pdf
?????文件?????505206??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Include\stm32l1xx.h
?????文件???????3456??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Include\stm32l1xx_conf.h
?????文件??????20173??2015-04-20?21:14??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Include\system_stm32l1xx.c
?????文件???????2220??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Include\system_stm32l1xx.h
?????文件??????14803??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_hd.s
?????文件??????13020??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_md.s
?????文件??????14559??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_mdp.s
?????文件??????14729??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\arm\startup_stm32l1xx_xl.s
?????文件??????11998??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_hd.s
?????文件??????10669??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_md.s
?????文件??????11745??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_mdp.s
?????文件??????11909??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\gcc_ride7\startup_stm32l1xx_xl.s
?????文件??????17100??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_hd.s
?????文件??????14563??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_md.s
?????文件??????16502??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_mdp.s
?????文件??????16918??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\iar\startup_stm32l1xx_xl.s
?????文件??????20175??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\system_stm32l1xx.c
?????文件???????3686??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\TASKING\cstart_thumb2.asm
?????文件??????12064??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_hd.s
?????文件??????10737??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_md.s
?????文件??????11806??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_mdp.s
?????文件??????11975??2015-04-21?01:56??STM32L151_IAP_Bootloader\Libraries\CMSIS\Device\ST\STM32L1xx\Source\Templates\TrueSTUDIO\startup_stm32l1xx_xl.s
?????文件??????11118??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\annotated.html
?????文件???????1082??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\annotated.js
?????文件????????671??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\bc_s.png
?????文件????????147??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\bdwn.png
?????文件????????922??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\check.png
?????文件??????11104??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\classes.html
?????文件????????132??2015-04-20?21:15??STM32L151_IAP_Bootloader\Libraries\CMSIS\Documentation\Core\html\closed.png
............此處省略847個文件信息
評論
共有 條評論