everything is working ah, don't look at the code though, its frightening
This commit is contained in:
parent
4dbed67e74
commit
d534824a18
104 changed files with 18159 additions and 16715 deletions
|
@ -946,3 +946,328 @@
|
|||
|
||||
|
||||
2020-11-18 09:40:28,013 [INFO] Activator:179 - !SESSION log4j initialized
|
||||
2020-11-18 10:56:32,919 [INFO] Activator:178 -
|
||||
|
||||
|
||||
2020-11-18 10:56:32,920 [INFO] Activator:179 - !SESSION log4j initialized
|
||||
2020-11-18 11:48:39,241 [ERROR] ApiDbMcu:1464 - Can't use Application install path:
|
||||
2020-11-18 11:48:41,498 [WARN] RulesReader:54 - Compatibility file://mcu/compatibility.xml not found
|
||||
2020-11-18 11:56:45,843 [INFO] ApplicationProperties:181 - Using Application install path: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824
|
||||
2020-11-18 11:56:45,851 [INFO] DbMcusXml:70 - Set database path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/mcu/
|
||||
2020-11-18 11:56:45,856 [INFO] DbBoardsPdsc:56 - Set plugin database path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/boardmanager/
|
||||
2020-11-18 11:56:45,856 [INFO] DbMcus:258 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:45,856 [INFO] DbBoards:264 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:45,859 [INFO] DbExamples:326 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:45,865 [INFO] DbMcusDocs:112 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:45,868 [INFO] DbMcusJson:63 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:45,869 [INFO] DbBoardsDocs:112 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:45,871 [INFO] DbBoardsJson:56 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:45,907 [INFO] CrossReferenceDbSqlite:196 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/cs/
|
||||
2020-11-18 11:56:45,912 [INFO] DbExamplesSqlite:800 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,056 [INFO] MicroXplorer:564 - Detected Java Version = 1.8.0_252
|
||||
2020-11-18 11:56:46,056 [INFO] DbMcusXml:70 - Set database path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/mcu/
|
||||
2020-11-18 11:56:46,057 [INFO] DbBoardsPdsc:56 - Set plugin database path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/boardmanager/
|
||||
2020-11-18 11:56:46,058 [INFO] DbMcus:258 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:46,058 [INFO] DbBoards:264 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:46,058 [INFO] DbExamples:326 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:46,058 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,059 [INFO] DbMcusDocs:112 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,059 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,059 [INFO] DbMcusJson:63 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,059 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,060 [INFO] DbBoardsDocs:112 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,060 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,060 [INFO] DbBoardsJson:56 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,060 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,060 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,061 [INFO] CrossReferenceDbSqlite:196 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/cs/
|
||||
2020-11-18 11:56:46,061 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,061 [INFO] DbExamplesSqlite:800 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,163 [INFO] MainPanel:189 - HeapMemory: 682622976
|
||||
2020-11-18 11:56:46,236 [INFO] DbMcusXml:70 - Set database path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/mcu/
|
||||
2020-11-18 11:56:46,236 [INFO] DbBoardsPdsc:56 - Set plugin database path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/boardmanager/
|
||||
2020-11-18 11:56:46,237 [INFO] DbMcus:258 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:46,237 [INFO] DbBoards:264 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:46,237 [INFO] DbExamples:326 - Set plugin images path to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/plugins/mcufinder/images/
|
||||
2020-11-18 11:56:46,238 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,238 [INFO] DbMcusDocs:112 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,239 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,239 [INFO] DbMcusJson:63 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,239 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,240 [INFO] DbBoardsDocs:112 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,240 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,240 [INFO] DbBoardsJson:56 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,240 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,240 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,241 [INFO] CrossReferenceDbSqlite:196 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/cs/
|
||||
2020-11-18 11:56:46,241 [WARN] DbFile:36 - Overriding database path with different value: C:\Users\camer\.stmcufinder\plugins\mcufinder/ => C:\Users\camer\.stmcufinder\plugins\mcufinder
|
||||
2020-11-18 11:56:46,241 [INFO] DbExamplesSqlite:800 - Set database path to: C:\Users\camer\.stmcufinder\plugins\mcufinder//mcu/
|
||||
2020-11-18 11:56:46,260 [INFO] ApplicationProperties:181 - Using Application install path: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824
|
||||
2020-11-18 11:56:46,262 [INFO] PluginManage:178 - Search for loadable plugins [exclusion list=, ]
|
||||
2020-11-18 11:56:46,263 [INFO] PluginManage:292 - Check plugin analytics
|
||||
2020-11-18 11:56:46,457 [INFO] AnalyticsPlugin:203 - Accepted Software Licenses:
|
||||
2020-11-18 11:56:46,458 [INFO] AnalyticsPlugin:205 - Accepted CMSIS Pack Licenses:
|
||||
2020-11-18 11:56:46,459 [INFO] AnalyticsPlugin:207 - Accepted Firmware Licenses:
|
||||
2020-11-18 11:56:46,460 [INFO] PluginManage:342 - Loaded plugin analytics (category:tool,tabindex:-1)
|
||||
2020-11-18 11:56:46,460 [INFO] PluginManage:292 - Check plugin clock
|
||||
2020-11-18 11:56:46,479 [INFO] PluginManage:342 - Loaded plugin clock (category:base,tabindex:2)
|
||||
2020-11-18 11:56:46,480 [INFO] PluginManage:292 - Check plugin ddr
|
||||
2020-11-18 11:56:46,484 [INFO] PluginManage:342 - Loaded plugin ddr (category:tool,tabindex:6)
|
||||
2020-11-18 11:56:46,484 [INFO] PluginManage:292 - Check plugin filemanager
|
||||
2020-11-18 11:56:46,640 [INFO] PluginManage:342 - Loaded plugin filemanager (category:base,tabindex:10)
|
||||
2020-11-18 11:56:46,640 [INFO] PluginManage:292 - Check plugin ipmanager
|
||||
2020-11-18 11:56:46,659 [INFO] PluginManage:342 - Loaded plugin ipmanager (category:base,tabindex:5)
|
||||
2020-11-18 11:56:46,659 [INFO] PluginManage:292 - Check plugin pinoutandconfiguration
|
||||
2020-11-18 11:56:46,675 [INFO] PluginManage:342 - Loaded plugin pinoutandconfiguration (category:base,tabindex:1)
|
||||
2020-11-18 11:56:46,675 [INFO] PluginManage:292 - Check plugin pinoutconfig
|
||||
2020-11-18 11:56:46,708 [INFO] PluginManage:342 - Loaded plugin pinoutconfig (category:base,tabindex:0)
|
||||
2020-11-18 11:56:46,708 [INFO] PluginManage:292 - Check plugin power
|
||||
2020-11-18 11:56:46,717 [INFO] PluginManage:342 - Loaded plugin power (category:power,tabindex:4)
|
||||
2020-11-18 11:56:46,718 [INFO] PluginManage:292 - Check plugin projectmanager
|
||||
2020-11-18 11:56:46,738 [INFO] PluginManage:342 - Loaded plugin projectmanager (category:projectmanager,tabindex:3)
|
||||
2020-11-18 11:56:46,739 [INFO] PluginManage:292 - Check plugin thirdparty
|
||||
2020-11-18 11:56:46,834 [INFO] ThirdPartyDb:333 - Open Third Party DataBase File (C:/Users/camer/.stm32cubemx/plugins/thirdparty/db/thirdparties_db.xml) : 35 ms. number of Sw pack : 23
|
||||
2020-11-18 11:56:46,842 [INFO] PluginManage:342 - Loaded plugin thirdparty (category:base,tabindex:-1)
|
||||
2020-11-18 11:56:46,842 [INFO] PluginManage:292 - Check plugin tools
|
||||
2020-11-18 11:56:46,845 [INFO] PluginManage:342 - Loaded plugin tools (category:base,tabindex:7)
|
||||
2020-11-18 11:56:46,846 [INFO] PluginManage:292 - Check plugin tutovideos
|
||||
2020-11-18 11:56:47,082 [INFO] PluginManage:342 - Loaded plugin tutovideos (category:base,tabindex:-1)
|
||||
2020-11-18 11:56:47,083 [INFO] PluginManage:292 - Check plugin updater
|
||||
2020-11-18 11:56:47,101 [INFO] PluginManage:342 - Loaded plugin updater (category:base,tabindex:12)
|
||||
2020-11-18 11:56:47,102 [INFO] PluginManage:265 - PluginManage : Loaded plugins [13]
|
||||
2020-11-18 11:56:47,442 [INFO] PinOutPanel:1418 - setPackage(No Configuration,No Configuration)
|
||||
2020-11-18 11:56:47,589 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,589 [INFO] PluginManager:200 - loadIPPluginJar : add adc
|
||||
2020-11-18 11:56:47,593 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,593 [INFO] PluginManager:200 - loadIPPluginJar : add aes
|
||||
2020-11-18 11:56:47,596 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,597 [INFO] PluginManager:200 - loadIPPluginJar : add can
|
||||
2020-11-18 11:56:47,599 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,600 [INFO] PluginManager:200 - loadIPPluginJar : add comp
|
||||
2020-11-18 11:56:47,603 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,603 [INFO] PluginManager:200 - loadIPPluginJar : add cryp
|
||||
2020-11-18 11:56:47,606 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,606 [INFO] PluginManager:200 - loadIPPluginJar : add dfsdm
|
||||
2020-11-18 11:56:47,613 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,614 [INFO] PluginManager:200 - loadIPPluginJar : add dma
|
||||
2020-11-18 11:56:47,616 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,616 [INFO] PluginManager:200 - loadIPPluginJar : add fatfs
|
||||
2020-11-18 11:56:47,621 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,621 [INFO] PluginManager:200 - loadIPPluginJar : add fmc
|
||||
2020-11-18 11:56:47,628 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,628 [INFO] PluginManager:200 - loadIPPluginJar : add freertos
|
||||
2020-11-18 11:56:47,630 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,631 [INFO] PluginManager:200 - loadIPPluginJar : add genericplugin
|
||||
2020-11-18 11:56:47,634 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,634 [INFO] PluginManager:200 - loadIPPluginJar : add gfxmmu
|
||||
2020-11-18 11:56:47,645 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,645 [INFO] PluginManager:200 - loadIPPluginJar : add gic
|
||||
2020-11-18 11:56:47,650 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,650 [INFO] PluginManager:200 - loadIPPluginJar : add gpio
|
||||
2020-11-18 11:56:47,653 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,653 [INFO] PluginManager:200 - loadIPPluginJar : add gtzc
|
||||
2020-11-18 11:56:47,656 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,656 [INFO] PluginManager:200 - loadIPPluginJar : add hash
|
||||
2020-11-18 11:56:47,659 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,660 [INFO] PluginManager:200 - loadIPPluginJar : add i2c
|
||||
2020-11-18 11:56:47,662 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,663 [INFO] PluginManager:200 - loadIPPluginJar : add i2s
|
||||
2020-11-18 11:56:47,666 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,667 [INFO] PluginManager:200 - loadIPPluginJar : add ipddr
|
||||
2020-11-18 11:56:47,668 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,669 [INFO] PluginManager:200 - loadIPPluginJar : add ltdc
|
||||
2020-11-18 11:56:47,673 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,673 [INFO] PluginManager:200 - loadIPPluginJar : add mdma
|
||||
2020-11-18 11:56:47,677 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,678 [INFO] PluginManager:200 - loadIPPluginJar : add nvic
|
||||
2020-11-18 11:56:47,681 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,681 [INFO] PluginManager:200 - loadIPPluginJar : add opamp
|
||||
2020-11-18 11:56:47,685 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,685 [INFO] PluginManager:200 - loadIPPluginJar : add openamp
|
||||
2020-11-18 11:56:47,688 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,689 [INFO] PluginManager:200 - loadIPPluginJar : add pdm2pcm
|
||||
2020-11-18 11:56:47,696 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,700 [INFO] PluginManager:200 - loadIPPluginJar : add plateformsettings
|
||||
2020-11-18 11:56:47,702 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,702 [INFO] PluginManager:200 - loadIPPluginJar : add quadspi
|
||||
2020-11-18 11:56:47,706 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,706 [INFO] PluginManager:200 - loadIPPluginJar : add resmgrutility
|
||||
2020-11-18 11:56:47,710 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,710 [INFO] PluginManager:200 - loadIPPluginJar : add sai
|
||||
2020-11-18 11:56:47,714 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,714 [INFO] PluginManager:200 - loadIPPluginJar : add spi
|
||||
2020-11-18 11:56:47,720 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,720 [INFO] PluginManager:200 - loadIPPluginJar : add stm32_wpan
|
||||
2020-11-18 11:56:47,723 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,723 [INFO] PluginManager:200 - loadIPPluginJar : add tim
|
||||
2020-11-18 11:56:47,728 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,728 [INFO] PluginManager:200 - loadIPPluginJar : add touchsensing
|
||||
2020-11-18 11:56:47,731 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,732 [INFO] PluginManager:200 - loadIPPluginJar : add tracer_emb
|
||||
2020-11-18 11:56:47,734 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,735 [INFO] PluginManager:200 - loadIPPluginJar : add ts
|
||||
2020-11-18 11:56:47,737 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,738 [INFO] PluginManager:200 - loadIPPluginJar : add tsc
|
||||
2020-11-18 11:56:47,740 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,741 [INFO] PluginManager:200 - loadIPPluginJar : add ucpd
|
||||
2020-11-18 11:56:47,745 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:56:47,746 [INFO] PluginManager:200 - loadIPPluginJar : add usart
|
||||
2020-11-18 11:56:48,726 [INFO] CubeProgrammer:457 - [DDR PANEL] - PathOfProgrammer: null
|
||||
2020-11-18 11:56:49,727 [FATAL] Updater:282 - Updater called before beeing initialized
|
||||
2020-11-18 11:56:49,928 [FATAL] Updater:282 - Updater called before beeing initialized
|
||||
2020-11-18 11:56:49,929 [WARN] ThirdParty:775 - waiting for thirdparty lock release [close project]
|
||||
2020-11-18 11:56:49,929 [INFO] ThirdParty:777 - entering critical section [close project]
|
||||
2020-11-18 11:56:49,930 [INFO] ThirdParty:790 - exiting critical section [close project]
|
||||
2020-11-18 11:56:49,933 [INFO] PinOutPanel:1418 - setPackage(No Configuration,No Configuration)
|
||||
2020-11-18 11:56:49,934 [FATAL] Updater:282 - Updater called before beeing initialized
|
||||
2020-11-18 11:56:49,940 [ERROR] Updater:967 - MainUpdater not yet initialized. External WinMGr cannot be set.
|
||||
2020-11-18 11:56:49,941 [INFO] CubeProgrammer:457 - [DDR PANEL] - PathOfProgrammer: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.4.0.202007081208\tools\bin
|
||||
2020-11-18 11:56:49,945 [INFO] ProgrammerExecThread:148 - [ProgrammerAPI] CubeProgrammer command construction: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.4.0.202007081208\tools\bin\STM32_Programmer_CLI.exe -l
|
||||
2020-11-18 11:56:50,046 [INFO] MainDdrPanel:49 - [DDR PANEL] SETTER - Set cubeProgrammerPath to: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.4.0.202007081208\tools\bin
|
||||
2020-11-18 11:56:50,048 [INFO] Updater:904 - Updater Version found : 6.0.0
|
||||
2020-11-18 11:56:50,069 [INFO] ApplicationProperties:181 - Using Application install path: C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824
|
||||
2020-11-18 11:56:50,260 [INFO] MainUpdater:2268 - connection check result : 10
|
||||
2020-11-18 11:56:50,261 [INFO] MainUpdater:239 - Updater Check For Update Now.
|
||||
2020-11-18 11:56:50,261 [INFO] MicroXplorer:414 - Change Database Version : DB.6.0.0
|
||||
2020-11-18 11:56:50,298 [INFO] CheckServerUpdateThread:102 - End of CheckServer Thread
|
||||
2020-11-18 11:56:50,368 [INFO] MainUpdater:2268 - connection check result : 10
|
||||
2020-11-18 11:56:50,369 [INFO] MainUpdater:2268 - connection check result : 10
|
||||
2020-11-18 11:56:50,474 [INFO] MicroXplorer:384 - Change Database Path :
|
||||
2020-11-18 11:56:50,475 [INFO] MicroXplorer:414 - Change Database Version : DB.6.0.0
|
||||
2020-11-18 11:56:50,475 [WARN] ThirdParty:775 - waiting for thirdparty lock release [close project]
|
||||
2020-11-18 11:56:50,476 [INFO] ThirdParty:777 - entering critical section [close project]
|
||||
2020-11-18 11:56:50,476 [INFO] ThirdParty:790 - exiting critical section [close project]
|
||||
2020-11-18 11:56:50,480 [INFO] PinOutPanel:1418 - setPackage(No Configuration,No Configuration)
|
||||
2020-11-18 11:56:50,481 [INFO] UtilMem:74 - Begin LoadConfig() Used Memory: 482966912 Bytes (682622976)
|
||||
2020-11-18 11:56:50,483 [INFO] MicroXplorer:384 - Change Database Path :
|
||||
2020-11-18 11:56:50,483 [INFO] MicroXplorer:414 - Change Database Version : DB.6.0.0
|
||||
2020-11-18 11:56:50,483 [INFO] OpenFileManager:274 - Change cursor
|
||||
2020-11-18 11:56:52,845 [WARN] IntegrityCheckThread:61 - waiting for thirdparty lock release [integrity check]
|
||||
2020-11-18 11:56:52,845 [INFO] IntegrityCheckThread:63 - entering critical section [integrity check]
|
||||
2020-11-18 11:56:52,937 [INFO] ThirdPartyDb:299 - Save Third Party DataBase File (C:/Users/camer/.stm32cubemx/plugins/thirdparty/db/thirdparties_db.xml) [forced]
|
||||
2020-11-18 11:56:53,053 [INFO] ThirdPartyDb:299 - Save Third Party DataBase File (C:/Users/camer/.stm32cubemx/plugins/thirdparty/db/thirdparties_db.xml) [forced]
|
||||
2020-11-18 11:56:53,095 [INFO] IntegrityCheckThread:76 - exiting critical section [integrity check]
|
||||
2020-11-18 11:56:53,095 [INFO] IntegrityCheckThread:79 - End integrity checks thread
|
||||
2020-11-18 11:56:55,489 [WARN] ApiManager:274 - Cannot register API 'Board Extension:IKS01A3' from pack STMicroelectronics.X-CUBE-MEMS1.8.1.1: no header file found
|
||||
2020-11-18 11:56:55,490 [WARN] ApiManager:274 - Cannot register API 'Board Extension:IKS01A2' from pack STMicroelectronics.X-CUBE-MEMS1.8.1.1: no header file found
|
||||
2020-11-18 11:56:55,490 [WARN] ApiManager:274 - Cannot register API 'Board Extension:IKS02A1' from pack STMicroelectronics.X-CUBE-MEMS1.8.1.1: no header file found
|
||||
2020-11-18 11:56:55,495 [INFO] DependencyParser:915 - This component is not compatible with the current MCU : [1604477466237]
|
||||
2020-11-18 11:56:55,495 [INFO] ThirdPartyModel:556 - Component with status : MCU_INCOMPATIBLE for condition : GFX01M1_Condition id : 1604477466222
|
||||
2020-11-18 11:56:55,496 [INFO] DependencyParser:915 - This component is not compatible with the current MCU : [1604477466237]
|
||||
2020-11-18 11:56:55,496 [INFO] ThirdPartyModel:556 - Component with status : MCU_INCOMPATIBLE for condition : GFX01M1_HelloWorld_Condition id : 1604477466224
|
||||
2020-11-18 11:56:55,498 [INFO] RtosManager:456 - Registered RTOS mode: class=CMSIS, group=RTOS, mode=CMSIS_V1, owner=FREERTOS
|
||||
2020-11-18 11:56:55,498 [INFO] RtosManager:456 - Registered RTOS mode: class=CMSIS, group=RTOS2, mode=CMSIS_V2, owner=FREERTOS
|
||||
2020-11-18 11:56:55,499 [INFO] RtosManager:456 - Registered RTOS mode: class=RTOS, group=Core, mode=CMSIS_V1, owner=FREERTOS
|
||||
2020-11-18 11:56:55,499 [INFO] RtosManager:456 - Registered RTOS mode: class=RTOS, group=Core, mode=CMSIS_V2, owner=FREERTOS
|
||||
2020-11-18 11:56:55,499 [WARN] ModelIntegratedComponent:188 - Missing modes for component 1604477487609
|
||||
2020-11-18 11:56:55,501 [WARN] ApiManager:274 - Cannot register API 'Board Extension:GNSS1A1' from pack STMicroelectronics.X-CUBE-GNSS1.5.0.0: no header file found
|
||||
2020-11-18 11:56:55,501 [WARN] ApiManager:274 - Cannot register API 'Board Support:Custom' from pack STMicroelectronics.X-CUBE-GNSS1.5.0.0: no header file found
|
||||
2020-11-18 11:56:55,501 [WARN] ApiManager:274 - Cannot register API 'Data Exchange:lib_gnss' from pack STMicroelectronics.X-CUBE-GNSS1.5.0.0: no header file found
|
||||
2020-11-18 11:56:55,502 [WARN] ApiManager:274 - Cannot register API 'Board Extension:S2868A1' from pack STMicroelectronics.X-CUBE-SUBG2.2.0.0: no header file found
|
||||
2020-11-18 11:56:55,502 [WARN] ApiManager:274 - Cannot register API 'Board Extension:S2868A2' from pack STMicroelectronics.X-CUBE-SUBG2.2.0.0: no header file found
|
||||
2020-11-18 11:56:55,502 [WARN] ApiManager:274 - Cannot register API 'Board Extension:S2915A1' from pack STMicroelectronics.X-CUBE-SUBG2.2.0.0: no header file found
|
||||
2020-11-18 11:56:55,502 [WARN] ApiManager:274 - Cannot register API 'Wireless:BlueNRG-MS' from pack STMicroelectronics.X-CUBE-BLE1.6.0.0: no header file found
|
||||
2020-11-18 11:56:55,503 [WARN] ApiManager:274 - Cannot register API 'Wireless:BlueNRG-2' from pack STMicroelectronics.X-CUBE-BLE2.3.0.0: no header file found
|
||||
2020-11-18 11:56:55,670 [INFO] ImportTextPane:162 - (OptionalMessage_ERROR) IP (RCC) : Invalid parameter (FamilyName)
|
||||
2020-11-18 11:56:56,174 [INFO] UtilMem:74 - End LoadConfig() Used Memory: 459874264 Bytes (721420288)
|
||||
2020-11-18 11:56:56,177 [INFO] DbMcusXml:100 - Load MCU database from C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.0.0.202007160824\\db\/mcu/families.xml
|
||||
2020-11-18 11:56:56,913 [INFO] DbMcusJson:92 - JSON generation date=Thu Nov 05 17:05:07 CET 2020 (1604592307)
|
||||
2020-11-18 11:56:58,007 [INFO] DbMcus:175 - Found 1761 MCUs (1722 are supported by CubeMX, 1738 are visible in CubeMX)
|
||||
2020-11-18 11:56:58,008 [INFO] ApiDb:201 - Load user favorites file C:\Users\camer/.stm32cubemx/favorites.mcus.txt: 0 item(s)
|
||||
2020-11-18 11:56:58,008 [INFO] ApiDb:205 - User favorites MCUs=[]
|
||||
2020-11-18 11:56:58,008 [INFO] DbMcus:187 - Set 0 / 0 favorites MCUs
|
||||
2020-11-18 11:56:58,011 [WARN] ThirdParty:741 - waiting for thirdparty lock release [change project]
|
||||
2020-11-18 11:56:58,011 [INFO] ThirdParty:743 - entering critical section [change project]
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-MEMS1 8.1.1
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics USB_HOST 2.0.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-DISPLAY 1.0.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics FreeRTOS 0.0.1
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics USB_DEVICE 1.0.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-ALGOBUILD 1.1.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics USB_DEVICE 3.0.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-GNSS1 5.0.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-SUBG2 2.0.0
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics MBEDTLS 2.16.2
|
||||
2020-11-18 11:56:58,012 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-BLE1 6.0.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics lwIP 2.0.3
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics lwIP 2.1.2
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics MBEDTLS 2.14.1
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-TOUCHGFX 4.15.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics USB_HOST 1.0.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-AI 5.2.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-BLE2 3.0.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics X-CUBE-NFC4 2.0.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics PDM2PCM 3.1.0
|
||||
2020-11-18 11:56:58,013 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics PDM2PCM 3.2.0
|
||||
2020-11-18 11:56:58,014 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics USB_DEVICE 2.0.0
|
||||
2020-11-18 11:56:58,014 [INFO] ThirdParty:968 - CMSIS Pack Vendor :STMicroelectronics PDM2PCM 3.3.0
|
||||
2020-11-18 11:56:58,014 [INFO] ThirdParty:749 - exiting critical section [change project]
|
||||
2020-11-18 11:56:58,597 [INFO] PinOutPanel:1418 - setPackage(No Configuration,No Configuration)
|
||||
2020-11-18 11:56:58,599 [INFO] PinOutPanel:1418 - setPackage(STM32L476RGTx,LQFP64)
|
||||
2020-11-18 11:56:59,555 [INFO] UtilMem:74 - Before build in PCC Used Memory: 515862920 Bytes (796917760)
|
||||
2020-11-18 11:57:00,390 [INFO] SharedServices:71 - Folder for power plug-in: C:/Users/camer/.stm32cubemx/plugins/power
|
||||
2020-11-18 11:57:00,464 [INFO] SharedServices:71 - Folder for power plug-in: C:/Users/camer/.stm32cubemx/plugins/power
|
||||
2020-11-18 11:57:00,574 [INFO] SharedServices:71 - Folder for power plug-in: C:/Users/camer/.stm32cubemx/plugins/power
|
||||
2020-11-18 11:57:00,590 [INFO] SharedServices:71 - Folder for power plug-in: C:/Users/camer/.stm32cubemx/plugins/power
|
||||
2020-11-18 11:57:00,892 [INFO] UtilMem:74 - After build in PCC Used Memory: 577728904 Bytes (796917760)
|
||||
2020-11-18 11:57:00,925 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,926 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,926 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,926 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,926 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,927 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,927 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,927 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,927 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,927 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,928 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,928 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,928 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,928 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,929 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,929 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,929 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,930 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,930 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,930 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,931 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,931 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,931 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,932 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,932 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,932 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,933 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,933 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,933 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,934 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,934 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,934 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,934 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,935 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,935 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,935 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,935 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,935 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,936 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,936 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,936 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,936 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,936 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,936 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,937 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,937 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,937 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,937 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,937 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,938 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,938 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,938 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,938 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,938 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,938 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,939 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,939 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,940 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,940 [INFO] IPUIPlugin:64 - create IPUIPlugin
|
||||
2020-11-18 11:57:00,992 [INFO] LogOutputStream:76 - [STDOUT_REDIRECT] toolchainItems.length=====1
|
||||
2020-11-18 11:57:01,247 [INFO] OpenFileManager:294 - Restore cursor
|
||||
|
|
|
@ -643,3 +643,695 @@ Command-line arguments: -os win32 -ws win32 -arch x86_64
|
|||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2020-11-18 09:40:35.090
|
||||
!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties
|
||||
!SESSION 2020-11-18 10:56:26.266 -----------------------------------------------
|
||||
eclipse.buildId=Version 1.4.0
|
||||
java.version=1.8.0_252
|
||||
java.vendor=AdoptOpenJDK
|
||||
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
|
||||
Command-line arguments: -os win32 -ws win32 -arch x86_64
|
||||
|
||||
!ENTRY org.eclipse.core.resources 2 10035 2020-11-18 10:56:28.092
|
||||
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
|
||||
|
||||
!ENTRY org.eclipse.core.resources 4 567 2020-11-18 10:56:28.203
|
||||
!MESSAGE Workspace restored, but some problems occurred.
|
||||
!SUBENTRY 1 org.eclipse.core.resources 4 567 2020-11-18 10:56:28.203
|
||||
!MESSAGE Could not read metadata for 'RealOne'.
|
||||
!STACK 1
|
||||
org.eclipse.core.internal.resources.ResourceException(/RealOne)[567]: java.lang.Exception: The project description file (.project) for 'RealOne' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
|
||||
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
|
||||
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:888)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:868)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:724)
|
||||
at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1557)
|
||||
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2454)
|
||||
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2211)
|
||||
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:489)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
|
||||
at java.security.AccessController.doPrivileged(Native Method)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
|
||||
at org.eclipse.osgi.container.Module.doStart(Module.java:603)
|
||||
at org.eclipse.osgi.container.Module.start(Module.java:467)
|
||||
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
|
||||
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
|
||||
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:330)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
|
||||
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:472)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
|
||||
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
!SUBENTRY 2 org.eclipse.core.resources 4 567 2020-11-18 10:56:28.205
|
||||
!MESSAGE The project description file (.project) for 'RealOne' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
!STACK 0
|
||||
java.lang.Exception: The project description file (.project) for 'RealOne' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
|
||||
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
|
||||
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:888)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:868)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:724)
|
||||
at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1557)
|
||||
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2454)
|
||||
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2211)
|
||||
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:489)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
|
||||
at java.security.AccessController.doPrivileged(Native Method)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
|
||||
at org.eclipse.osgi.container.Module.doStart(Module.java:603)
|
||||
at org.eclipse.osgi.container.Module.start(Module.java:467)
|
||||
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
|
||||
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
|
||||
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:330)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
|
||||
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:472)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
|
||||
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
!SUBENTRY 1 org.eclipse.core.resources 4 567 2020-11-18 10:56:28.206
|
||||
!MESSAGE Could not read metadata for 'RemoteSystemsTempFiles'.
|
||||
!STACK 1
|
||||
org.eclipse.core.internal.resources.ResourceException(/RemoteSystemsTempFiles)[567]: java.lang.Exception: The project description file (.project) for 'RemoteSystemsTempFiles' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
|
||||
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
|
||||
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:888)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:868)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:724)
|
||||
at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1557)
|
||||
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2454)
|
||||
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2211)
|
||||
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:489)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
|
||||
at java.security.AccessController.doPrivileged(Native Method)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
|
||||
at org.eclipse.osgi.container.Module.doStart(Module.java:603)
|
||||
at org.eclipse.osgi.container.Module.start(Module.java:467)
|
||||
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
|
||||
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
|
||||
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:330)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
|
||||
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:472)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
|
||||
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
!SUBENTRY 2 org.eclipse.core.resources 4 567 2020-11-18 10:56:28.206
|
||||
!MESSAGE The project description file (.project) for 'RemoteSystemsTempFiles' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
!STACK 0
|
||||
java.lang.Exception: The project description file (.project) for 'RemoteSystemsTempFiles' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
|
||||
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
|
||||
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:888)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:868)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:724)
|
||||
at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1557)
|
||||
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2454)
|
||||
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2211)
|
||||
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:489)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
|
||||
at java.security.AccessController.doPrivileged(Native Method)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
|
||||
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1015)
|
||||
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
|
||||
at org.eclipse.osgi.container.Module.doStart(Module.java:603)
|
||||
at org.eclipse.osgi.container.Module.start(Module.java:467)
|
||||
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:493)
|
||||
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
|
||||
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:571)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:330)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
|
||||
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:472)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
|
||||
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
|
||||
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
|
||||
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2020-11-18 10:56:32.911
|
||||
!MESSAGE Log4j initialized with config file C:\Users\camer\Desktop\LoPoSo\PlaygroundYoupi\.metadata\.log4j.xml
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2020-11-18 10:56:38.849
|
||||
!MESSAGE Started RMI Server, listening on port 41337
|
||||
|
||||
!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2020-11-18 10:56:39.489
|
||||
!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties
|
||||
|
||||
!ENTRY org.eclipse.core.resources 4 567 2020-11-18 10:57:22.236
|
||||
!MESSAGE The project description file (.project) for 'RealOne' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
!STACK 0
|
||||
java.lang.Exception: The project description file (.project) for 'RealOne' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
|
||||
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
|
||||
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
|
||||
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:907)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:888)
|
||||
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:763)
|
||||
at org.eclipse.core.internal.resources.Project.open(Project.java:1056)
|
||||
at org.eclipse.core.internal.resources.Project.open(Project.java:1102)
|
||||
at org.eclipse.ui.actions.OpenResourceAction$1.doOpenWithReferences(OpenResourceAction.java:233)
|
||||
at org.eclipse.ui.actions.OpenResourceAction$1.runInWorkspace(OpenResourceAction.java:279)
|
||||
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
|
||||
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
|
||||
|
||||
!ENTRY org.eclipse.cdt.core 1 0 2020-11-18 10:57:58.147
|
||||
!MESSAGE Indexed 'RealOne' (29 sources, 119 headers) in 6.29 sec: 11,563 declarations; 57,597 references; 3 unresolved inclusions; 29 syntax errors; 172 unresolved names (0.25%)
|
||||
|
||||
!ENTRY org.eclipse.jface 2 0 2020-11-18 10:58:26.316
|
||||
!MESSAGE Ignored reentrant call while viewer is busy. This is only logged once per viewer instance, but similar calls will still be ignored.
|
||||
!STACK 0
|
||||
java.lang.RuntimeException
|
||||
at org.eclipse.jface.viewers.ColumnViewer.checkBusy(ColumnViewer.java:764)
|
||||
at org.eclipse.jface.viewers.ColumnViewer.update(ColumnViewer.java:543)
|
||||
at org.eclipse.ui.navigator.CommonViewer.update(CommonViewer.java:512)
|
||||
at org.eclipse.jface.viewers.StructuredViewer.update(StructuredViewer.java:1965)
|
||||
at org.eclipse.ui.internal.navigator.resources.nested.NestedProjectsLabelProvider.lambda$2(NestedProjectsLabelProvider.java:87)
|
||||
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:670)
|
||||
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646)
|
||||
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
|
||||
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1609)
|
||||
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1596)
|
||||
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
|
||||
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
|
||||
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
|
||||
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 11:39:14.450
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui 4 4 2020-11-18 11:48:39.089
|
||||
!MESSAGE Unable to create part
|
||||
!STACK 1
|
||||
org.eclipse.ui.PartInitException: Invalid Input: Must be project's active .ioc file.
|
||||
|
||||
Project's 'RealOne' active one is 'RealOne.ioc' file
|
||||
at com.st.stm32cube.common.mx.editor.CubeMxEditor.init(CubeMxEditor.java:795)
|
||||
at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
|
||||
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:340)
|
||||
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
|
||||
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:998)
|
||||
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:963)
|
||||
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139)
|
||||
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408)
|
||||
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:331)
|
||||
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
|
||||
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
|
||||
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
|
||||
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
|
||||
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:1002)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:768)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:739)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:733)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:717)
|
||||
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:107)
|
||||
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
|
||||
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
|
||||
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:146)
|
||||
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4622)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219)
|
||||
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
|
||||
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
|
||||
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
|
||||
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
|
||||
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
|
||||
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
|
||||
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132)
|
||||
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
|
||||
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
|
||||
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
|
||||
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
|
||||
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
|
||||
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170)
|
||||
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188)
|
||||
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:651)
|
||||
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:615)
|
||||
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:790)
|
||||
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:404)
|
||||
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1239)
|
||||
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3205)
|
||||
at org.eclipse.ui.internal.WorkbenchPage.lambda$9(WorkbenchPage.java:3110)
|
||||
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
|
||||
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3108)
|
||||
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3078)
|
||||
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3069)
|
||||
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:570)
|
||||
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:525)
|
||||
at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:103)
|
||||
at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditorAction.java:96)
|
||||
at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:215)
|
||||
at org.eclipse.ui.navigator.CommonNavigatorManager$1.open(CommonNavigatorManager.java:183)
|
||||
at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
|
||||
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:797)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
|
||||
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
|
||||
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:794)
|
||||
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1110)
|
||||
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:454)
|
||||
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
|
||||
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:270)
|
||||
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:310)
|
||||
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
|
||||
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4173)
|
||||
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
|
||||
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3986)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
!SUBENTRY 1 org.eclipse.ui 4 0 2020-11-18 11:48:39.090
|
||||
!MESSAGE Invalid Input: Must be project's active .ioc file.
|
||||
|
||||
Project's 'RealOne' active one is 'RealOne.ioc' file
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 11:59:01.606
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 12:10:15.986
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 12:20:45.991
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 12:21:52.383
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 12:25:51.024
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 12:27:22.043
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
||||
!ENTRY org.eclipse.ui.workbench.texteditor 4 0 2020-11-18 12:28:18.911
|
||||
!MESSAGE
|
||||
!STACK 0
|
||||
java.lang.NullPointerException
|
||||
at org.eclipse.ui.texteditor.AbstractTextEditor$TextEditorSavable.isDirty(AbstractTextEditor.java:7196)
|
||||
at org.eclipse.ui.internal.Workbench.getFilteredSaveables(Workbench.java:3472)
|
||||
at org.eclipse.ui.internal.Workbench.saveAll(Workbench.java:3445)
|
||||
at org.eclipse.ui.ide.IDE$1.run(IDE.java:1495)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
|
||||
at org.eclipse.ui.ide.IDE.saveAllEditors(IDE.java:1483)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.doSave(SaveScopeResourcesHandler.java:228)
|
||||
at org.eclipse.debug.internal.ui.launchConfigurations.SaveScopeResourcesHandler.handleStatus(SaveScopeResourcesHandler.java:182)
|
||||
at org.eclipse.debug.internal.ui.sourcelookup.Prompter.lambda$0(Prompter.java:73)
|
||||
at org.eclipse.ui.internal.PendingSyncExec.run(PendingSyncExec.java:68)
|
||||
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:171)
|
||||
at org.eclipse.ui.internal.UISynchronizer.lambda$0(UISynchronizer.java:152)
|
||||
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
|
||||
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
|
||||
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961)
|
||||
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
|
||||
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
|
||||
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
|
||||
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
|
||||
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
|
||||
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
|
||||
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
|
||||
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
|
||||
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
|
||||
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
||||
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
|
||||
at java.lang.reflect.Method.invoke(Method.java:498)
|
||||
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
|
||||
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
|
||||
at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
NUMBER_FORMAT=0
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.cdt.dsf.debug.internal.ui.ExpressionInformationControlCreator$ExpressionInformationControl">
|
||||
<item key="WIDTH" value="816"/>
|
||||
<item key="HEIGHT" value="297"/>
|
||||
<item key="SashWeightTree" value="200"/>
|
||||
<item key="SashWeightDetails" value="200"/>
|
||||
</section>
|
||||
</section>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.cdt.internal.ui.MakeView">
|
||||
</section>
|
||||
</section>
|
|
@ -1,10 +0,0 @@
|
|||
10:05:36 **** Incremental Build of configuration Debug for project L476_ats_blink-master ****
|
||||
make -j8 all
|
||||
arm-none-eabi-size L476_ats_blink-master.elf
|
||||
text data bss dec hex filename
|
||||
3648 20 1604 5272 1498 L476_ats_blink-master.elf
|
||||
Finished building: default.size.stdout
|
||||
|
||||
|
||||
10:05:37 Build Finished. 0 errors, 0 warnings. (took 260ms)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
10:00:06 **** Build of configuration Debug for project RealOne ****
|
||||
12:28:19 **** Incremental Build of configuration Debug for project RealOne ****
|
||||
make -j8 all
|
||||
arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m4 -std=gnu11 -g3 '-DHSE_VALUE=8000000' '-DMSI_VALUE=4000000' '-DLSI_VALUE=32000' '-DHSE_STARTUP_TIMEOUT=100' '-DHSI_VALUE=16000000' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DDATA_CACHE_ENABLE=1' -DUSE_HAL_DRIVER '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNALSAI2_CLOCK_VALUE=2097000' -DSTM32L476xx -DUSE_FULL_LL_DRIVER '-DEXTERNALSAI1_CLOCK_VALUE=2097000' '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/main.o"
|
||||
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||
|
@ -29,50 +29,44 @@ In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
|||
#define DATA_CACHE_ENABLE 1U
|
||||
|
||||
<command-line>:0:0: note: this is the location of the previous definition
|
||||
../Core/Src/main.c: In function 'RTC_wakeup_init':
|
||||
../Core/Src/main.c:297:1: warning: implicit declaration of function 'LL_RTC_DisableWriteProtection'; did you mean 'LL_PWR_DisableSRAM2Retention'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LL_PWR_DisableSRAM2Retention
|
||||
../Core/Src/main.c:298:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_Disable'; did you mean 'LL_RCC_LSE_Disable'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
^~~~~~~~~~~~~~~~~~~~~
|
||||
LL_RCC_LSE_Disable
|
||||
../Core/Src/main.c:299:10: warning: implicit declaration of function 'LL_RTC_IsActiveFlag_WUTW'; did you mean 'LL_PWR_IsActiveFlag_WU1'? [-Wimplicit-function-declaration]
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LL_PWR_IsActiveFlag_WU1
|
||||
../Core/Src/main.c:302:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_SetClock'; did you mean 'IS_RTC_WAKEUP_CLOCK'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
^~~~~~~~~~~~~~~~~~~~~~
|
||||
IS_RTC_WAKEUP_CLOCK
|
||||
../Core/Src/main.c:302:30: error: 'LL_RTC_WAKEUPCLOCK_CKSPRE' undeclared (first use in this function); did you mean 'IS_RTC_WAKEUP_CLOCK'?
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
IS_RTC_WAKEUP_CLOCK
|
||||
../Core/Src/main.c:302:30: note: each undeclared identifier is reported only once for each function it appears in
|
||||
../Core/Src/main.c:304:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_SetAutoReload'; did you mean '__HAL_TIM_SetAutoreload'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
__HAL_TIM_SetAutoreload
|
||||
../Core/Src/main.c:305:1: warning: implicit declaration of function 'LL_RTC_ClearFlag_WUT'; did you mean 'LL_PWR_ClearFlag_WU1'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
^~~~~~~~~~~~~~~~~~~~
|
||||
LL_PWR_ClearFlag_WU1
|
||||
../Core/Src/main.c:306:1: warning: implicit declaration of function 'LL_RTC_EnableIT_WUT'; did you mean 'LL_DMA_EnableIT_HT'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
^~~~~~~~~~~~~~~~~~~
|
||||
LL_DMA_EnableIT_HT
|
||||
../Core/Src/main.c:307:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_Enable'; did you mean 'LL_RCC_LSE_Enable'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
^~~~~~~~~~~~~~~~~~~~
|
||||
LL_RCC_LSE_Enable
|
||||
../Core/Src/main.c:308:1: warning: implicit declaration of function 'LL_RTC_EnableWriteProtection'; did you mean 'LL_PWR_EnableSRAM2Retention'? [-Wimplicit-function-declaration]
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LL_PWR_EnableSRAM2Retention
|
||||
make: *** [Core/Src/subdir.mk:38: Core/Src/main.o] Error 1
|
||||
"make -j8 all" terminated with exit code 2. Build might be incomplete.
|
||||
In file included from ../Core/Inc/main.h:42:0,
|
||||
from ../Core/Src/main.c:8:
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h:64:0: warning: "RTC_INIT_MASK" redefined
|
||||
#define RTC_INIT_MASK 0xFFFFFFFFU
|
||||
|
||||
10:00:08 Build Failed. 2 errors, 13 warnings. (took 2s.138ms)
|
||||
In file included from ../Core/Inc/stm32l4xx_hal_conf.h:409:0,
|
||||
from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30,
|
||||
from ../Core/Inc/main.h:31,
|
||||
from ../Core/Src/main.c:8:
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rtc.h:979:0: note: this is the location of the previous definition
|
||||
#define RTC_INIT_MASK 0xFFFFFFFFu
|
||||
|
||||
In file included from ../Core/Inc/main.h:42:0,
|
||||
from ../Core/Src/main.c:8:
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h:65:0: warning: "RTC_RSF_MASK" redefined
|
||||
#define RTC_RSF_MASK 0xFFFFFF5FU
|
||||
|
||||
In file included from ../Core/Inc/stm32l4xx_hal_conf.h:409:0,
|
||||
from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30,
|
||||
from ../Core/Inc/main.h:31,
|
||||
from ../Core/Src/main.c:8:
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_rtc.h:983:0: note: this is the location of the previous definition
|
||||
#define RTC_RSF_MASK (~(RTC_ISR_INIT | RTC_ISR_RSF))
|
||||
|
||||
arm-none-eabi-gcc -o "RealOne.elf" @"objects.list" -mcpu=cortex-m4 -T"C:\Users\camer\Desktop\LoPoSo\RealOne\STM32L476RGTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="RealOne.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
|
||||
Finished building target: RealOne.elf
|
||||
|
||||
arm-none-eabi-objdump -h -S RealOne.elf > "RealOne.list"
|
||||
arm-none-eabi-objcopy -O binary RealOne.elf "RealOne.bin"
|
||||
arm-none-eabi-size RealOne.elf
|
||||
text data bss dec hex filename
|
||||
5008 20 1572 6600 19c8 RealOne.elf
|
||||
Finished building: default.size.stdout
|
||||
|
||||
Finished building: RealOne.bin
|
||||
Finished building: RealOne.list
|
||||
|
||||
|
||||
|
||||
12:28:20 Build Finished. 0 errors, 6 warnings. (took 1s.660ms)
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="completion_proposal_size">
|
||||
</section>
|
||||
<section name="org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration">
|
||||
</section>
|
||||
<section name="org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration.internal">
|
||||
<item key="size.width" value="586"/>
|
||||
<item key="size.height" value="180"/>
|
||||
</section>
|
||||
<section name="PDOMSearchPage">
|
||||
</section>
|
||||
</section>
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,372 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 8:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,217 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0){
|
||||
expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}else if (expe != 0 && BLUE_BUTTON()){
|
||||
expe ++;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
}else{
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,375 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 8:
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 7) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
case 8:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 8:
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
expe ++;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
}else{
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.h
|
||||
* @brief : Header for main.c file.
|
||||
* This file contains the common defines of the application.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MAIN_H
|
||||
#define __MAIN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "stm32l4xx_ll_crs.h"
|
||||
#include "stm32l4xx_ll_rcc.h"
|
||||
#include "stm32l4xx_ll_bus.h"
|
||||
#include "stm32l4xx_ll_system.h"
|
||||
#include "stm32l4xx_ll_exti.h"
|
||||
#include "stm32l4xx_ll_cortex.h"
|
||||
#include "stm32l4xx_ll_utils.h"
|
||||
#include "stm32l4xx_ll_pwr.h"
|
||||
#include "stm32l4xx_ll_dma.h"
|
||||
#include "stm32l4xx_ll_gpio.h"
|
||||
#include "stm32l4xx_ll_rtc.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "../Src/gpio.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
void SystemClock_Config_24M_LSE(void);
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void);
|
||||
void SystemClock_Config_80M(void);
|
||||
void Init_LSE(void);
|
||||
static void RTC_wakeup_init( int delay );
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay );
|
||||
void RTC_wakeup_init_from_stop( int delay );
|
||||
void RTC_WKUP_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MAIN_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
@ -0,0 +1,372 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 7) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
__WFI();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 2;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
//
|
||||
// //expe = register RTC
|
||||
// expe = RTC->BKP0R;
|
||||
// if (expe == 0){
|
||||
// expe = 1;
|
||||
// RTC->BKP0R = expe;
|
||||
// }else if (expe != 0 && BLUE_BUTTON()){
|
||||
// expe ++;
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// }else{
|
||||
// SystemClock_Config_24M_LSE();
|
||||
// expe = 1;
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,373 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
break;
|
||||
case 8:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -0,0 +1,375 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
break;
|
||||
case 8:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 8:
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
case 8:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE_WUT );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -30,7 +30,7 @@ void SysTick_Handler()
|
|||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ int main(void)
|
|||
|
||||
expe ++;
|
||||
|
||||
if (expe > 2) expe = 1;
|
||||
if (expe > 7) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
@ -79,6 +79,9 @@ int main(void)
|
|||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
default: //case 3 to 8
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,17 +97,85 @@ int main(void)
|
|||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
|
@ -219,3 +290,50 @@ void SystemClock_Config_80M(void)
|
|||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 2;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
//
|
||||
// //expe = register RTC
|
||||
// expe = RTC->BKP0R;
|
||||
// if (expe == 0){
|
||||
// expe = 1;
|
||||
// RTC->BKP0R = expe;
|
||||
// }else if (expe != 0 && BLUE_BUTTON()){
|
||||
// expe ++;
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// }else{
|
||||
// SystemClock_Config_24M_LSE();
|
||||
// expe = 1;
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
case 8:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,218 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 2) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
}else{
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
expe ++;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
}else{
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -63,6 +63,7 @@ extern "C" {
|
|||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
void SystemClock_Config_24M_LSE(void);
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void);
|
||||
void SystemClock_Config_80M(void);
|
||||
void Init_LSE(void);
|
||||
/* USER CODE BEGIN EFP */
|
|
@ -0,0 +1,373 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 8:
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
expe ++;
|
||||
RTC->BKP0R = expe;
|
||||
|
||||
}else{
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -1,217 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 2;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
//
|
||||
// //expe = register RTC
|
||||
// expe = RTC->BKP0R;
|
||||
// if (expe == 0){
|
||||
// expe = 1;
|
||||
// RTC->BKP0R = expe;
|
||||
// }else if (expe != 0 && BLUE_BUTTON()){
|
||||
// expe ++;
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// }else{
|
||||
// SystemClock_Config_24M_LSE();
|
||||
// expe = 1;
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,373 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 8:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -30,7 +30,7 @@ void SysTick_Handler()
|
|||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
@ -290,3 +290,50 @@ void SystemClock_Config_80M(void)
|
|||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -1,216 +0,0 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 2;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
//
|
||||
// //expe = register RTC
|
||||
// expe = RTC->BKP0R;
|
||||
// if (expe == 0){
|
||||
// expe = 1;
|
||||
// RTC->BKP0R = expe;
|
||||
// }else if (expe != 0 && BLUE_BUTTON()){
|
||||
// expe ++;
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// }else{
|
||||
// SystemClock_Config_24M_LSE();
|
||||
// expe = 1;
|
||||
// LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
// LL_PWR_EnableBkUpAccess();
|
||||
// RTC->BKP0R = expe;
|
||||
// }
|
||||
// LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ void SysTick_Handler()
|
|||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2){
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
@ -45,37 +45,73 @@ int main(void)
|
|||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 2) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
}else{
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 7) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,25 +119,92 @@ int main(void)
|
|||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
|
@ -216,3 +319,50 @@ void SystemClock_Config_80M(void)
|
|||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
|
@ -0,0 +1,374 @@
|
|||
/* Project L476_ats_blink for STM32L476 mounted on Nucleo board:
|
||||
* the user LED (mounted on pin PA-5) is flashed every second for 50 ms.
|
||||
* The time base is provided by Systick (1000 ticks per second).
|
||||
* The clock configuration is the default one (Sysclk = 80 MHz, derived from MSI and PLL).
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
// #if defined(USE_FULL_ASSERT)
|
||||
// #include "stm32_assert.h"
|
||||
// #endif /* USE_FULL_ASSERT */
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
// systick interrupt handler
|
||||
volatile uint32_t msTicks = 0;
|
||||
volatile uint8_t expe = 0;
|
||||
volatile uint8_t blue_mode = 0;
|
||||
|
||||
void SysTick_Handler()
|
||||
{
|
||||
if ( BLUE_BUTTON() ){
|
||||
blue_mode = 1 ;
|
||||
}
|
||||
|
||||
msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */
|
||||
if (msTicks == 5 * expe){
|
||||
LED_GREEN(0);
|
||||
}else if(msTicks >= 200){
|
||||
msTicks = 0;
|
||||
LED_GREEN(1);
|
||||
}
|
||||
if(expe == 2 || expe == 4){
|
||||
CLK_TOGGLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
|
||||
// config GPIO
|
||||
GPIO_init();
|
||||
|
||||
// if (RCC->BDCR & RCC_BDCR_LSEON) {
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
|
||||
//expe = register RTC
|
||||
expe = RTC->BKP0R;
|
||||
if (expe == 0) {
|
||||
SystemClock_Config_24M_LSE();
|
||||
expe = 1;
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
|
||||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
||||
// }
|
||||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
LL_LPM_EnableDeepSleep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// init systick timer (tick period at 1 ms)
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
case 8:
|
||||
__WFI();
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemClock_Config_24M_LSE_FL3_VS2(void){
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_3);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_3)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* @retval None
|
||||
* 24Mhz + RTC + LSE
|
||||
*/
|
||||
void SystemClock_Config_24M_LSE(void)
|
||||
{
|
||||
LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR );
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LL_PWR_EnableBkUpAccess();
|
||||
// LL_RCC_ForceBackupDomainReset();
|
||||
LL_RCC_ReleaseBackupDomainReset();
|
||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
||||
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
// LL_RCC_MSI_EnablePLLMode();
|
||||
|
||||
LL_RCC_LSE_Enable();
|
||||
|
||||
/* Wait till LSE is ready */
|
||||
while(LL_RCC_LSE_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE);
|
||||
LL_RCC_EnableRTC();
|
||||
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 24, LL_RCC_PLLR_DIV_4);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(24000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SystemClock_Config_80M(void)
|
||||
{
|
||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
||||
while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_4)
|
||||
{
|
||||
}
|
||||
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
|
||||
LL_RCC_MSI_Enable();
|
||||
|
||||
/* Wait till MSI is ready */
|
||||
while(LL_RCC_MSI_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
||||
LL_RCC_PLL_EnableDomain_SYS();
|
||||
LL_RCC_PLL_Enable();
|
||||
|
||||
/* Wait till PLL is ready */
|
||||
while(LL_RCC_PLL_IsReady() != 1)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
||||
|
||||
/* Wait till System clock is ready */
|
||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
||||
{
|
||||
|
||||
}
|
||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
||||
LL_SetSystemCoreClock(80000000);
|
||||
|
||||
/* Update the time base */
|
||||
if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK)
|
||||
{
|
||||
// Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
// partie commune a toutes les utilisations du wakeup timer
|
||||
static void RTC_wakeup_init( int delay )
|
||||
{
|
||||
LL_RTC_DisableWriteProtection( RTC );
|
||||
LL_RTC_WAKEUP_Disable( RTC );
|
||||
while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) )
|
||||
{ }
|
||||
// connecter le timer a l'horloge 1Hz de la RTC
|
||||
LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE );
|
||||
// fixer la duree de temporisation
|
||||
LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits
|
||||
LL_RTC_ClearFlag_WUT(RTC);
|
||||
LL_RTC_EnableIT_WUT(RTC);
|
||||
LL_RTC_WAKEUP_Enable(RTC);
|
||||
LL_RTC_EnableWriteProtection(RTC);
|
||||
}
|
||||
|
||||
// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset
|
||||
// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté)
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// enable the Internal Wake-up line
|
||||
LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx
|
||||
}
|
||||
|
||||
// Dans le cas des modes STOPx, le MPU sera reveille par interruption
|
||||
// le module EXTI et une partie du NVIC sont encore alimentes
|
||||
// le contenu de la RAM et des registres étant préservé, le MPU
|
||||
// reprend l'execution après l'instruction WFI
|
||||
void RTC_wakeup_init_from_stop( int delay )
|
||||
{
|
||||
RTC_wakeup_init( delay );
|
||||
// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer
|
||||
LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 );
|
||||
LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 );
|
||||
// valider l'interrupt chez NVIC
|
||||
NVIC_SetPriority( RTC_WKUP_IRQn, 1 );
|
||||
NVIC_EnableIRQ( RTC_WKUP_IRQn );
|
||||
}
|
||||
|
||||
// wakeup timer interrupt Handler (inutile mais doit etre defini)
|
||||
void RTC_WKUP_IRQHandler()
|
||||
{
|
||||
LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 );
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
DeviceConfigurationTool.AskToSwitchToCubeMxPerspective=false
|
||||
DeviceConfigurationTool.SwitchToCubeMxPerspective=true
|
||||
eclipse.preferences.version=1
|
|
@ -1,7 +0,0 @@
|
|||
columnOrderKeyEXE=0,1,2,3,4,5
|
||||
columnOrderKeySF=0,1,2,3,4,5
|
||||
columnSortDirectionKeyEXE=128
|
||||
columnSortDirectionKeySF=128
|
||||
eclipse.preferences.version=1
|
||||
visibleColumnsKeyEXE=1,1,1,0,0,0
|
||||
visibleColumnsKeySF=1,1,0,0,0,0
|
|
@ -1,2 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
useAnnotationsPrefPage=true
|
|
@ -1,3 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
properties/L476_ats_blink-master.null.288482210/com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1993574618=com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.994264857\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.91709690\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1202888461\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.625023476\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.63586621\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1360455809\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1067399580\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1553682211\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1993574618\=rcState\\\=0\\r\\nrebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1727439865\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.364289998\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.609578370\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.429240276\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.853959268\=rebuildState\\\=false\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.424373827\=rebuildState\\\=false\\r\\n\r\n
|
||||
properties/L476_ats_blink-master.null.288482210/com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.1139819027=com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1581129723\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1387555249\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.2118805013\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.144237511\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.829735460\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.284733610\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.442331978\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.1703995923\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.972505564\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1321327754\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.680088270\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.237074260\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1681344170\=rebuildState\\\=true\\r\\n\r\ncom.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1140645243\=rebuildState\\\=true\\r\\n\r\n
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
spelling_locale=en_GB
|
||||
spelling_locale_initialized=true
|
||||
useAnnotationsPrefPage=true
|
||||
useQuickDiffPrefPage=true
|
|
@ -1,7 +1,5 @@
|
|||
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.debug.gdbjtag.launchConfigurationType=org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate,debug,;
|
||||
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.applicationLaunchType=org.eclipse.cdt.dsf.gdb.launch.localCLaunch,debug,;org.eclipse.cdt.cdi.launch.localCLaunch,run,;
|
||||
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.attachLaunchType=org.eclipse.cdt.dsf.gdb.launch.attachCLaunch,debug,;
|
||||
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.postmortemLaunchType=org.eclipse.cdt.dsf.gdb.launch.coreCLaunch,debug,;
|
||||
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.remoteApplicationLaunchType=org.eclipse.rse.remotecdt.dsf.debug,debug,;
|
||||
eclipse.preferences.version=1
|
||||
prefWatchExpressions=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<watchExpressions>\r\n<expression enabled\="true" text\="expe"/>\r\n<expression enabled\="true" text\="blue_mode"/>\r\n<expression enabled\="true" text\="RTC->BKP0R"/>\r\n</watchExpressions>\r\n
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.debug.ui.MemoryView.orientation=0
|
||||
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n
|
||||
org.eclipse.debug.ui.user_view_bindings=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<viewBindings>\r\n<view id\="org.eclipse.debug.ui.ExpressionView">\r\n<perspective id\="org.eclipse.debug.ui.DebugPerspective" userAction\="opened"/>\r\n</view>\r\n</viewBindings>\r\n
|
||||
pref_state_memento.org.eclipse.debug.ui.ExpressionView=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<VariablesViewMemento org.eclipse.debug.ui.SASH_DETAILS_PART\="315" org.eclipse.debug.ui.SASH_VIEW_PART\="684">\r\n<PRESENTATION_CONTEXT_PROPERTIES IMemento.internal.id\="org.eclipse.debug.ui.ExpressionView">\r\n<INTEGER IMemento.internal.id\="initialChildCountLimitForCollections" INTEGER\="100"/>\r\n<PERSISTABLE IMemento.internal.id\="org.eclipse.cdt.dsf.ui.elementFormatPersistable" PERSISTABLE\="org.eclipse.cdt.dsf.ui.simpleMapPersistableFactory">\r\n<type>java.lang.String</type>\r\n</PERSISTABLE>\r\n<BOOLEAN BOOLEAN\="true" IMemento.internal.id\="PRESENTATION_SHOW_LOGICAL_STRUCTURES"/>\r\n</PRESENTATION_CONTEXT_PROPERTIES>\r\n</VariablesViewMemento>
|
||||
pref_state_memento.org.eclipse.debug.ui.VariableView=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<VariablesViewMemento org.eclipse.debug.ui.SASH_DETAILS_PART\="315" org.eclipse.debug.ui.SASH_VIEW_PART\="684">\r\n<PRESENTATION_CONTEXT_PROPERTIES IMemento.internal.id\="org.eclipse.debug.ui.VariableView">\r\n<INTEGER IMemento.internal.id\="initialChildCountLimitForCollections" INTEGER\="100"/>\r\n<BOOLEAN BOOLEAN\="true" IMemento.internal.id\="PRESENTATION_SHOW_LOGICAL_STRUCTURES"/>\r\n</PRESENTATION_CONTEXT_PROPERTIES>\r\n</VariablesViewMemento>
|
||||
preferredDetailPanes=NumberFormatPane\:NumberFormatPane|DefaultDetailPane\:DefaultDetailPane|
|
||||
preferredTargets=org.eclipse.cdt.debug.ui.toggleCBreakpointTarget,org.eclipse.cdt.debug.ui.toggleCDynamicPrintfTarget\:org.eclipse.cdt.debug.ui.toggleCBreakpointTarget|
|
||||
|
|
|
@ -5,4 +5,3 @@ configDescList=org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:L476_ats_blink-m
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:L476_ats_blink-master\ Debug/activeLaunchMode=run
|
||||
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:L476_ats_blink-master\ Debug/activeLaunchTarget=null\:---
|
||||
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:RealOne\ Debug/activeLaunchMode=run
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
activeuserprofiles=DESKTOP-9AR6HHQ;Team
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.rse.systemtype.local.systemType.defaultUserId=camer
|
||||
useridperkey=DESKTOP-9AR6HHQ.Local\=camer;
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
eclipse.preferences.version=1
|
||||
overviewRuler_migration=migrated_3.1
|
|
@ -1,6 +0,0 @@
|
|||
PROBLEMS_FILTERS_MIGRATE=true
|
||||
TASKS_FILTERS_MIGRATE=true
|
||||
eclipse.preferences.version=1
|
||||
platformState=1604477333731
|
||||
quickStart=false
|
||||
tipsAndTricks=true
|
|
@ -1,4 +1,2 @@
|
|||
//org.eclipse.ui.commands/state/com.st.stm32cube.ide.mcu.buildanalyzer.showstate/org.eclipse.ui.commands.radioState=human
|
||||
//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
|
||||
UIActivities.org.eclipse.cdt.debug.dsfgdbActivity=true
|
||||
eclipse.preferences.version=1
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.debug.ui.SCOPED_SAVE_SELECTION_DIALOG">
|
||||
<item key="DIALOG_WIDTH" value="343"/>
|
||||
<item key="DIALOG_HEIGHT" value="434"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Segoe UI|9.0|0|WINDOWS|1|-15|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI"/>
|
||||
</section>
|
||||
<section name="org.eclipse.debug.ui.LAUNCH_CONFIGURATION_PROPERTIES_DIALOG_SECTION">
|
||||
<item key="DIALOG_WIDTH" value="883"/>
|
||||
<item key="DIALOG_HEIGHT" value="702"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Segoe UI|9.0|0|WINDOWS|1|-15|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI"/>
|
||||
</section>
|
||||
</section>
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<session version="1.0">
<refactoring comment="Delete resource 'L476_ats_blink-master'" deleteContents="false" description="Delete resource 'L476_ats_blink-master'" element1="/L476_ats_blink-master" flags="7" id="org.eclipse.ltk.core.refactoring.delete.resources" resources="1" stamp="1605514212142"/>
<refactoring comment="Delete resource 'L476_ats_blink-master'" deleteContents="true" description="Delete resource 'L476_ats_blink-master'" element1="/L476_ats_blink-master" flags="7" id="org.eclipse.ltk.core.refactoring.delete.resources" resources="1" stamp="1605597878223"/>
<refactoring comment="Delete resource 'RealOne'" deleteContents="false" description="Delete resource 'RealOne'" element1="/RealOne" flags="7" id="org.eclipse.ltk.core.refactoring.delete.resources" resources="1" stamp="1605601055463"/>
|
||||
<session version="1.0">
|
||||
<refactoring comment="Delete resource 'RealOne'" deleteContents="false" description="Delete resource 'RealOne'" element1="/RealOne" flags="7" id="org.eclipse.ltk.core.refactoring.delete.resources" resources="1" stamp="1605693456598"/>
|
||||
</session>
|
|
@ -1,3 +1 @@
|
|||
1605514212142 Delete resource 'L476_ats_blink-master'
|
||||
1605597878223 Delete resource 'L476_ats_blink-master'
|
||||
1605601055463 Delete resource 'RealOne'
|
||||
1605693456598 Delete resource 'RealOne'
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="RefactoringWizard.preview">
|
||||
<item key="width" value="600"/>
|
||||
<item key="height" value="400"/>
|
||||
</section>
|
||||
</section>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="SearchDialog">
|
||||
<item key="PREVIOUS_PAGE" value="org.eclipse.cdt.ui.pdomSearchPage"/>
|
||||
</section>
|
||||
<section name="Search">
|
||||
<list key="Search.processedPageIds">
|
||||
<item value="org.eclipse.rse.internal.files.ui.search.searchPage"/>
|
||||
<item value="org.eclipse.search.internal.ui.text.TextSearchPage"/>
|
||||
<item value="org.eclipse.cdt.ui.pdomSearchPage"/>
|
||||
</list>
|
||||
<list key="Search.enabledPageIds">
|
||||
<item value="org.eclipse.rse.internal.files.ui.search.searchPage"/>
|
||||
<item value="org.eclipse.search.internal.ui.text.TextSearchPage"/>
|
||||
<item value="org.eclipse.cdt.ui.pdomSearchPage"/>
|
||||
</list>
|
||||
</section>
|
||||
<section name="SearchDialog.ScopePart">
|
||||
<item key="scope" value="0"/>
|
||||
</section>
|
||||
<section name="DialogBounds_SearchDialog">
|
||||
<item key="DIALOG_X_ORIGIN" value="635"/>
|
||||
<item key="DIALOG_Y_ORIGIN" value="174"/>
|
||||
<item key="DIALOG_WIDTH" value="669"/>
|
||||
<item key="DIALOG_HEIGHT" value="525"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Segoe UI|9.0|0|WINDOWS|1|-15|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI"/>
|
||||
</section>
|
||||
</section>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="quick_assist_proposal_size">
|
||||
</section>
|
||||
</section>
|
|
@ -3,14 +3,4 @@
|
|||
<section name="ExternalProjectImportWizard">
|
||||
<item key="WizardProjectsImportPage.STORE_NESTED_PROJECTS" value="true"/>
|
||||
</section>
|
||||
<section name="SmartImportWizard">
|
||||
<item key="SmartImportRootWizardPage.STORE_HIDE_ALREADY_OPEN" value="false"/>
|
||||
<item key="SmartImportRootWizardPage.STORE_CLOSE_IMPORTED" value="false"/>
|
||||
<item key="SmartImportRootWizardPage.STORE_NESTED_PROJECTS" value="true"/>
|
||||
<item key="SmartImportRootWizardPage.STORE_CONFIGURE_NATURES" value="true"/>
|
||||
<list key="org.eclipse.ui.internal.wizards.datatransfer.SmartImportRootWizardPage.knownSources">
|
||||
<item value="C:\Users\camer\Desktop\LoPoSo\L476_ats_blink-master"/>
|
||||
<item value="C:\Users\camer\Desktop\LoPoSo\RealOne"/>
|
||||
</list>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.ui.texteditor.FindReplaceDialog">
|
||||
<item key="selection" value="RCC_BDCR_LSEON"/>
|
||||
<item key="wrap" value="true"/>
|
||||
<item key="casesensitive" value="false"/>
|
||||
<item key="wholeword" value="false"/>
|
||||
<item key="incremental" value="false"/>
|
||||
<item key="isRegEx" value="false"/>
|
||||
<list key="findhistory">
|
||||
<item value="RCC_BDCR_LSEON"/>
|
||||
</list>
|
||||
<list key="replacehistory">
|
||||
</list>
|
||||
</section>
|
||||
<section name="org.eclipse.ui.texteditor.FindReplaceDialog_dialogBounds">
|
||||
<item key="DIALOG_X_ORIGIN" value="1152"/>
|
||||
<item key="DIALOG_Y_ORIGIN" value="189"/>
|
||||
<item key="DIALOG_WIDTH" value="336"/>
|
||||
<item key="DIALOG_HEIGHT" value="454"/>
|
||||
<item key="DIALOG_FONT_NAME" value="1|Segoe UI|9.0|0|WINDOWS|1|-15|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI"/>
|
||||
</section>
|
||||
</section>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
<section name="org.eclipse.ui.internal.QuickAccess">
|
||||
<item key="dialogHeight" value="-1"/>
|
||||
<item key="dialogWidth" value="-1"/>
|
||||
<list key="orderedElements">
|
||||
</list>
|
||||
<list key="orderedProviders">
|
||||
</list>
|
||||
<list key="textEntries">
|
||||
</list>
|
||||
<list key="textArray">
|
||||
</list>
|
||||
</section>
|
||||
</section>
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workingSetManager>
|
||||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1604569598788_0" label="Window Working Set" name="Aggregate for window 1604569598788"/>
|
||||
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1605693396537_0" label="Window Working Set" name="Aggregate for window 1604569598788"/>
|
||||
</workingSetManager>
|
|
@ -1,3 +1,3 @@
|
|||
#Wed Nov 18 09:40:21 CET 2020
|
||||
#Wed Nov 18 10:56:27 CET 2020
|
||||
org.eclipse.core.runtime=2
|
||||
org.eclipse.platform=4.13.0.v20190916-1045
|
||||
|
|
|
@ -39,6 +39,7 @@ extern "C" {
|
|||
#include "stm32l4xx_ll_pwr.h"
|
||||
#include "stm32l4xx_ll_dma.h"
|
||||
#include "stm32l4xx_ll_gpio.h"
|
||||
#include "stm32l4xx_ll_rtc.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
@ -66,6 +67,9 @@ void SystemClock_Config_24M_LSE(void);
|
|||
void SystemClock_Config_24M_LSE_FL3_VS2(void);
|
||||
void SystemClock_Config_80M(void);
|
||||
void Init_LSE(void);
|
||||
void RTC_wakeup_init_from_standby_or_shutdown( int delay );
|
||||
void RTC_wakeup_init_from_stop( int delay );
|
||||
void RTC_WKUP_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
|
|
@ -62,8 +62,8 @@ int main(void)
|
|||
if (BLUE_BUTTON()){
|
||||
|
||||
expe ++;
|
||||
|
||||
if (expe > 4) expe = 1;
|
||||
blue_mode = 0;
|
||||
if (expe > 8) expe = 1;
|
||||
RTC->BKP0R = expe;
|
||||
}
|
||||
// }else{
|
||||
|
@ -72,15 +72,37 @@ int main(void)
|
|||
LL_PWR_DisableBkUpAccess();
|
||||
switch(expe){
|
||||
case 1:
|
||||
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_80M();
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 2:
|
||||
/* Configure the system clock */
|
||||
SystemClock_Config_24M_LSE();
|
||||
break;
|
||||
default: //case 3 to 8
|
||||
case 3:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_LPM_EnableSleep();
|
||||
break;
|
||||
case 4:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
case 5:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP0);
|
||||
break;
|
||||
case 6:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP1);
|
||||
break;
|
||||
case 7:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
|
||||
break;
|
||||
case 8:
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -89,26 +111,41 @@ int main(void)
|
|||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
|
||||
//Setup Sleep mode
|
||||
LL_LPM_EnableSleep();
|
||||
|
||||
//LL_LPM_EnableSleepOnExit();
|
||||
|
||||
while (1) {
|
||||
if (blue_mode){
|
||||
switch(expe){
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_stop(20);
|
||||
__WFI();
|
||||
blue_mode = 0;
|
||||
|
||||
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||
LL_Init1msTick( SystemCoreClock );
|
||||
LL_SYSTICK_EnableIT();
|
||||
break;
|
||||
case 8:
|
||||
LL_LPM_EnableDeepSleep();
|
||||
RTC_wakeup_init_from_standby_or_shutdown(10);
|
||||
case 1:
|
||||
case 3:
|
||||
__WFI();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 4:
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
if (expe > 4) {
|
||||
LL_LPM_EnableSleep();
|
||||
__WFI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/main.h \
|
|||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_pwr.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_dma.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_gpio.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h \
|
||||
../Core/Inc/../Src/gpio.h ../Core/Src/gpio.h
|
||||
|
||||
../Core/Inc/main.h:
|
||||
|
@ -117,6 +118,8 @@ Core/Src/main.o: ../Core/Src/main.c ../Core/Inc/main.h \
|
|||
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_gpio.h:
|
||||
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h:
|
||||
|
||||
../Core/Inc/../Src/gpio.h:
|
||||
|
||||
../Core/Src/gpio.h:
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,55 @@
|
|||
core_cm4.h:1679:22:__NVIC_EnableIRQ 16 static,ignoring_inline_asm
|
||||
core_cm4.h:1809:22:__NVIC_SetPriority 16 static
|
||||
stm32l4xx_ll_rcc.h:2270:22:LL_RCC_LSE_Enable 4 static
|
||||
stm32l4xx_ll_rcc.h:2316:22:LL_RCC_LSE_SetDriveCapability 16 static
|
||||
stm32l4xx_ll_rcc.h:2362:26:LL_RCC_LSE_IsReady 4 static
|
||||
stm32l4xx_ll_rcc.h:2489:22:LL_RCC_MSI_Enable 4 static
|
||||
stm32l4xx_ll_rcc.h:2509:26:LL_RCC_MSI_IsReady 4 static
|
||||
stm32l4xx_ll_rcc.h:2523:22:LL_RCC_MSI_EnablePLLMode 4 static
|
||||
stm32l4xx_ll_rcc.h:2548:22:LL_RCC_MSI_EnableRangeSelection 4 static
|
||||
stm32l4xx_ll_rcc.h:2581:22:LL_RCC_MSI_SetRange 16 static
|
||||
stm32l4xx_ll_rcc.h:2656:22:LL_RCC_MSI_SetCalibTrimming 16 static
|
||||
stm32l4xx_ll_rcc.h:2742:22:LL_RCC_SetSysClkSource 16 static
|
||||
stm32l4xx_ll_rcc.h:2756:26:LL_RCC_GetSysClkSource 4 static
|
||||
stm32l4xx_ll_rcc.h:2776:22:LL_RCC_SetAHBPrescaler 16 static
|
||||
stm32l4xx_ll_rcc.h:2792:22:LL_RCC_SetAPB1Prescaler 16 static
|
||||
stm32l4xx_ll_rcc.h:2808:22:LL_RCC_SetAPB2Prescaler 16 static
|
||||
stm32l4xx_ll_rcc.h:3650:22:LL_RCC_SetRTCClockSource 16 static
|
||||
stm32l4xx_ll_rcc.h:3674:22:LL_RCC_EnableRTC 4 static
|
||||
stm32l4xx_ll_rcc.h:3714:22:LL_RCC_ReleaseBackupDomainReset 4 static
|
||||
stm32l4xx_ll_rcc.h:3733:22:LL_RCC_PLL_Enable 4 static
|
||||
stm32l4xx_ll_rcc.h:3754:26:LL_RCC_PLL_IsReady 4 static
|
||||
stm32l4xx_ll_rcc.h:3800:22:LL_RCC_PLL_ConfigDomain_SYS 24 static
|
||||
stm32l4xx_ll_rcc.h:4178:22:LL_RCC_PLL_EnableDomain_SYS 4 static
|
||||
stm32l4xx_ll_bus.h:1089:22:LL_APB1_GRP1_EnableClock 24 static
|
||||
stm32l4xx_ll_system.h:1400:22:LL_FLASH_SetLatency 16 static
|
||||
stm32l4xx_ll_system.h:1428:26:LL_FLASH_GetLatency 4 static
|
||||
stm32l4xx_ll_exti.h:306:22:LL_EXTI_EnableIT_0_31 16 static
|
||||
stm32l4xx_ll_exti.h:739:22:LL_EXTI_EnableRisingTrig_0_31 16 static
|
||||
stm32l4xx_ll_exti.h:1299:22:LL_EXTI_ClearFlag_0_31 16 static
|
||||
stm32l4xx_ll_cortex.h:272:22:LL_SYSTICK_EnableIT 4 static
|
||||
stm32l4xx_ll_cortex.h:310:22:LL_LPM_EnableSleep 4 static
|
||||
stm32l4xx_ll_cortex.h:321:22:LL_LPM_EnableDeepSleep 4 static
|
||||
stm32l4xx_ll_pwr.h:344:22:LL_PWR_SetRegulVoltageScaling 16 static
|
||||
stm32l4xx_ll_pwr.h:398:22:LL_PWR_EnableBkUpAccess 4 static
|
||||
stm32l4xx_ll_pwr.h:408:22:LL_PWR_DisableBkUpAccess 4 static
|
||||
stm32l4xx_ll_pwr.h:434:22:LL_PWR_SetPowerMode 16 static
|
||||
stm32l4xx_ll_pwr.h:714:22:LL_PWR_EnableInternWU 4 static
|
||||
stm32l4xx_ll_rtc.h:1049:23:LL_RTC_EnableWriteProtection 16 static
|
||||
stm32l4xx_ll_rtc.h:1060:23:LL_RTC_DisableWriteProtection 16 static
|
||||
stm32l4xx_ll_rtc.h:2921:23:LL_RTC_WAKEUP_Enable 16 static
|
||||
stm32l4xx_ll_rtc.h:2933:23:LL_RTC_WAKEUP_Disable 16 static
|
||||
stm32l4xx_ll_rtc.h:2964:23:LL_RTC_WAKEUP_SetClock 16 static
|
||||
stm32l4xx_ll_rtc.h:2994:23:LL_RTC_WAKEUP_SetAutoReload 16 static
|
||||
stm32l4xx_ll_rtc.h:3452:23:LL_RTC_ClearFlag_WUT 16 static
|
||||
stm32l4xx_ll_rtc.h:3542:27:LL_RTC_IsActiveFlag_WUTW 16 static
|
||||
stm32l4xx_ll_rtc.h:3610:23:LL_RTC_EnableIT_WUT 16 static
|
||||
main.c:20:6:SysTick_Handler 8 static
|
||||
main.c:41:5:main 8 static,ignoring_inline_asm
|
||||
main.c:153:6:SystemClock_Config_24M_LSE_FL3_VS2 8 static
|
||||
main.c:221:6:SystemClock_Config_24M_LSE 8 static
|
||||
main.c:286:6:SystemClock_Config_80M 8 static
|
||||
main.c:332:13:RTC_wakeup_init 16 static
|
||||
main.c:350:6:RTC_wakeup_init_from_standby_or_shutdown 16 static
|
||||
main.c:361:6:RTC_wakeup_init_from_stop 16 static
|
||||
main.c:373:6:RTC_WKUP_IRQHandler 8 static
|
|
@ -37,6 +37,7 @@ Core/Src/stm32l4xx_hal_msp.o: ../Core/Src/stm32l4xx_hal_msp.c \
|
|||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_pwr.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_dma.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_gpio.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h \
|
||||
../Core/Inc/../Src/gpio.h
|
||||
|
||||
../Core/Inc/main.h:
|
||||
|
@ -117,4 +118,6 @@ Core/Src/stm32l4xx_hal_msp.o: ../Core/Src/stm32l4xx_hal_msp.c \
|
|||
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_gpio.h:
|
||||
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h:
|
||||
|
||||
../Core/Inc/../Src/gpio.h:
|
||||
|
|
Binary file not shown.
|
@ -37,6 +37,7 @@ Core/Src/stm32l4xx_it.o: ../Core/Src/stm32l4xx_it.c ../Core/Inc/main.h \
|
|||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_pwr.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_dma.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_gpio.h \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h \
|
||||
../Core/Inc/../Src/gpio.h ../Core/Inc/stm32l4xx_it.h
|
||||
|
||||
../Core/Inc/main.h:
|
||||
|
@ -117,6 +118,8 @@ Core/Src/stm32l4xx_it.o: ../Core/Src/stm32l4xx_it.c ../Core/Inc/main.h \
|
|||
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_gpio.h:
|
||||
|
||||
../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_ll_rtc.h:
|
||||
|
||||
../Core/Inc/../Src/gpio.h:
|
||||
|
||||
../Core/Inc/stm32l4xx_it.h:
|
||||
|
|
Binary file not shown.
|
@ -24,6 +24,7 @@ C_SRCS += \
|
|||
../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.c \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.c \
|
||||
../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.c
|
||||
|
||||
OBJS += \
|
||||
|
@ -47,6 +48,7 @@ OBJS += \
|
|||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.o \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.o \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.o \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.o \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||
|
||||
C_DEPS += \
|
||||
|
@ -70,6 +72,7 @@ C_DEPS += \
|
|||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.d \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.d \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.d \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.d \
|
||||
./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.d
|
||||
|
||||
|
||||
|
@ -114,6 +117,8 @@ Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.o: ../Drivers/STM32L4xx_HA
|
|||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 '-DHSE_VALUE=8000000' '-DMSI_VALUE=4000000' '-DLSI_VALUE=32000' '-DHSE_STARTUP_TIMEOUT=100' '-DHSI_VALUE=16000000' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DDATA_CACHE_ENABLE=1' -DUSE_HAL_DRIVER '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNALSAI2_CLOCK_VALUE=2097000' -DSTM32L476xx -DUSE_FULL_LL_DRIVER '-DEXTERNALSAI1_CLOCK_VALUE=2097000' '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.d" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@"
|
||||
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.o: ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.c
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 '-DHSE_VALUE=8000000' '-DMSI_VALUE=4000000' '-DLSI_VALUE=32000' '-DHSE_STARTUP_TIMEOUT=100' '-DHSI_VALUE=16000000' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DDATA_CACHE_ENABLE=1' -DUSE_HAL_DRIVER '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNALSAI2_CLOCK_VALUE=2097000' -DSTM32L476xx -DUSE_FULL_LL_DRIVER '-DEXTERNALSAI1_CLOCK_VALUE=2097000' '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.d" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@"
|
||||
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.o: ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.c
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 '-DHSE_VALUE=8000000' '-DMSI_VALUE=4000000' '-DLSI_VALUE=32000' '-DHSE_STARTUP_TIMEOUT=100' '-DHSI_VALUE=16000000' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DDATA_CACHE_ENABLE=1' -DUSE_HAL_DRIVER '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNALSAI2_CLOCK_VALUE=2097000' -DSTM32L476xx -DUSE_FULL_LL_DRIVER '-DEXTERNALSAI1_CLOCK_VALUE=2097000' '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.d" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@"
|
||||
Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o: ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.c
|
||||
arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 '-DHSE_VALUE=8000000' '-DMSI_VALUE=4000000' '-DLSI_VALUE=32000' '-DHSE_STARTUP_TIMEOUT=100' '-DHSI_VALUE=16000000' -DDEBUG '-DLSE_STARTUP_TIMEOUT=5000' '-DLSE_VALUE=32768' '-DDATA_CACHE_ENABLE=1' -DUSE_HAL_DRIVER '-DVDD_VALUE=3300' '-DINSTRUCTION_CACHE_ENABLE=1' '-DEXTERNALSAI2_CLOCK_VALUE=2097000' -DSTM32L476xx -DUSE_FULL_LL_DRIVER '-DEXTERNALSAI1_CLOCK_VALUE=2097000' '-DPREFETCH_ENABLE=0' -c -I../Core/Inc -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.d" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@"
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue