expe 3 and 4
This commit is contained in:
parent
5377134376
commit
f2830f7c22
67 changed files with 3433 additions and 7407 deletions
|
@ -391,3 +391,225 @@ java.lang.Exception: The project description file (.project) for 'L476_ats_blink
|
||||||
|
|
||||||
!ENTRY org.eclipse.cdt.core 1 0 2020-11-17 09:17:55.325
|
!ENTRY org.eclipse.cdt.core 1 0 2020-11-17 09:17:55.325
|
||||||
!MESSAGE Indexed 'RealOne' (28 sources, 118 headers) in 5.04 sec: 10,966 declarations; 53,931 references; 3 unresolved inclusions; 29 syntax errors; 171 unresolved names (0.26%)
|
!MESSAGE Indexed 'RealOne' (28 sources, 118 headers) in 5.04 sec: 10,966 declarations; 53,931 references; 3 unresolved inclusions; 29 syntax errors; 171 unresolved names (0.26%)
|
||||||
|
|
||||||
|
!ENTRY com.st.stm32cube.ide.mcu.debug.stlink 4 4 2020-11-17 10:27:45.878
|
||||||
|
!MESSAGE ST-LINK GDB server failed to start (exit code = 4)
|
||||||
|
|
||||||
|
!ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2020-11-17 10:27:45.903
|
||||||
|
!MESSAGE Error in final launch sequence:
|
||||||
|
|
||||||
|
Failed to start GDB server
|
||||||
|
!STACK 1
|
||||||
|
org.eclipse.core.runtime.CoreException: Failed to start GDB server
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Query.get(Query.java:112)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:242)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:106)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:94)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.DSFDelegate.launch(DSFDelegate.java:297)
|
||||||
|
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:860)
|
||||||
|
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:719)
|
||||||
|
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1017)
|
||||||
|
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1220)
|
||||||
|
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
|
||||||
|
Caused by: org.eclipse.core.runtime.CoreException: Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.stlink.StLinkDebugHardware.verifyServer(StLinkDebugHardware.java:1685)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:159)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:79)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.LaunchSequenceUtil.stepStartGDBServer(LaunchSequenceUtil.java:226)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.GDBExtendedJtagDSFFinalLaunchSequence_7_12.stepStartGDBServer(GDBExtendedJtagDSFFinalLaunchSequence_7_12.java:100)
|
||||||
|
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.cdt.dsf.concurrent.ReflectionSequence$ReflectionStep.execute(ReflectionSequence.java:160)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:475)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:390)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:437)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:391)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:317)
|
||||||
|
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||||
|
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||||
|
at java.lang.Thread.run(Thread.java:748)
|
||||||
|
!SUBENTRY 1 com.st.stm32cube.ide.mcu.debug.launch 4 0 2020-11-17 10:27:45.903
|
||||||
|
!MESSAGE Failed to start GDB server
|
||||||
|
!STACK 1
|
||||||
|
org.eclipse.core.runtime.CoreException: Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.stlink.StLinkDebugHardware.verifyServer(StLinkDebugHardware.java:1685)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:159)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:79)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.LaunchSequenceUtil.stepStartGDBServer(LaunchSequenceUtil.java:226)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.GDBExtendedJtagDSFFinalLaunchSequence_7_12.stepStartGDBServer(GDBExtendedJtagDSFFinalLaunchSequence_7_12.java:100)
|
||||||
|
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.cdt.dsf.concurrent.ReflectionSequence$ReflectionStep.execute(ReflectionSequence.java:160)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:475)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:390)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:437)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:391)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:317)
|
||||||
|
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||||
|
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||||
|
at java.lang.Thread.run(Thread.java:748)
|
||||||
|
!SUBENTRY 2 com.st.stm32cube.ide.mcu.debug.stlink 4 0 2020-11-17 10:27:45.904
|
||||||
|
!MESSAGE Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
|
||||||
|
!ENTRY com.st.stm32cube.ide.mcu.debug.stlink 4 4 2020-11-17 10:28:10.382
|
||||||
|
!MESSAGE ST-LINK GDB server failed to start (exit code = 4)
|
||||||
|
|
||||||
|
!ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2020-11-17 10:28:10.412
|
||||||
|
!MESSAGE Error in final launch sequence:
|
||||||
|
|
||||||
|
Failed to start GDB server
|
||||||
|
!STACK 1
|
||||||
|
org.eclipse.core.runtime.CoreException: Failed to start GDB server
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Query.get(Query.java:112)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:242)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:106)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:94)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.DSFDelegate.launch(DSFDelegate.java:297)
|
||||||
|
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:860)
|
||||||
|
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:719)
|
||||||
|
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1017)
|
||||||
|
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1220)
|
||||||
|
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
|
||||||
|
Caused by: org.eclipse.core.runtime.CoreException: Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.stlink.StLinkDebugHardware.verifyServer(StLinkDebugHardware.java:1685)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:159)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:79)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.LaunchSequenceUtil.stepStartGDBServer(LaunchSequenceUtil.java:226)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.GDBExtendedJtagDSFFinalLaunchSequence_7_12.stepStartGDBServer(GDBExtendedJtagDSFFinalLaunchSequence_7_12.java:100)
|
||||||
|
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.cdt.dsf.concurrent.ReflectionSequence$ReflectionStep.execute(ReflectionSequence.java:160)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:475)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:390)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:437)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:391)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:317)
|
||||||
|
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||||
|
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||||
|
at java.lang.Thread.run(Thread.java:748)
|
||||||
|
!SUBENTRY 1 com.st.stm32cube.ide.mcu.debug.launch 4 0 2020-11-17 10:28:10.412
|
||||||
|
!MESSAGE Failed to start GDB server
|
||||||
|
!STACK 1
|
||||||
|
org.eclipse.core.runtime.CoreException: Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.stlink.StLinkDebugHardware.verifyServer(StLinkDebugHardware.java:1685)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:159)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:79)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.LaunchSequenceUtil.stepStartGDBServer(LaunchSequenceUtil.java:226)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.GDBExtendedJtagDSFFinalLaunchSequence_7_12.stepStartGDBServer(GDBExtendedJtagDSFFinalLaunchSequence_7_12.java:100)
|
||||||
|
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.cdt.dsf.concurrent.ReflectionSequence$ReflectionStep.execute(ReflectionSequence.java:160)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:475)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:390)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:437)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:391)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:317)
|
||||||
|
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||||
|
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||||
|
at java.lang.Thread.run(Thread.java:748)
|
||||||
|
!SUBENTRY 2 com.st.stm32cube.ide.mcu.debug.stlink 4 0 2020-11-17 10:28:10.413
|
||||||
|
!MESSAGE Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
|
||||||
|
!ENTRY com.st.stm32cube.ide.mcu.debug.stlink 4 4 2020-11-17 10:28:24.113
|
||||||
|
!MESSAGE ST-LINK GDB server failed to start (exit code = 4)
|
||||||
|
|
||||||
|
!ENTRY org.eclipse.cdt.dsf.gdb 4 5012 2020-11-17 10:28:24.145
|
||||||
|
!MESSAGE Error in final launch sequence:
|
||||||
|
|
||||||
|
Failed to start GDB server
|
||||||
|
!STACK 1
|
||||||
|
org.eclipse.core.runtime.CoreException: Failed to start GDB server
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Query.get(Query.java:112)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:242)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:106)
|
||||||
|
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:94)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.DSFDelegate.launch(DSFDelegate.java:297)
|
||||||
|
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:860)
|
||||||
|
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:719)
|
||||||
|
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1017)
|
||||||
|
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1220)
|
||||||
|
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
|
||||||
|
Caused by: org.eclipse.core.runtime.CoreException: Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.stlink.StLinkDebugHardware.verifyServer(StLinkDebugHardware.java:1685)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:159)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:79)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.LaunchSequenceUtil.stepStartGDBServer(LaunchSequenceUtil.java:226)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.GDBExtendedJtagDSFFinalLaunchSequence_7_12.stepStartGDBServer(GDBExtendedJtagDSFFinalLaunchSequence_7_12.java:100)
|
||||||
|
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.cdt.dsf.concurrent.ReflectionSequence$ReflectionStep.execute(ReflectionSequence.java:160)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:475)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:390)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:437)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:391)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:317)
|
||||||
|
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||||
|
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||||
|
at java.lang.Thread.run(Thread.java:748)
|
||||||
|
!SUBENTRY 1 com.st.stm32cube.ide.mcu.debug.launch 4 0 2020-11-17 10:28:24.145
|
||||||
|
!MESSAGE Failed to start GDB server
|
||||||
|
!STACK 1
|
||||||
|
org.eclipse.core.runtime.CoreException: Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.stlink.StLinkDebugHardware.verifyServer(StLinkDebugHardware.java:1685)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:159)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.export.HardwareDebugUtil.startServer(HardwareDebugUtil.java:79)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.LaunchSequenceUtil.stepStartGDBServer(LaunchSequenceUtil.java:226)
|
||||||
|
at com.st.stm32cube.ide.mcu.debug.launch.GDBExtendedJtagDSFFinalLaunchSequence_7_12.stepStartGDBServer(GDBExtendedJtagDSFFinalLaunchSequence_7_12.java:100)
|
||||||
|
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.cdt.dsf.concurrent.ReflectionSequence$ReflectionStep.execute(ReflectionSequence.java:160)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:475)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:390)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:437)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:391)
|
||||||
|
at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:317)
|
||||||
|
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||||
|
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||||
|
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||||
|
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||||
|
at java.lang.Thread.run(Thread.java:748)
|
||||||
|
!SUBENTRY 2 com.st.stm32cube.ide.mcu.debug.stlink 4 0 2020-11-17 10:28:24.145
|
||||||
|
!MESSAGE Error in initializing ST-LINK device.
|
||||||
|
Reason: (4) No device found on target.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
NUMBER_FORMAT=0
|
|
@ -1,2 +1,3 @@
|
||||||
*** SESSION Nov 05, 2020 10:46:36.34 -------------------------------------------
|
*** SESSION Nov 05, 2020 10:46:36.34 -------------------------------------------
|
||||||
*** SESSION Nov 16, 2020 08:11:47.28 -------------------------------------------
|
*** SESSION Nov 16, 2020 08:11:47.28 -------------------------------------------
|
||||||
|
*** SESSION Nov 17, 2020 08:14:51.13 -------------------------------------------
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,9 @@
|
||||||
|
<?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,10 +1,10 @@
|
||||||
10:09:39 **** Incremental Build of configuration Debug for project RealOne ****
|
10:38:01 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
make -j8 all
|
make -j8 all
|
||||||
arm-none-eabi-size RealOne.elf
|
arm-none-eabi-size RealOne.elf
|
||||||
text data bss dec hex filename
|
text data bss dec hex filename
|
||||||
3748 20 1572 5340 14dc RealOne.elf
|
3988 20 1572 5580 15cc RealOne.elf
|
||||||
Finished building: default.size.stdout
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
|
||||||
10:09:39 Build Finished. 0 errors, 0 warnings. (took 338ms)
|
10:38:01 Build Finished. 0 errors, 0 warnings. (took 315ms)
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,6 @@
|
||||||
<item key="size.width" value="586"/>
|
<item key="size.width" value="586"/>
|
||||||
<item key="size.height" value="180"/>
|
<item key="size.height" value="180"/>
|
||||||
</section>
|
</section>
|
||||||
|
<section name="PDOMSearchPage">
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -575,3 +575,193 @@ arm-none-eabi-size RealOne.elf
|
||||||
3748 20 1572 5340 14dc RealOne.elf
|
3748 20 1572 5340 14dc RealOne.elf
|
||||||
Finished building: default.size.stdout
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
10:26:55 **** 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"
|
||||||
|
arm-none-eabi-gcc "../Core/Src/stm32l4xx_hal_msp.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/stm32l4xx_hal_msp.d" -MT"Core/Src/stm32l4xx_hal_msp.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/stm32l4xx_hal_msp.o"
|
||||||
|
arm-none-eabi-gcc "../Core/Src/stm32l4xx_it.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/stm32l4xx_it.d" -MT"Core/Src/stm32l4xx_it.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Core/Src/stm32l4xx_it.o"
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:183:0: warning: "VDD_VALUE" redefined
|
||||||
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:186:0: warning: "PREFETCH_ENABLE" redefined
|
||||||
|
#define PREFETCH_ENABLE 0U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:187:0: warning: "INSTRUCTION_CACHE_ENABLE" redefined
|
||||||
|
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_hal_msp.c:23:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:183:0: warning: "VDD_VALUE" redefined
|
||||||
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
|
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_it.c:22:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:183:0: warning: "VDD_VALUE" redefined
|
||||||
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:188:0: warning: "DATA_CACHE_ENABLE" redefined
|
||||||
|
#define DATA_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_hal_msp.c:23:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:186:0: warning: "PREFETCH_ENABLE" redefined
|
||||||
|
#define PREFETCH_ENABLE 0U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_it.c:22:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:186:0: warning: "PREFETCH_ENABLE" redefined
|
||||||
|
#define PREFETCH_ENABLE 0U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_hal_msp.c:23:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:187:0: warning: "INSTRUCTION_CACHE_ENABLE" redefined
|
||||||
|
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_it.c:22:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:187:0: warning: "INSTRUCTION_CACHE_ENABLE" redefined
|
||||||
|
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_it.c:22:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:188:0: warning: "DATA_CACHE_ENABLE" redefined
|
||||||
|
#define DATA_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/stm32l4xx_hal_msp.c:23:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:188:0: warning: "DATA_CACHE_ENABLE" redefined
|
||||||
|
#define DATA_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
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
|
||||||
|
3976 20 1572 5568 15c0 RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
Finished building: RealOne.bin
|
||||||
|
|
||||||
|
Finished building: RealOne.list
|
||||||
|
|
||||||
|
10:27:43 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
|
make -j8 all
|
||||||
|
arm-none-eabi-size RealOne.elf
|
||||||
|
text data bss dec hex filename
|
||||||
|
3976 20 1572 5568 15c0 RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
10:28:07 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
|
make -j8 all
|
||||||
|
arm-none-eabi-size RealOne.elf
|
||||||
|
text data bss dec hex filename
|
||||||
|
3976 20 1572 5568 15c0 RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
10:28:17 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
|
make -j8 all
|
||||||
|
arm-none-eabi-size RealOne.elf
|
||||||
|
text data bss dec hex filename
|
||||||
|
3976 20 1572 5568 15c0 RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
10:28:21 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
|
make -j8 all
|
||||||
|
arm-none-eabi-size RealOne.elf
|
||||||
|
text data bss dec hex filename
|
||||||
|
3976 20 1572 5568 15c0 RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
10:28:38 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
|
make -j8 all
|
||||||
|
arm-none-eabi-size RealOne.elf
|
||||||
|
text data bss dec hex filename
|
||||||
|
3976 20 1572 5568 15c0 RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
10:34:31 **** 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,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:183:0: warning: "VDD_VALUE" redefined
|
||||||
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:186:0: warning: "PREFETCH_ENABLE" redefined
|
||||||
|
#define PREFETCH_ENABLE 0U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:187:0: warning: "INSTRUCTION_CACHE_ENABLE" redefined
|
||||||
|
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
In file included from ../Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal.h:30:0,
|
||||||
|
from ../Core/Inc/main.h:31,
|
||||||
|
from ../Core/Src/main.c:8:
|
||||||
|
../Core/Inc/stm32l4xx_hal_conf.h:188:0: warning: "DATA_CACHE_ENABLE" redefined
|
||||||
|
#define DATA_CACHE_ENABLE 1U
|
||||||
|
|
||||||
|
<command-line>:0:0: note: this is the location of the previous definition
|
||||||
|
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
|
||||||
|
3988 20 1572 5580 15cc RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
Finished building: RealOne.bin
|
||||||
|
Finished building: RealOne.list
|
||||||
|
|
||||||
|
|
||||||
|
10:38:01 **** Incremental Build of configuration Debug for project RealOne ****
|
||||||
|
make -j8 all
|
||||||
|
arm-none-eabi-size RealOne.elf
|
||||||
|
text data bss dec hex filename
|
||||||
|
3988 20 1572 5580 15cc RealOne.elf
|
||||||
|
Finished building: default.size.stdout
|
||||||
|
|
||||||
|
|
|
@ -1,143 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
if(expe == 2){
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
//void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,219 +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{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Init_LSE(void){
|
|
||||||
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_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
// LL_RCC_MSI_EnablePLLMode();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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,214 +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_24_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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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,214 +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(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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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,214 +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_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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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,117 +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 "stm32l4xx_ll_bus.h"
|
|
||||||
#include "stm32l4xx_ll_rcc.h"
|
|
||||||
#include "stm32l4xx_ll_system.h"
|
|
||||||
#include "stm32l4xx_ll_utils.h"
|
|
||||||
#include "stm32l4xx_ll_gpio.h"
|
|
||||||
#include "stm32l4xx_ll_cortex.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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
//void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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){
|
|
||||||
__WFI();
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* The system Clock is configured as follows :
|
|
||||||
* System Clock source = PLL (MSI)
|
|
||||||
* SYSCLK(Hz) = 80000000
|
|
||||||
* HCLK(Hz) = 80000000
|
|
||||||
* AHB Prescaler = 1
|
|
||||||
* APB1 Prescaler = 1
|
|
||||||
* APB2 Prescaler = 1
|
|
||||||
* MSI Frequency(Hz) = 4000000
|
|
||||||
* PLL_M = 1
|
|
||||||
* PLL_N = 40
|
|
||||||
* PLL_R = 2
|
|
||||||
* Flash Latency(WS) = 4
|
|
||||||
* @param None
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(void) {
|
|
||||||
/* MSI configuration and activation */
|
|
||||||
LL_FLASH_SetLatency(LL_FLASH_LATENCY_4);
|
|
||||||
LL_RCC_MSI_Enable();
|
|
||||||
while (LL_RCC_MSI_IsReady() != 1)
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/* Main PLL configuration and activation */
|
|
||||||
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
|
|
||||||
LL_RCC_PLL_Enable();
|
|
||||||
LL_RCC_PLL_EnableDomain_SYS();
|
|
||||||
while(LL_RCC_PLL_IsReady() != 1)
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/* Sysclk activation on the main PLL */
|
|
||||||
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
|
|
||||||
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
|
|
||||||
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
|
|
||||||
{ };
|
|
||||||
|
|
||||||
/* Set APB1 & APB2 prescaler*/
|
|
||||||
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
|
|
||||||
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
|
|
||||||
|
|
||||||
/* Update the global variable called SystemCoreClock */
|
|
||||||
SystemCoreClockUpdate();
|
|
||||||
}
|
|
|
@ -1,132 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
//void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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){
|
|
||||||
__WFI();
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,142 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
if(expe == 2){
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,132 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
//void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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){
|
|
||||||
__WFI();
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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 = 1;
|
|
||||||
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){
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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 = 1;
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,203 +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)
|
|
||||||
{
|
|
||||||
//expe = register RTC
|
|
||||||
if (expe == 0){
|
|
||||||
expe = 1;
|
|
||||||
//save RTC
|
|
||||||
}else if (expe != 0 && BLUE_BUTTON()){
|
|
||||||
expe ++;
|
|
||||||
//save RTC
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,137 +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 "stm32l4xx_ll_bus.h"
|
|
||||||
#include "stm32l4xx_ll_rcc.h"
|
|
||||||
#include "stm32l4xx_ll_system.h"
|
|
||||||
#include "stm32l4xx_ll_utils.h"
|
|
||||||
#include "stm32l4xx_ll_gpio.h"
|
|
||||||
#include "stm32l4xx_ll_cortex.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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
//void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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){
|
|
||||||
__WFI();
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,219 +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{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Init_LSE(void){
|
|
||||||
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_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
// LL_RCC_MSI_EnablePLLMode();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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,81 +0,0 @@
|
||||||
/* 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"
|
|
||||||
|
|
||||||
/* Private includes ----------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN Includes */
|
|
||||||
|
|
||||||
/* 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);
|
|
||||||
|
|
||||||
/* 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****/
|
|
|
@ -1,81 +0,0 @@
|
||||||
/* 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"
|
|
||||||
|
|
||||||
/* Private includes ----------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN Includes */
|
|
||||||
#include "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);
|
|
||||||
|
|
||||||
/* 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****/
|
|
|
@ -1,221 +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{
|
|
||||||
Init_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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,214 +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_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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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,223 +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{
|
|
||||||
Init_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Init_LSE(void){
|
|
||||||
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_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
// LL_RCC_MSI_EnablePLLMode();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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,203 +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)
|
|
||||||
{
|
|
||||||
//expe = register RTC
|
|
||||||
if (expe == 0){
|
|
||||||
expe = 1;
|
|
||||||
//save RTC
|
|
||||||
}else if (expe /= 0 && BLUE_BUTTON()){
|
|
||||||
expe ++;
|
|
||||||
//save RTC
|
|
||||||
}
|
|
||||||
|
|
||||||
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,221 @@
|
||||||
|
/* 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 (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 > 2) expe = 1;
|
||||||
|
RTC->BKP0R = expe;
|
||||||
|
}
|
||||||
|
// }else{
|
||||||
|
|
||||||
|
// }
|
||||||
|
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,204 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
if(expe == 2){
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
//expe = register RTC
|
|
||||||
if (expe == 0){
|
|
||||||
expe = 1;
|
|
||||||
//save RTC
|
|
||||||
}else if (expe /= 0 && BLUE_BUTTON()){
|
|
||||||
expe ++;
|
|
||||||
//save RTC
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,204 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
if(expe == 2){
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
//expe = registre RTC
|
|
||||||
//if expe == 0 => expe = 1 storer dans RTC
|
|
||||||
//if expe /= 0 and BLUE_BUTTON() expe ++ and save RTC
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
/* 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"
|
|
||||||
|
|
||||||
/* 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);
|
|
||||||
|
|
||||||
/* 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****/
|
|
|
@ -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 (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,292 @@
|
||||||
|
/* 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 (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 > 4) expe = 1;
|
||||||
|
RTC->BKP0R = expe;
|
||||||
|
}
|
||||||
|
// }else{
|
||||||
|
|
||||||
|
// }
|
||||||
|
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;
|
||||||
|
default: //case 3 to 8
|
||||||
|
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||||
|
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:
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,203 +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)
|
|
||||||
{
|
|
||||||
//expe = register RTC
|
|
||||||
if (expe == 0){
|
|
||||||
expe = 1;
|
|
||||||
//save RTC
|
|
||||||
}else if (expe /= 0 && BLUE_BUTTON()){
|
|
||||||
expe ++;
|
|
||||||
//save RTC
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,143 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
if(expe == 2){
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,252 +0,0 @@
|
||||||
/* USER CODE BEGIN Header */
|
|
||||||
/**
|
|
||||||
******************************************************************************
|
|
||||||
* @file : main.c
|
|
||||||
* @brief : Main program body
|
|
||||||
******************************************************************************
|
|
||||||
* @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 */
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
|
||||||
#include "main.h"
|
|
||||||
|
|
||||||
/* Private includes ----------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN Includes */
|
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN PTD */
|
|
||||||
|
|
||||||
/* USER CODE END PTD */
|
|
||||||
|
|
||||||
/* Private define ------------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN PD */
|
|
||||||
/* USER CODE END PD */
|
|
||||||
|
|
||||||
/* Private macro -------------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN PM */
|
|
||||||
|
|
||||||
/* USER CODE END PM */
|
|
||||||
|
|
||||||
/* Private variables ---------------------------------------------------------*/
|
|
||||||
RTC_HandleTypeDef hrtc;
|
|
||||||
|
|
||||||
/* USER CODE BEGIN PV */
|
|
||||||
|
|
||||||
/* USER CODE END PV */
|
|
||||||
|
|
||||||
/* Private function prototypes -----------------------------------------------*/
|
|
||||||
void SystemClock_Config(void);
|
|
||||||
static void MX_GPIO_Init(void);
|
|
||||||
static void MX_RTC_Init(void);
|
|
||||||
/* USER CODE BEGIN PFP */
|
|
||||||
|
|
||||||
/* USER CODE END PFP */
|
|
||||||
|
|
||||||
/* Private user code ---------------------------------------------------------*/
|
|
||||||
/* USER CODE BEGIN 0 */
|
|
||||||
|
|
||||||
/* USER CODE END 0 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief The application entry point.
|
|
||||||
* @retval int
|
|
||||||
*/
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN 1 */
|
|
||||||
|
|
||||||
/* USER CODE END 1 */
|
|
||||||
|
|
||||||
/* MCU Configuration--------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
|
||||||
HAL_Init();
|
|
||||||
|
|
||||||
/* USER CODE BEGIN Init */
|
|
||||||
|
|
||||||
/* USER CODE END Init */
|
|
||||||
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
/* USER CODE BEGIN SysInit */
|
|
||||||
|
|
||||||
/* USER CODE END SysInit */
|
|
||||||
|
|
||||||
/* Initialize all configured peripherals */
|
|
||||||
MX_GPIO_Init();
|
|
||||||
MX_RTC_Init();
|
|
||||||
/* USER CODE BEGIN 2 */
|
|
||||||
|
|
||||||
/* USER CODE END 2 */
|
|
||||||
|
|
||||||
/* Infinite loop */
|
|
||||||
/* USER CODE BEGIN WHILE */
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
/* USER CODE END WHILE */
|
|
||||||
|
|
||||||
/* USER CODE BEGIN 3 */
|
|
||||||
}
|
|
||||||
/* USER CODE END 3 */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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_MSI_EnablePLLMode();
|
|
||||||
LL_RCC_MSI_EnableRangeSelection();
|
|
||||||
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
|
|
||||||
LL_RCC_MSI_SetCalibTrimming(0);
|
|
||||||
LL_PWR_EnableBkUpAccess();
|
|
||||||
LL_RCC_ForceBackupDomainReset();
|
|
||||||
LL_RCC_ReleaseBackupDomainReset();
|
|
||||||
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
|
|
||||||
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 RTC Initialization Function
|
|
||||||
* @param None
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
static void MX_RTC_Init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* USER CODE BEGIN RTC_Init 0 */
|
|
||||||
|
|
||||||
/* USER CODE END RTC_Init 0 */
|
|
||||||
|
|
||||||
/* USER CODE BEGIN RTC_Init 1 */
|
|
||||||
|
|
||||||
/* USER CODE END RTC_Init 1 */
|
|
||||||
/** Initialize RTC Only
|
|
||||||
*/
|
|
||||||
hrtc.Instance = RTC;
|
|
||||||
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
|
|
||||||
hrtc.Init.AsynchPrediv = 127;
|
|
||||||
hrtc.Init.SynchPrediv = 255;
|
|
||||||
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
|
|
||||||
hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
|
|
||||||
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
|
|
||||||
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
|
|
||||||
if (HAL_RTC_Init(&hrtc) != HAL_OK)
|
|
||||||
{
|
|
||||||
Error_Handler();
|
|
||||||
}
|
|
||||||
/* USER CODE BEGIN RTC_Init 2 */
|
|
||||||
|
|
||||||
/* USER CODE END RTC_Init 2 */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief GPIO Initialization Function
|
|
||||||
* @param None
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
static void MX_GPIO_Init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* GPIO Ports Clock Enable */
|
|
||||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
|
||||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
|
||||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* USER CODE BEGIN 4 */
|
|
||||||
|
|
||||||
/* USER CODE END 4 */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief This function is executed in case of error occurrence.
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
void Error_Handler(void)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN Error_Handler_Debug */
|
|
||||||
/* User can add his own implementation to report the HAL error return state */
|
|
||||||
|
|
||||||
/* USER CODE END Error_Handler_Debug */
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_FULL_ASSERT
|
|
||||||
/**
|
|
||||||
* @brief Reports the name of the source file and the source line number
|
|
||||||
* where the assert_param error has occurred.
|
|
||||||
* @param file: pointer to the source file name
|
|
||||||
* @param line: assert_param error line source number
|
|
||||||
* @retval None
|
|
||||||
*/
|
|
||||||
void assert_failed(uint8_t *file, uint32_t line)
|
|
||||||
{
|
|
||||||
/* USER CODE BEGIN 6 */
|
|
||||||
/* User can add his own implementation to report the file name and line number,
|
|
||||||
tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
|
||||||
/* USER CODE END 6 */
|
|
||||||
}
|
|
||||||
#endif /* USE_FULL_ASSERT */
|
|
||||||
|
|
||||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
|
|
@ -64,6 +64,7 @@ extern "C" {
|
||||||
void Error_Handler(void);
|
void Error_Handler(void);
|
||||||
void SystemClock_Config_24M_LSE(void);
|
void SystemClock_Config_24M_LSE(void);
|
||||||
void SystemClock_Config_80M(void);
|
void SystemClock_Config_80M(void);
|
||||||
|
void Init_LSE(void);
|
||||||
/* USER CODE BEGIN EFP */
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
/* USER CODE END EFP */
|
/* USER CODE END EFP */
|
|
@ -1,221 +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_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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,143 +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){
|
|
||||||
LED_GREEN(0);
|
|
||||||
}else if(msTicks >= 200){
|
|
||||||
msTicks = 0;
|
|
||||||
LED_GREEN(1);
|
|
||||||
}
|
|
||||||
if(expe == 2){
|
|
||||||
CLK_TOGGLE();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SystemClock_Config(void);
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* Configure the system clock */
|
|
||||||
SystemClock_Config();
|
|
||||||
|
|
||||||
// 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:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// else {
|
|
||||||
// LED_GREEN(0);
|
|
||||||
// LL_mDelay(950);
|
|
||||||
// LED_GREEN(1);
|
|
||||||
// LL_mDelay(50);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
/**
|
|
||||||
* @brief System Clock Configuration
|
|
||||||
* @retval None
|
|
||||||
* 24Mhz + RTC + LSE
|
|
||||||
*/
|
|
||||||
void SystemClock_Config(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();
|
|
||||||
}
|
|
||||||
}
|
|
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.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,7 @@
|
||||||
|
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
|
|
@ -4,4 +4,4 @@
|
||||||
//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.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,;
|
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.remoteApplicationLaunchType=org.eclipse.rse.remotecdt.dsf.debug,debug,;
|
||||||
eclipse.preferences.version=1
|
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\="RCC->BDCR"/>\r\n<expression enabled\="true" text\="blue_mode"/>\r\n<expression enabled\="true" text\="RTC->BKP0R"/>\r\n</watchExpressions>\r\n
|
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
|
||||||
|
|
|
@ -5,4 +5,4 @@ configDescList=org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:L476_ats_blink-m
|
||||||
eclipse.preferences.version=1
|
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/activeLaunchMode=run
|
||||||
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:L476_ats_blink-master\ Debug/activeLaunchTarget=null\:---
|
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:L476_ats_blink-master\ Debug/activeLaunchTarget=null\:---
|
||||||
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:RealOne\ Debug/activeLaunchMode=debug
|
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:RealOne\ Debug/activeLaunchMode=run
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,28 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?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>
|
|
@ -63,6 +63,7 @@ extern "C" {
|
||||||
/* Exported functions prototypes ---------------------------------------------*/
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
void Error_Handler(void);
|
void Error_Handler(void);
|
||||||
void SystemClock_Config_24M_LSE(void);
|
void SystemClock_Config_24M_LSE(void);
|
||||||
|
void SystemClock_Config_24M_LSE_FL3_VS2(void);
|
||||||
void SystemClock_Config_80M(void);
|
void SystemClock_Config_80M(void);
|
||||||
void Init_LSE(void);
|
void Init_LSE(void);
|
||||||
/* USER CODE BEGIN EFP */
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
|
@ -30,7 +30,7 @@ void SysTick_Handler()
|
||||||
msTicks = 0;
|
msTicks = 0;
|
||||||
LED_GREEN(1);
|
LED_GREEN(1);
|
||||||
}
|
}
|
||||||
if(expe == 2){
|
if(expe == 2 || expe == 4){
|
||||||
CLK_TOGGLE();
|
CLK_TOGGLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ int main(void)
|
||||||
|
|
||||||
expe ++;
|
expe ++;
|
||||||
|
|
||||||
if (expe > 2) expe = 1;
|
if (expe > 4) expe = 1;
|
||||||
RTC->BKP0R = expe;
|
RTC->BKP0R = expe;
|
||||||
}
|
}
|
||||||
// }else{
|
// }else{
|
||||||
|
@ -79,6 +79,9 @@ int main(void)
|
||||||
/* Configure the system clock */
|
/* Configure the system clock */
|
||||||
SystemClock_Config_24M_LSE();
|
SystemClock_Config_24M_LSE();
|
||||||
break;
|
break;
|
||||||
|
default: //case 3 to 8
|
||||||
|
SystemClock_Config_24M_LSE_FL3_VS2();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,17 +97,85 @@ int main(void)
|
||||||
if (blue_mode){
|
if (blue_mode){
|
||||||
switch(expe){
|
switch(expe){
|
||||||
case 1:
|
case 1:
|
||||||
|
case 3:
|
||||||
__WFI();
|
__WFI();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
|
case 4:
|
||||||
LL_RCC_MSI_EnablePLLMode();
|
LL_RCC_MSI_EnablePLLMode();
|
||||||
break;
|
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
|
* @brief System Clock Configuration
|
||||||
* @retval None
|
* @retval None
|
||||||
|
|
Binary file not shown.
|
@ -29,5 +29,6 @@ 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:408:22:LL_PWR_DisableBkUpAccess 4 static
|
||||||
main.c:20:6:SysTick_Handler 8 static
|
main.c:20:6:SysTick_Handler 8 static
|
||||||
main.c:41:5:main 8 static,ignoring_inline_asm
|
main.c:41:5:main 8 static,ignoring_inline_asm
|
||||||
main.c:113:6:SystemClock_Config_24M_LSE 8 static
|
main.c:116:6:SystemClock_Config_24M_LSE_FL3_VS2 8 static
|
||||||
main.c:178:6:SystemClock_Config_80M 8 static
|
main.c:184:6:SystemClock_Config_24M_LSE 8 static
|
||||||
|
main.c:249:6:SystemClock_Config_80M 8 static
|
||||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -3456,7 +3456,7 @@ LOAD c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
|
||||||
0x0000000008000000 g_pfnVectors
|
0x0000000008000000 g_pfnVectors
|
||||||
0x0000000008000188 . = ALIGN (0x4)
|
0x0000000008000188 . = ALIGN (0x4)
|
||||||
|
|
||||||
.text 0x0000000008000188 0xd1c
|
.text 0x0000000008000188 0xe0c
|
||||||
0x0000000008000188 . = ALIGN (0x4)
|
0x0000000008000188 . = ALIGN (0x4)
|
||||||
*(.text)
|
*(.text)
|
||||||
.text 0x0000000008000188 0x40 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.text 0x0000000008000188 0x40 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
|
@ -3547,234 +3547,237 @@ LOAD c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
|
||||||
.text.LL_PWR_DisableBkUpAccess
|
.text.LL_PWR_DisableBkUpAccess
|
||||||
0x000000000800080c 0x20 Core/Src/main.o
|
0x000000000800080c 0x20 Core/Src/main.o
|
||||||
.text.SysTick_Handler
|
.text.SysTick_Handler
|
||||||
0x000000000800082c 0x70 Core/Src/main.o
|
0x000000000800082c 0x7c Core/Src/main.o
|
||||||
0x000000000800082c SysTick_Handler
|
0x000000000800082c SysTick_Handler
|
||||||
.text.main 0x000000000800089c 0xe4 Core/Src/main.o
|
.text.main 0x00000000080008a8 0xfc Core/Src/main.o
|
||||||
0x000000000800089c main
|
0x00000000080008a8 main
|
||||||
|
.text.SystemClock_Config_24M_LSE_FL3_VS2
|
||||||
|
0x00000000080009a4 0xcc Core/Src/main.o
|
||||||
|
0x00000000080009a4 SystemClock_Config_24M_LSE_FL3_VS2
|
||||||
.text.SystemClock_Config_24M_LSE
|
.text.SystemClock_Config_24M_LSE
|
||||||
0x0000000008000980 0xcc Core/Src/main.o
|
0x0000000008000a70 0xcc Core/Src/main.o
|
||||||
0x0000000008000980 SystemClock_Config_24M_LSE
|
0x0000000008000a70 SystemClock_Config_24M_LSE
|
||||||
.text.SystemClock_Config_80M
|
.text.SystemClock_Config_80M
|
||||||
0x0000000008000a4c 0x98 Core/Src/main.o
|
0x0000000008000b3c 0x98 Core/Src/main.o
|
||||||
0x0000000008000a4c SystemClock_Config_80M
|
0x0000000008000b3c SystemClock_Config_80M
|
||||||
.text.NMI_Handler
|
.text.NMI_Handler
|
||||||
0x0000000008000ae4 0xe Core/Src/stm32l4xx_it.o
|
0x0000000008000bd4 0xe Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000ae4 NMI_Handler
|
0x0000000008000bd4 NMI_Handler
|
||||||
.text.HardFault_Handler
|
.text.HardFault_Handler
|
||||||
0x0000000008000af2 0x6 Core/Src/stm32l4xx_it.o
|
0x0000000008000be2 0x6 Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000af2 HardFault_Handler
|
0x0000000008000be2 HardFault_Handler
|
||||||
.text.MemManage_Handler
|
.text.MemManage_Handler
|
||||||
0x0000000008000af8 0x6 Core/Src/stm32l4xx_it.o
|
0x0000000008000be8 0x6 Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000af8 MemManage_Handler
|
0x0000000008000be8 MemManage_Handler
|
||||||
.text.BusFault_Handler
|
.text.BusFault_Handler
|
||||||
0x0000000008000afe 0x6 Core/Src/stm32l4xx_it.o
|
0x0000000008000bee 0x6 Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000afe BusFault_Handler
|
0x0000000008000bee BusFault_Handler
|
||||||
.text.UsageFault_Handler
|
.text.UsageFault_Handler
|
||||||
0x0000000008000b04 0x6 Core/Src/stm32l4xx_it.o
|
0x0000000008000bf4 0x6 Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000b04 UsageFault_Handler
|
0x0000000008000bf4 UsageFault_Handler
|
||||||
.text.SVC_Handler
|
.text.SVC_Handler
|
||||||
0x0000000008000b0a 0xe Core/Src/stm32l4xx_it.o
|
0x0000000008000bfa 0xe Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000b0a SVC_Handler
|
0x0000000008000bfa SVC_Handler
|
||||||
.text.DebugMon_Handler
|
.text.DebugMon_Handler
|
||||||
0x0000000008000b18 0xe Core/Src/stm32l4xx_it.o
|
0x0000000008000c08 0xe Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000b18 DebugMon_Handler
|
0x0000000008000c08 DebugMon_Handler
|
||||||
.text.PendSV_Handler
|
.text.PendSV_Handler
|
||||||
0x0000000008000b26 0xe Core/Src/stm32l4xx_it.o
|
0x0000000008000c16 0xe Core/Src/stm32l4xx_it.o
|
||||||
0x0000000008000b26 PendSV_Handler
|
0x0000000008000c16 PendSV_Handler
|
||||||
.text.SystemInit
|
.text.SystemInit
|
||||||
0x0000000008000b34 0x6c Core/Src/system_stm32l4xx.o
|
0x0000000008000c24 0x6c Core/Src/system_stm32l4xx.o
|
||||||
0x0000000008000b34 SystemInit
|
0x0000000008000c24 SystemInit
|
||||||
.text.Reset_Handler
|
.text.Reset_Handler
|
||||||
0x0000000008000ba0 0x50 Core/Startup/startup_stm32l476rgtx.o
|
0x0000000008000c90 0x50 Core/Startup/startup_stm32l476rgtx.o
|
||||||
0x0000000008000ba0 Reset_Handler
|
0x0000000008000c90 Reset_Handler
|
||||||
.text.Default_Handler
|
.text.Default_Handler
|
||||||
0x0000000008000bf0 0x2 Core/Startup/startup_stm32l476rgtx.o
|
0x0000000008000ce0 0x2 Core/Startup/startup_stm32l476rgtx.o
|
||||||
0x0000000008000bf0 RTC_Alarm_IRQHandler
|
0x0000000008000ce0 RTC_Alarm_IRQHandler
|
||||||
0x0000000008000bf0 EXTI2_IRQHandler
|
0x0000000008000ce0 EXTI2_IRQHandler
|
||||||
0x0000000008000bf0 TIM8_TRG_COM_IRQHandler
|
0x0000000008000ce0 TIM8_TRG_COM_IRQHandler
|
||||||
0x0000000008000bf0 TIM8_CC_IRQHandler
|
0x0000000008000ce0 TIM8_CC_IRQHandler
|
||||||
0x0000000008000bf0 TIM1_CC_IRQHandler
|
0x0000000008000ce0 TIM1_CC_IRQHandler
|
||||||
0x0000000008000bf0 TSC_IRQHandler
|
0x0000000008000ce0 TSC_IRQHandler
|
||||||
0x0000000008000bf0 TAMP_STAMP_IRQHandler
|
0x0000000008000ce0 TAMP_STAMP_IRQHandler
|
||||||
0x0000000008000bf0 EXTI3_IRQHandler
|
0x0000000008000ce0 EXTI3_IRQHandler
|
||||||
0x0000000008000bf0 LPTIM2_IRQHandler
|
0x0000000008000ce0 LPTIM2_IRQHandler
|
||||||
0x0000000008000bf0 DFSDM1_FLT1_IRQHandler
|
0x0000000008000ce0 DFSDM1_FLT1_IRQHandler
|
||||||
0x0000000008000bf0 I2C3_ER_IRQHandler
|
0x0000000008000ce0 I2C3_ER_IRQHandler
|
||||||
0x0000000008000bf0 DFSDM1_FLT2_IRQHandler
|
0x0000000008000ce0 DFSDM1_FLT2_IRQHandler
|
||||||
0x0000000008000bf0 EXTI0_IRQHandler
|
0x0000000008000ce0 EXTI0_IRQHandler
|
||||||
0x0000000008000bf0 I2C2_EV_IRQHandler
|
0x0000000008000ce0 I2C2_EV_IRQHandler
|
||||||
0x0000000008000bf0 CAN1_RX0_IRQHandler
|
0x0000000008000ce0 CAN1_RX0_IRQHandler
|
||||||
0x0000000008000bf0 FPU_IRQHandler
|
0x0000000008000ce0 FPU_IRQHandler
|
||||||
0x0000000008000bf0 TIM1_UP_TIM16_IRQHandler
|
0x0000000008000ce0 TIM1_UP_TIM16_IRQHandler
|
||||||
0x0000000008000bf0 ADC1_2_IRQHandler
|
0x0000000008000ce0 ADC1_2_IRQHandler
|
||||||
0x0000000008000bf0 SPI1_IRQHandler
|
0x0000000008000ce0 SPI1_IRQHandler
|
||||||
0x0000000008000bf0 TIM6_DAC_IRQHandler
|
0x0000000008000ce0 TIM6_DAC_IRQHandler
|
||||||
0x0000000008000bf0 TIM8_UP_IRQHandler
|
0x0000000008000ce0 TIM8_UP_IRQHandler
|
||||||
0x0000000008000bf0 DMA2_Channel2_IRQHandler
|
0x0000000008000ce0 DMA2_Channel2_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel4_IRQHandler
|
0x0000000008000ce0 DMA1_Channel4_IRQHandler
|
||||||
0x0000000008000bf0 SAI2_IRQHandler
|
0x0000000008000ce0 SAI2_IRQHandler
|
||||||
0x0000000008000bf0 DFSDM1_FLT3_IRQHandler
|
0x0000000008000ce0 DFSDM1_FLT3_IRQHandler
|
||||||
0x0000000008000bf0 USART3_IRQHandler
|
0x0000000008000ce0 USART3_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel7_IRQHandler
|
0x0000000008000ce0 DMA1_Channel7_IRQHandler
|
||||||
0x0000000008000bf0 CAN1_RX1_IRQHandler
|
0x0000000008000ce0 CAN1_RX1_IRQHandler
|
||||||
0x0000000008000bf0 LCD_IRQHandler
|
0x0000000008000ce0 LCD_IRQHandler
|
||||||
0x0000000008000bf0 UART5_IRQHandler
|
0x0000000008000ce0 UART5_IRQHandler
|
||||||
0x0000000008000bf0 ADC3_IRQHandler
|
0x0000000008000ce0 ADC3_IRQHandler
|
||||||
0x0000000008000bf0 TIM4_IRQHandler
|
0x0000000008000ce0 TIM4_IRQHandler
|
||||||
0x0000000008000bf0 DMA2_Channel1_IRQHandler
|
0x0000000008000ce0 DMA2_Channel1_IRQHandler
|
||||||
0x0000000008000bf0 QUADSPI_IRQHandler
|
0x0000000008000ce0 QUADSPI_IRQHandler
|
||||||
0x0000000008000bf0 I2C1_EV_IRQHandler
|
0x0000000008000ce0 I2C1_EV_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel6_IRQHandler
|
0x0000000008000ce0 DMA1_Channel6_IRQHandler
|
||||||
0x0000000008000bf0 UART4_IRQHandler
|
0x0000000008000ce0 UART4_IRQHandler
|
||||||
0x0000000008000bf0 DMA2_Channel4_IRQHandler
|
0x0000000008000ce0 DMA2_Channel4_IRQHandler
|
||||||
0x0000000008000bf0 TIM3_IRQHandler
|
0x0000000008000ce0 TIM3_IRQHandler
|
||||||
0x0000000008000bf0 RCC_IRQHandler
|
0x0000000008000ce0 RCC_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel1_IRQHandler
|
0x0000000008000ce0 DMA1_Channel1_IRQHandler
|
||||||
0x0000000008000bf0 Default_Handler
|
0x0000000008000ce0 Default_Handler
|
||||||
0x0000000008000bf0 DMA2_Channel7_IRQHandler
|
0x0000000008000ce0 DMA2_Channel7_IRQHandler
|
||||||
0x0000000008000bf0 EXTI15_10_IRQHandler
|
0x0000000008000ce0 EXTI15_10_IRQHandler
|
||||||
0x0000000008000bf0 TIM7_IRQHandler
|
0x0000000008000ce0 TIM7_IRQHandler
|
||||||
0x0000000008000bf0 SDMMC1_IRQHandler
|
0x0000000008000ce0 SDMMC1_IRQHandler
|
||||||
0x0000000008000bf0 TIM5_IRQHandler
|
0x0000000008000ce0 TIM5_IRQHandler
|
||||||
0x0000000008000bf0 I2C3_EV_IRQHandler
|
0x0000000008000ce0 I2C3_EV_IRQHandler
|
||||||
0x0000000008000bf0 EXTI9_5_IRQHandler
|
0x0000000008000ce0 EXTI9_5_IRQHandler
|
||||||
0x0000000008000bf0 RTC_WKUP_IRQHandler
|
0x0000000008000ce0 RTC_WKUP_IRQHandler
|
||||||
0x0000000008000bf0 PVD_PVM_IRQHandler
|
0x0000000008000ce0 PVD_PVM_IRQHandler
|
||||||
0x0000000008000bf0 SPI2_IRQHandler
|
0x0000000008000ce0 SPI2_IRQHandler
|
||||||
0x0000000008000bf0 CAN1_TX_IRQHandler
|
0x0000000008000ce0 CAN1_TX_IRQHandler
|
||||||
0x0000000008000bf0 DMA2_Channel5_IRQHandler
|
0x0000000008000ce0 DMA2_Channel5_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel5_IRQHandler
|
0x0000000008000ce0 DMA1_Channel5_IRQHandler
|
||||||
0x0000000008000bf0 EXTI4_IRQHandler
|
0x0000000008000ce0 EXTI4_IRQHandler
|
||||||
0x0000000008000bf0 RNG_IRQHandler
|
0x0000000008000ce0 RNG_IRQHandler
|
||||||
0x0000000008000bf0 TIM1_TRG_COM_TIM17_IRQHandler
|
0x0000000008000ce0 TIM1_TRG_COM_TIM17_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel3_IRQHandler
|
0x0000000008000ce0 DMA1_Channel3_IRQHandler
|
||||||
0x0000000008000bf0 COMP_IRQHandler
|
0x0000000008000ce0 COMP_IRQHandler
|
||||||
0x0000000008000bf0 WWDG_IRQHandler
|
0x0000000008000ce0 WWDG_IRQHandler
|
||||||
0x0000000008000bf0 LPUART1_IRQHandler
|
0x0000000008000ce0 LPUART1_IRQHandler
|
||||||
0x0000000008000bf0 DMA2_Channel6_IRQHandler
|
0x0000000008000ce0 DMA2_Channel6_IRQHandler
|
||||||
0x0000000008000bf0 TIM2_IRQHandler
|
0x0000000008000ce0 TIM2_IRQHandler
|
||||||
0x0000000008000bf0 EXTI1_IRQHandler
|
0x0000000008000ce0 EXTI1_IRQHandler
|
||||||
0x0000000008000bf0 USART2_IRQHandler
|
0x0000000008000ce0 USART2_IRQHandler
|
||||||
0x0000000008000bf0 DFSDM1_FLT0_IRQHandler
|
0x0000000008000ce0 DFSDM1_FLT0_IRQHandler
|
||||||
0x0000000008000bf0 I2C2_ER_IRQHandler
|
0x0000000008000ce0 I2C2_ER_IRQHandler
|
||||||
0x0000000008000bf0 DMA1_Channel2_IRQHandler
|
0x0000000008000ce0 DMA1_Channel2_IRQHandler
|
||||||
0x0000000008000bf0 TIM8_BRK_IRQHandler
|
0x0000000008000ce0 TIM8_BRK_IRQHandler
|
||||||
0x0000000008000bf0 CAN1_SCE_IRQHandler
|
0x0000000008000ce0 CAN1_SCE_IRQHandler
|
||||||
0x0000000008000bf0 FLASH_IRQHandler
|
0x0000000008000ce0 FLASH_IRQHandler
|
||||||
0x0000000008000bf0 USART1_IRQHandler
|
0x0000000008000ce0 USART1_IRQHandler
|
||||||
0x0000000008000bf0 OTG_FS_IRQHandler
|
0x0000000008000ce0 OTG_FS_IRQHandler
|
||||||
0x0000000008000bf0 SPI3_IRQHandler
|
0x0000000008000ce0 SPI3_IRQHandler
|
||||||
0x0000000008000bf0 I2C1_ER_IRQHandler
|
0x0000000008000ce0 I2C1_ER_IRQHandler
|
||||||
0x0000000008000bf0 FMC_IRQHandler
|
0x0000000008000ce0 FMC_IRQHandler
|
||||||
0x0000000008000bf0 SWPMI1_IRQHandler
|
0x0000000008000ce0 SWPMI1_IRQHandler
|
||||||
0x0000000008000bf0 LPTIM1_IRQHandler
|
0x0000000008000ce0 LPTIM1_IRQHandler
|
||||||
0x0000000008000bf0 SAI1_IRQHandler
|
0x0000000008000ce0 SAI1_IRQHandler
|
||||||
0x0000000008000bf0 DMA2_Channel3_IRQHandler
|
0x0000000008000ce0 DMA2_Channel3_IRQHandler
|
||||||
0x0000000008000bf0 TIM1_BRK_TIM15_IRQHandler
|
0x0000000008000ce0 TIM1_BRK_TIM15_IRQHandler
|
||||||
*fill* 0x0000000008000bf2 0x2
|
*fill* 0x0000000008000ce2 0x2
|
||||||
.text.HAL_InitTick
|
.text.HAL_InitTick
|
||||||
0x0000000008000bf4 0x78 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
0x0000000008000ce4 0x78 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
0x0000000008000bf4 HAL_InitTick
|
0x0000000008000ce4 HAL_InitTick
|
||||||
.text.__NVIC_GetPriorityGrouping
|
.text.__NVIC_GetPriorityGrouping
|
||||||
0x0000000008000c6c 0x1c Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000008000d5c 0x1c Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.text.__NVIC_SetPriority
|
.text.__NVIC_SetPriority
|
||||||
0x0000000008000c88 0x54 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000008000d78 0x54 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.text.NVIC_EncodePriority
|
.text.NVIC_EncodePriority
|
||||||
0x0000000008000cdc 0x66 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000008000dcc 0x66 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
*fill* 0x0000000008000d42 0x2
|
*fill* 0x0000000008000e32 0x2
|
||||||
.text.SysTick_Config
|
.text.SysTick_Config
|
||||||
0x0000000008000d44 0x44 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000008000e34 0x44 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.text.HAL_NVIC_SetPriority
|
.text.HAL_NVIC_SetPriority
|
||||||
0x0000000008000d88 0x38 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000008000e78 0x38 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
0x0000000008000d88 HAL_NVIC_SetPriority
|
0x0000000008000e78 HAL_NVIC_SetPriority
|
||||||
.text.HAL_SYSTICK_Config
|
.text.HAL_SYSTICK_Config
|
||||||
0x0000000008000dc0 0x18 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000008000eb0 0x18 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
0x0000000008000dc0 HAL_SYSTICK_Config
|
0x0000000008000eb0 HAL_SYSTICK_Config
|
||||||
.text.LL_InitTick
|
.text.LL_InitTick
|
||||||
0x0000000008000dd8 0x34 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
0x0000000008000ec8 0x34 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
.text.LL_Init1msTick
|
.text.LL_Init1msTick
|
||||||
0x0000000008000e0c 0x18 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
0x0000000008000efc 0x18 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
0x0000000008000e0c LL_Init1msTick
|
0x0000000008000efc LL_Init1msTick
|
||||||
.text.LL_SetSystemCoreClock
|
.text.LL_SetSystemCoreClock
|
||||||
0x0000000008000e24 0x20 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
0x0000000008000f14 0x20 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
0x0000000008000e24 LL_SetSystemCoreClock
|
0x0000000008000f14 LL_SetSystemCoreClock
|
||||||
.text.__libc_init_array
|
.text.__libc_init_array
|
||||||
0x0000000008000e44 0x48 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
|
0x0000000008000f34 0x48 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
|
||||||
0x0000000008000e44 __libc_init_array
|
0x0000000008000f34 __libc_init_array
|
||||||
*(.glue_7)
|
*(.glue_7)
|
||||||
.glue_7 0x0000000008000e8c 0x0 linker stubs
|
.glue_7 0x0000000008000f7c 0x0 linker stubs
|
||||||
*(.glue_7t)
|
*(.glue_7t)
|
||||||
.glue_7t 0x0000000008000e8c 0x0 linker stubs
|
.glue_7t 0x0000000008000f7c 0x0 linker stubs
|
||||||
*(.eh_frame)
|
*(.eh_frame)
|
||||||
.eh_frame 0x0000000008000e8c 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.eh_frame 0x0000000008000f7c 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
*(.init)
|
*(.init)
|
||||||
.init 0x0000000008000e8c 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
|
.init 0x0000000008000f7c 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
|
||||||
0x0000000008000e8c _init
|
0x0000000008000f7c _init
|
||||||
.init 0x0000000008000e90 0x8 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
|
.init 0x0000000008000f80 0x8 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
|
||||||
*(.fini)
|
*(.fini)
|
||||||
.fini 0x0000000008000e98 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
|
.fini 0x0000000008000f88 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crti.o
|
||||||
0x0000000008000e98 _fini
|
0x0000000008000f88 _fini
|
||||||
.fini 0x0000000008000e9c 0x8 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
|
.fini 0x0000000008000f8c 0x8 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
0x0000000008000ea4 _etext = .
|
0x0000000008000f94 _etext = .
|
||||||
|
|
||||||
.vfp11_veneer 0x0000000008000ea4 0x0
|
.vfp11_veneer 0x0000000008000f94 0x0
|
||||||
.vfp11_veneer 0x0000000008000ea4 0x0 linker stubs
|
.vfp11_veneer 0x0000000008000f94 0x0 linker stubs
|
||||||
|
|
||||||
.v4_bx 0x0000000008000ea4 0x0
|
.v4_bx 0x0000000008000f94 0x0
|
||||||
.v4_bx 0x0000000008000ea4 0x0 linker stubs
|
.v4_bx 0x0000000008000f94 0x0 linker stubs
|
||||||
|
|
||||||
.iplt 0x0000000008000ea4 0x0
|
.iplt 0x0000000008000f94 0x0
|
||||||
.iplt 0x0000000008000ea4 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.iplt 0x0000000008000f94 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
|
|
||||||
.rel.dyn 0x0000000008000ea4 0x0
|
.rel.dyn 0x0000000008000f94 0x0
|
||||||
.rel.iplt 0x0000000008000ea4 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.rel.iplt 0x0000000008000f94 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
|
|
||||||
.rodata 0x0000000008000ea4 0x0
|
.rodata 0x0000000008000f94 0x0
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
*(.rodata)
|
*(.rodata)
|
||||||
*(.rodata*)
|
*(.rodata*)
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
|
|
||||||
.ARM.extab 0x0000000008000ea4 0x0
|
.ARM.extab 0x0000000008000f94 0x0
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
|
|
||||||
.ARM 0x0000000008000ea4 0x0
|
.ARM 0x0000000008000f94 0x0
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
0x0000000008000ea4 __exidx_start = .
|
0x0000000008000f94 __exidx_start = .
|
||||||
*(.ARM.exidx*)
|
*(.ARM.exidx*)
|
||||||
0x0000000008000ea4 __exidx_end = .
|
0x0000000008000f94 __exidx_end = .
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
|
|
||||||
.preinit_array 0x0000000008000ea4 0x0
|
.preinit_array 0x0000000008000f94 0x0
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
0x0000000008000ea4 PROVIDE (__preinit_array_start = .)
|
0x0000000008000f94 PROVIDE (__preinit_array_start = .)
|
||||||
*(.preinit_array*)
|
*(.preinit_array*)
|
||||||
0x0000000008000ea4 PROVIDE (__preinit_array_end = .)
|
0x0000000008000f94 PROVIDE (__preinit_array_end = .)
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
|
|
||||||
.init_array 0x0000000008000ea4 0x4
|
.init_array 0x0000000008000f94 0x4
|
||||||
0x0000000008000ea4 . = ALIGN (0x4)
|
0x0000000008000f94 . = ALIGN (0x4)
|
||||||
0x0000000008000ea4 PROVIDE (__init_array_start = .)
|
0x0000000008000f94 PROVIDE (__init_array_start = .)
|
||||||
*(SORT_BY_NAME(.init_array.*))
|
*(SORT_BY_NAME(.init_array.*))
|
||||||
*(.init_array*)
|
*(.init_array*)
|
||||||
.init_array 0x0000000008000ea4 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.init_array 0x0000000008000f94 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
0x0000000008000ea8 PROVIDE (__init_array_end = .)
|
0x0000000008000f98 PROVIDE (__init_array_end = .)
|
||||||
0x0000000008000ea8 . = ALIGN (0x4)
|
0x0000000008000f98 . = ALIGN (0x4)
|
||||||
|
|
||||||
.fini_array 0x0000000008000ea8 0x4
|
.fini_array 0x0000000008000f98 0x4
|
||||||
0x0000000008000ea8 . = ALIGN (0x4)
|
0x0000000008000f98 . = ALIGN (0x4)
|
||||||
[!provide] PROVIDE (__fini_array_start = .)
|
[!provide] PROVIDE (__fini_array_start = .)
|
||||||
*(SORT_BY_NAME(.fini_array.*))
|
*(SORT_BY_NAME(.fini_array.*))
|
||||||
*(.fini_array*)
|
*(.fini_array*)
|
||||||
.fini_array 0x0000000008000ea8 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.fini_array 0x0000000008000f98 0x4 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
[!provide] PROVIDE (__fini_array_end = .)
|
[!provide] PROVIDE (__fini_array_end = .)
|
||||||
0x0000000008000eac . = ALIGN (0x4)
|
0x0000000008000f9c . = ALIGN (0x4)
|
||||||
0x0000000008000eac _sidata = LOADADDR (.data)
|
0x0000000008000f9c _sidata = LOADADDR (.data)
|
||||||
|
|
||||||
.data 0x0000000020000000 0xc load address 0x0000000008000eac
|
.data 0x0000000020000000 0xc load address 0x0000000008000f9c
|
||||||
0x0000000020000000 . = ALIGN (0x4)
|
0x0000000020000000 . = ALIGN (0x4)
|
||||||
0x0000000020000000 _sdata = .
|
0x0000000020000000 _sdata = .
|
||||||
*(.data)
|
*(.data)
|
||||||
|
@ -3792,11 +3795,11 @@ LOAD c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
|
||||||
*fill* 0x0000000020000009 0x3
|
*fill* 0x0000000020000009 0x3
|
||||||
0x000000002000000c _edata = .
|
0x000000002000000c _edata = .
|
||||||
|
|
||||||
.igot.plt 0x000000002000000c 0x0 load address 0x0000000008000eb8
|
.igot.plt 0x000000002000000c 0x0 load address 0x0000000008000fa8
|
||||||
.igot.plt 0x000000002000000c 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
.igot.plt 0x000000002000000c 0x0 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtbegin.o
|
||||||
0x000000002000000c . = ALIGN (0x4)
|
0x000000002000000c . = ALIGN (0x4)
|
||||||
|
|
||||||
.bss 0x000000002000000c 0x24 load address 0x0000000008000eb8
|
.bss 0x000000002000000c 0x24 load address 0x0000000008000fa8
|
||||||
0x000000002000000c _sbss = .
|
0x000000002000000c _sbss = .
|
||||||
0x000000002000000c __bss_start__ = _sbss
|
0x000000002000000c __bss_start__ = _sbss
|
||||||
*(.bss)
|
*(.bss)
|
||||||
|
@ -3816,7 +3819,7 @@ LOAD c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
|
||||||
0x0000000020000030 __bss_end__ = _ebss
|
0x0000000020000030 __bss_end__ = _ebss
|
||||||
|
|
||||||
._user_heap_stack
|
._user_heap_stack
|
||||||
0x0000000020000030 0x600 load address 0x0000000008000eb8
|
0x0000000020000030 0x600 load address 0x0000000008000fa8
|
||||||
0x0000000020000030 . = ALIGN (0x8)
|
0x0000000020000030 . = ALIGN (0x8)
|
||||||
[!provide] PROVIDE (end = .)
|
[!provide] PROVIDE (end = .)
|
||||||
0x0000000020000030 PROVIDE (_end = .)
|
0x0000000020000030 PROVIDE (_end = .)
|
||||||
|
@ -3860,15 +3863,15 @@ LOAD c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.exte
|
||||||
0x000000000000023a 0x22 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
|
0x000000000000023a 0x22 c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7e-m/fpv4-sp/hard/crtn.o
|
||||||
OUTPUT(RealOne.elf elf32-littlearm)
|
OUTPUT(RealOne.elf elf32-littlearm)
|
||||||
|
|
||||||
.debug_info 0x0000000000000000 0x4bd6
|
.debug_info 0x0000000000000000 0x4be7
|
||||||
.debug_info 0x0000000000000000 0x84a Core/Src/gpio.o
|
.debug_info 0x0000000000000000 0x84a Core/Src/gpio.o
|
||||||
.debug_info 0x000000000000084a 0xfc4 Core/Src/main.o
|
.debug_info 0x000000000000084a 0xfd5 Core/Src/main.o
|
||||||
.debug_info 0x000000000000180e 0x35e Core/Src/stm32l4xx_it.o
|
.debug_info 0x000000000000181f 0x35e Core/Src/stm32l4xx_it.o
|
||||||
.debug_info 0x0000000000001b6c 0x727 Core/Src/system_stm32l4xx.o
|
.debug_info 0x0000000000001b7d 0x727 Core/Src/system_stm32l4xx.o
|
||||||
.debug_info 0x0000000000002293 0x22 Core/Startup/startup_stm32l476rgtx.o
|
.debug_info 0x00000000000022a4 0x22 Core/Startup/startup_stm32l476rgtx.o
|
||||||
.debug_info 0x00000000000022b5 0xc20 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
.debug_info 0x00000000000022c6 0xc20 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
.debug_info 0x0000000000002ed5 0xf6d Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.debug_info 0x0000000000002ee6 0xf6d Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.debug_info 0x0000000000003e42 0xd94 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_info 0x0000000000003e53 0xd94 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_abbrev 0x0000000000000000 0xd51
|
.debug_abbrev 0x0000000000000000 0xd51
|
||||||
.debug_abbrev 0x0000000000000000 0x233 Core/Src/gpio.o
|
.debug_abbrev 0x0000000000000000 0x233 Core/Src/gpio.o
|
||||||
|
@ -3880,33 +3883,33 @@ OUTPUT(RealOne.elf elf32-littlearm)
|
||||||
.debug_abbrev 0x000000000000081f 0x2fa Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.debug_abbrev 0x000000000000081f 0x2fa Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.debug_abbrev 0x0000000000000b19 0x238 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_abbrev 0x0000000000000b19 0x238 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_aranges 0x0000000000000000 0x5b8
|
.debug_aranges 0x0000000000000000 0x5c0
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000000 0x70 Core/Src/gpio.o
|
0x0000000000000000 0x70 Core/Src/gpio.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000070 0x120 Core/Src/main.o
|
0x0000000000000070 0x128 Core/Src/main.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000190 0x58 Core/Src/stm32l4xx_it.o
|
0x0000000000000198 0x58 Core/Src/stm32l4xx_it.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x00000000000001e8 0x28 Core/Src/system_stm32l4xx.o
|
0x00000000000001f0 0x28 Core/Src/system_stm32l4xx.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000210 0x28 Core/Startup/startup_stm32l476rgtx.o
|
0x0000000000000218 0x28 Core/Startup/startup_stm32l476rgtx.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000238 0x130 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
0x0000000000000240 0x130 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000368 0x118 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
0x0000000000000370 0x118 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.debug_aranges
|
.debug_aranges
|
||||||
0x0000000000000480 0x138 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
0x0000000000000488 0x138 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_ranges 0x0000000000000000 0x540
|
.debug_ranges 0x0000000000000000 0x548
|
||||||
.debug_ranges 0x0000000000000000 0x60 Core/Src/gpio.o
|
.debug_ranges 0x0000000000000000 0x60 Core/Src/gpio.o
|
||||||
.debug_ranges 0x0000000000000060 0x110 Core/Src/main.o
|
.debug_ranges 0x0000000000000060 0x118 Core/Src/main.o
|
||||||
.debug_ranges 0x0000000000000170 0x48 Core/Src/stm32l4xx_it.o
|
.debug_ranges 0x0000000000000178 0x48 Core/Src/stm32l4xx_it.o
|
||||||
.debug_ranges 0x00000000000001b8 0x18 Core/Src/system_stm32l4xx.o
|
.debug_ranges 0x00000000000001c0 0x18 Core/Src/system_stm32l4xx.o
|
||||||
.debug_ranges 0x00000000000001d0 0x20 Core/Startup/startup_stm32l476rgtx.o
|
.debug_ranges 0x00000000000001d8 0x20 Core/Startup/startup_stm32l476rgtx.o
|
||||||
.debug_ranges 0x00000000000001f0 0x120 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
.debug_ranges 0x00000000000001f8 0x120 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
.debug_ranges 0x0000000000000310 0x108 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.debug_ranges 0x0000000000000318 0x108 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.debug_ranges 0x0000000000000418 0x128 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_ranges 0x0000000000000420 0x128 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_macro 0x0000000000000000 0x26337
|
.debug_macro 0x0000000000000000 0x26337
|
||||||
.debug_macro 0x0000000000000000 0x204 Core/Src/gpio.o
|
.debug_macro 0x0000000000000000 0x204 Core/Src/gpio.o
|
||||||
|
@ -3966,32 +3969,32 @@ OUTPUT(RealOne.elf elf32-littlearm)
|
||||||
.debug_macro 0x0000000000025ffb 0x29b Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_macro 0x0000000000025ffb 0x29b Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
.debug_macro 0x0000000000026296 0xa1 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_macro 0x0000000000026296 0xa1 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_line 0x0000000000000000 0x40fa
|
.debug_line 0x0000000000000000 0x4155
|
||||||
.debug_line 0x0000000000000000 0x7e6 Core/Src/gpio.o
|
.debug_line 0x0000000000000000 0x7e6 Core/Src/gpio.o
|
||||||
.debug_line 0x00000000000007e6 0xae0 Core/Src/main.o
|
.debug_line 0x00000000000007e6 0xb3b Core/Src/main.o
|
||||||
.debug_line 0x00000000000012c6 0x855 Core/Src/stm32l4xx_it.o
|
.debug_line 0x0000000000001321 0x855 Core/Src/stm32l4xx_it.o
|
||||||
.debug_line 0x0000000000001b1b 0x6eb Core/Src/system_stm32l4xx.o
|
.debug_line 0x0000000000001b76 0x6eb Core/Src/system_stm32l4xx.o
|
||||||
.debug_line 0x0000000000002206 0x87 Core/Startup/startup_stm32l476rgtx.o
|
.debug_line 0x0000000000002261 0x87 Core/Startup/startup_stm32l476rgtx.o
|
||||||
.debug_line 0x000000000000228d 0x961 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
.debug_line 0x00000000000022e8 0x961 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
.debug_line 0x0000000000002bee 0x9e9 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.debug_line 0x0000000000002c49 0x9e9 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.debug_line 0x00000000000035d7 0xb23 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_line 0x0000000000003632 0xb23 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_str 0x0000000000000000 0xee8c5
|
.debug_str 0x0000000000000000 0xee8e8
|
||||||
.debug_str 0x0000000000000000 0xe3d91 Core/Src/gpio.o
|
.debug_str 0x0000000000000000 0xe3d91 Core/Src/gpio.o
|
||||||
0xe4dab (size before relaxing)
|
0xe4dab (size before relaxing)
|
||||||
.debug_str 0x00000000000e3d91 0x8e76 Core/Src/main.o
|
.debug_str 0x00000000000e3d91 0x8e99 Core/Src/main.o
|
||||||
0xedac0 (size before relaxing)
|
0xedae3 (size before relaxing)
|
||||||
.debug_str 0x00000000000ecc07 0xad Core/Src/stm32l4xx_it.o
|
.debug_str 0x00000000000ecc2a 0xad Core/Src/stm32l4xx_it.o
|
||||||
0xed404 (size before relaxing)
|
0xed404 (size before relaxing)
|
||||||
.debug_str 0x00000000000eccb4 0x79 Core/Src/system_stm32l4xx.o
|
.debug_str 0x00000000000eccd7 0x79 Core/Src/system_stm32l4xx.o
|
||||||
0xe3959 (size before relaxing)
|
0xe3959 (size before relaxing)
|
||||||
.debug_str 0x00000000000ecd2d 0x36 Core/Startup/startup_stm32l476rgtx.o
|
.debug_str 0x00000000000ecd50 0x36 Core/Startup/startup_stm32l476rgtx.o
|
||||||
0x62 (size before relaxing)
|
0x62 (size before relaxing)
|
||||||
.debug_str 0x00000000000ecd63 0x9fa Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
.debug_str 0x00000000000ecd86 0x9fa Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
0xe443d (size before relaxing)
|
0xe443d (size before relaxing)
|
||||||
.debug_str 0x00000000000ed75d 0x3a6 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.debug_str 0x00000000000ed780 0x3a6 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
0xe41ad (size before relaxing)
|
0xe41ad (size before relaxing)
|
||||||
.debug_str 0x00000000000edb03 0xdc2 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_str 0x00000000000edb26 0xdc2 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
0xea58d (size before relaxing)
|
0xea58d (size before relaxing)
|
||||||
|
|
||||||
.comment 0x0000000000000000 0x7b
|
.comment 0x0000000000000000 0x7b
|
||||||
|
@ -4004,12 +4007,12 @@ OUTPUT(RealOne.elf elf32-littlearm)
|
||||||
.comment 0x000000000000007b 0x7c Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.comment 0x000000000000007b 0x7c Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.comment 0x000000000000007b 0x7c Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.comment 0x000000000000007b 0x7c Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
|
|
||||||
.debug_frame 0x0000000000000000 0x15c0
|
.debug_frame 0x0000000000000000 0x15dc
|
||||||
.debug_frame 0x0000000000000000 0x1a0 Core/Src/gpio.o
|
.debug_frame 0x0000000000000000 0x1a0 Core/Src/gpio.o
|
||||||
.debug_frame 0x00000000000001a0 0x480 Core/Src/main.o
|
.debug_frame 0x00000000000001a0 0x49c Core/Src/main.o
|
||||||
.debug_frame 0x0000000000000620 0xf0 Core/Src/stm32l4xx_it.o
|
.debug_frame 0x000000000000063c 0xf0 Core/Src/stm32l4xx_it.o
|
||||||
.debug_frame 0x0000000000000710 0x58 Core/Src/system_stm32l4xx.o
|
.debug_frame 0x000000000000072c 0x58 Core/Src/system_stm32l4xx.o
|
||||||
.debug_frame 0x0000000000000768 0x498 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
.debug_frame 0x0000000000000784 0x498 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o
|
||||||
.debug_frame 0x0000000000000c00 0x498 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
.debug_frame 0x0000000000000c1c 0x498 Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o
|
||||||
.debug_frame 0x0000000000001098 0x4fc Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
.debug_frame 0x00000000000010b4 0x4fc Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.o
|
||||||
.debug_frame 0x0000000000001594 0x2c c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
|
.debug_frame 0x00000000000015b0 0x2c c:/st/stm32cubeide_1.4.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.4.0.202007081208/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard\libc_nano.a(lib_a-init.o)
|
||||||
|
|
Loading…
Reference in a new issue