From 4dbed67e742fb8580950486b897396de332c7249 Mon Sep 17 00:00:00 2001 From: bray Date: Wed, 18 Nov 2020 10:15:15 +0100 Subject: [PATCH] code for wakup and stuff, without ll_RTC --- PlaygroundYoupi/.metadata/.ide.log | 8 + PlaygroundYoupi/.metadata/.log | 30 + .../.plugins/org.eclipse.cdt.core/.log | 1 + .../org.eclipse.cdt.ui/RealOne.build.log | 80 +- .../org.eclipse.cdt.ui/global-build.log | 75 + .../5e/406ca2737c29001b19c3e184f9ec9561 | 292 ++ .../RealOne/.indexes/d5/0/be/properties.index | Bin 170 -> 283 bytes .../RealOne/.indexes/d5/0/c4/properties.index | Bin 0 -> 172 bytes .../.projects/RealOne/.markers | Bin 1421 -> 1421 bytes .../.projects/RealOne/.markers.snap | Bin 0 -> 4993 bytes .../.projects/RealOne/.syncinfo.snap | Bin 0 -> 16 bytes .../RemoteSystemsTempFiles/.markers.snap | Bin 0 -> 16 bytes .../RemoteSystemsTempFiles/.syncinfo.snap | Bin 0 -> 16 bytes .../.root/.markers.snap | Bin 0 -> 16 bytes .../.root/{3.tree => 4.tree} | Bin 12645 -> 12491 bytes .../.safetable/org.eclipse.core.resources | Bin 760 -> 1092 bytes .../org.eclipse.core.resources/4.snap | Bin 0 -> 586 bytes .../org.eclipse.e4.workbench/workbench.xmi | 2549 +++++++++-------- PlaygroundYoupi/.metadata/version.ini | 2 +- RealOne/Core/Src/main.c | 47 + RealOne/Debug/Core/Src/main.su | 34 - 21 files changed, 1807 insertions(+), 1311 deletions(-) create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.history/5e/406ca2737c29001b19c3e184f9ec9561 create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.indexes/d5/0/c4/properties.index create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.markers.snap create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.syncinfo.snap create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap rename PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/{3.tree => 4.tree} (97%) create mode 100644 PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/4.snap diff --git a/PlaygroundYoupi/.metadata/.ide.log b/PlaygroundYoupi/.metadata/.ide.log index 4356e6e..08e90c4 100644 --- a/PlaygroundYoupi/.metadata/.ide.log +++ b/PlaygroundYoupi/.metadata/.ide.log @@ -938,3 +938,11 @@ 2020-11-17 08:14:50,700 [INFO] Activator:179 - !SESSION log4j initialized +2020-11-17 22:25:06,507 [INFO] Activator:178 - + + +2020-11-17 22:25:06,510 [INFO] Activator:179 - !SESSION log4j initialized +2020-11-18 09:40:28,010 [INFO] Activator:178 - + + +2020-11-18 09:40:28,013 [INFO] Activator:179 - !SESSION log4j initialized diff --git a/PlaygroundYoupi/.metadata/.log b/PlaygroundYoupi/.metadata/.log index c0e3679..4564239 100644 --- a/PlaygroundYoupi/.metadata/.log +++ b/PlaygroundYoupi/.metadata/.log @@ -613,3 +613,33 @@ Reason: (4) No device found on target. !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. +!SESSION 2020-11-17 22:24:56.029 ----------------------------------------------- +eclipse.buildId=Version 1.4.0 +java.version=1.8.0_252 +java.vendor=AdoptOpenJDK +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB +Command-line arguments: -os win32 -ws win32 -arch x86_64 + +!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2020-11-17 22:25:06.499 +!MESSAGE Log4j initialized with config file C:\Users\camer\Desktop\LoPoSo\PlaygroundYoupi\.metadata\.log4j.xml + +!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2020-11-17 22:25:13.904 +!MESSAGE Started RMI Server, listening on port 41337 + +!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2020-11-17 22:25:14.505 +!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties +!SESSION 2020-11-18 09:40:17.619 ----------------------------------------------- +eclipse.buildId=Version 1.4.0 +java.version=1.8.0_252 +java.vendor=AdoptOpenJDK +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB +Command-line arguments: -os win32 -ws win32 -arch x86_64 + +!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2020-11-18 09:40:28.003 +!MESSAGE Log4j initialized with config file C:\Users\camer\Desktop\LoPoSo\PlaygroundYoupi\.metadata\.log4j.xml + +!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2020-11-18 09:40:34.497 +!MESSAGE Started RMI Server, listening on port 41337 + +!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2020-11-18 09:40:35.090 +!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.core/.log b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.core/.log index ce74b49..64d9ffa 100644 --- a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.core/.log +++ b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.core/.log @@ -1,3 +1,4 @@ *** SESSION Nov 05, 2020 10:46:36.34 ------------------------------------------- *** SESSION Nov 16, 2020 08:11:47.28 ------------------------------------------- *** SESSION Nov 17, 2020 08:14:51.13 ------------------------------------------- +*** SESSION Nov 17, 2020 22:25:06.93 ------------------------------------------- diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/RealOne.build.log b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/RealOne.build.log index 46cf1b1..0cbb227 100644 --- a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/RealOne.build.log +++ b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/RealOne.build.log @@ -1,10 +1,78 @@ -10:38:01 **** Incremental Build of configuration Debug for project RealOne **** +10:00:06 **** 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 +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 */ +: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 + +: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 + +: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 + +:0:0: note: this is the location of the previous definition +../Core/Src/main.c: In function 'RTC_wakeup_init': +../Core/Src/main.c:297:1: warning: implicit declaration of function 'LL_RTC_DisableWriteProtection'; did you mean 'LL_PWR_DisableSRAM2Retention'? [-Wimplicit-function-declaration] + LL_RTC_DisableWriteProtection( RTC ); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LL_PWR_DisableSRAM2Retention +../Core/Src/main.c:298:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_Disable'; did you mean 'LL_RCC_LSE_Disable'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_Disable( RTC ); + ^~~~~~~~~~~~~~~~~~~~~ + LL_RCC_LSE_Disable +../Core/Src/main.c:299:10: warning: implicit declaration of function 'LL_RTC_IsActiveFlag_WUTW'; did you mean 'LL_PWR_IsActiveFlag_WU1'? [-Wimplicit-function-declaration] + while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) ) + ^~~~~~~~~~~~~~~~~~~~~~~~ + LL_PWR_IsActiveFlag_WU1 +../Core/Src/main.c:302:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_SetClock'; did you mean 'IS_RTC_WAKEUP_CLOCK'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE ); + ^~~~~~~~~~~~~~~~~~~~~~ + IS_RTC_WAKEUP_CLOCK +../Core/Src/main.c:302:30: error: 'LL_RTC_WAKEUPCLOCK_CKSPRE' undeclared (first use in this function); did you mean 'IS_RTC_WAKEUP_CLOCK'? + LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE ); + ^~~~~~~~~~~~~~~~~~~~~~~~~ + IS_RTC_WAKEUP_CLOCK +../Core/Src/main.c:302:30: note: each undeclared identifier is reported only once for each function it appears in +../Core/Src/main.c:304:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_SetAutoReload'; did you mean '__HAL_TIM_SetAutoreload'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits + ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + __HAL_TIM_SetAutoreload +../Core/Src/main.c:305:1: warning: implicit declaration of function 'LL_RTC_ClearFlag_WUT'; did you mean 'LL_PWR_ClearFlag_WU1'? [-Wimplicit-function-declaration] + LL_RTC_ClearFlag_WUT(RTC); + ^~~~~~~~~~~~~~~~~~~~ + LL_PWR_ClearFlag_WU1 +../Core/Src/main.c:306:1: warning: implicit declaration of function 'LL_RTC_EnableIT_WUT'; did you mean 'LL_DMA_EnableIT_HT'? [-Wimplicit-function-declaration] + LL_RTC_EnableIT_WUT(RTC); + ^~~~~~~~~~~~~~~~~~~ + LL_DMA_EnableIT_HT +../Core/Src/main.c:307:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_Enable'; did you mean 'LL_RCC_LSE_Enable'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_Enable(RTC); + ^~~~~~~~~~~~~~~~~~~~ + LL_RCC_LSE_Enable +../Core/Src/main.c:308:1: warning: implicit declaration of function 'LL_RTC_EnableWriteProtection'; did you mean 'LL_PWR_EnableSRAM2Retention'? [-Wimplicit-function-declaration] + LL_RTC_EnableWriteProtection(RTC); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LL_PWR_EnableSRAM2Retention +make: *** [Core/Src/subdir.mk:38: Core/Src/main.o] Error 1 +"make -j8 all" terminated with exit code 2. Build might be incomplete. -10:38:01 Build Finished. 0 errors, 0 warnings. (took 315ms) +10:00:08 Build Failed. 2 errors, 13 warnings. (took 2s.138ms) diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log index 1aea643..e756e9f 100644 --- a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log +++ b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log @@ -765,3 +765,78 @@ arm-none-eabi-size RealOne.elf 3988 20 1572 5580 15cc RealOne.elf Finished building: default.size.stdout +10:00:06 **** 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 */ + +: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 + +: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 + +: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 + +:0:0: note: this is the location of the previous definition +../Core/Src/main.c: In function 'RTC_wakeup_init': +../Core/Src/main.c:297:1: warning: implicit declaration of function 'LL_RTC_DisableWriteProtection'; did you mean 'LL_PWR_DisableSRAM2Retention'? [-Wimplicit-function-declaration] + LL_RTC_DisableWriteProtection( RTC ); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LL_PWR_DisableSRAM2Retention +../Core/Src/main.c:298:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_Disable'; did you mean 'LL_RCC_LSE_Disable'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_Disable( RTC ); + ^~~~~~~~~~~~~~~~~~~~~ + LL_RCC_LSE_Disable +../Core/Src/main.c:299:10: warning: implicit declaration of function 'LL_RTC_IsActiveFlag_WUTW'; did you mean 'LL_PWR_IsActiveFlag_WU1'? [-Wimplicit-function-declaration] + while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) ) + ^~~~~~~~~~~~~~~~~~~~~~~~ + LL_PWR_IsActiveFlag_WU1 +../Core/Src/main.c:302:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_SetClock'; did you mean 'IS_RTC_WAKEUP_CLOCK'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE ); + ^~~~~~~~~~~~~~~~~~~~~~ + IS_RTC_WAKEUP_CLOCK +../Core/Src/main.c:302:30: error: 'LL_RTC_WAKEUPCLOCK_CKSPRE' undeclared (first use in this function); did you mean 'IS_RTC_WAKEUP_CLOCK'? + LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE ); + ^~~~~~~~~~~~~~~~~~~~~~~~~ + IS_RTC_WAKEUP_CLOCK +../Core/Src/main.c:302:30: note: each undeclared identifier is reported only once for each function it appears in +../Core/Src/main.c:304:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_SetAutoReload'; did you mean '__HAL_TIM_SetAutoreload'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits + ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + __HAL_TIM_SetAutoreload +../Core/Src/main.c:305:1: warning: implicit declaration of function 'LL_RTC_ClearFlag_WUT'; did you mean 'LL_PWR_ClearFlag_WU1'? [-Wimplicit-function-declaration] + LL_RTC_ClearFlag_WUT(RTC); + ^~~~~~~~~~~~~~~~~~~~ + LL_PWR_ClearFlag_WU1 +../Core/Src/main.c:306:1: warning: implicit declaration of function 'LL_RTC_EnableIT_WUT'; did you mean 'LL_DMA_EnableIT_HT'? [-Wimplicit-function-declaration] + LL_RTC_EnableIT_WUT(RTC); + ^~~~~~~~~~~~~~~~~~~ + LL_DMA_EnableIT_HT +../Core/Src/main.c:307:1: warning: implicit declaration of function 'LL_RTC_WAKEUP_Enable'; did you mean 'LL_RCC_LSE_Enable'? [-Wimplicit-function-declaration] + LL_RTC_WAKEUP_Enable(RTC); + ^~~~~~~~~~~~~~~~~~~~ + LL_RCC_LSE_Enable +../Core/Src/main.c:308:1: warning: implicit declaration of function 'LL_RTC_EnableWriteProtection'; did you mean 'LL_PWR_EnableSRAM2Retention'? [-Wimplicit-function-declaration] + LL_RTC_EnableWriteProtection(RTC); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LL_PWR_EnableSRAM2Retention +make: *** [Core/Src/subdir.mk:38: Core/Src/main.o] Error 1 +"make -j8 all" terminated with exit code 2. Build might be incomplete. diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.history/5e/406ca2737c29001b19c3e184f9ec9561 b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.history/5e/406ca2737c29001b19c3e184f9ec9561 new file mode 100644 index 0000000..7f70e86 --- /dev/null +++ b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.history/5e/406ca2737c29001b19c3e184f9ec9561 @@ -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 || expe == 4){ + CLK_TOGGLE(); + } +} + + + + +int main(void) +{ + + + // config GPIO + GPIO_init(); + +// if (RCC->BDCR & RCC_BDCR_LSEON) { + LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR ); + LL_PWR_EnableBkUpAccess(); + + //expe = register RTC + expe = RTC->BKP0R; + if (expe == 0) { + SystemClock_Config_24M_LSE(); + expe = 1; + LL_APB1_GRP1_EnableClock( LL_APB1_GRP1_PERIPH_PWR ); + LL_PWR_EnableBkUpAccess(); + RTC->BKP0R = expe; + } + + if (BLUE_BUTTON()){ + + expe ++; + + if (expe > 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(); + } +} diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.indexes/d5/0/be/properties.index b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.indexes/d5/0/be/properties.index index 417b19b31f557b8555781540cc3e19cecf4c880e..74b6e989e7f0bb8d442ce49dbd40ed6692c33f84 100644 GIT binary patch delta 38 rcmZ3*IGc%`k%57MiNSOtyAFFsVorQfN%BO?!ilUFtRM-7iRH!so`VQ_ delta 16 XcmbQuw2G0Hk%57MapG!=iFUaF9litr diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.indexes/d5/0/c4/properties.index b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.indexes/d5/0/c4/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..fc72c41ac3af9bec6a9af09735fad3642fda68d3 GIT binary patch literal 172 zcmYj}K?=e!5Je{*z&m(>3ACbXQNcw8Y26n|hcb{hWipZW_EO`*<$wSGX8^#!!Cr*l zB+)j{ds$Tbd2Vl~s?F3k;%wBREc{w{-zH@r(Sg~(F-VW(JWr7@G4iM+?&Y4K!OHxdiNRoEqVz?&Y4K!OEh+#9%NnQF@|B`{wUVs~FiCK!ExCC~5Mw9T8OSl{VTO4Ryo@Z@S zowdPnNJB)P`^ym3Qs5=%FjT~9Sd zY(o6XKW`kdSg~R9aG&|<zS+h!vOuD0R5!^?TiA@g=B8MR4#66<=n=)u4S~9?8A}W3Xq*wot)4| zf$Z7ja;BUa6w+-4>4ZpD96hzaC1t1kEp3R^Q!1V0(Kg}dwB50&L0vHw42$sY#Hf3= z;ZKjLd|oe>HGP>navW8}sDc7#F8Iq+uV9m!c#nCw4aCMWx=<;G(WPQ$?Me|`u;sI+ zmhkp$CERf~++sGe^-fR!$EJe}CcjYmsg0tj?}eBinuSVcHM>~|>Gfk@)HFR`%63DB z;5?%^f1@}Xqu~6}z?^eVM$~#2u34m^S2oL)ezaxLdjjW&srU1W`yIvoQXF0GRZtUZ zUL(*^BQFH(DhJZ)FlxJNgtvgB$Igd( zs`+##iamEFi zqy(-eY*FjL`;;sBBUgoK`3-G#n0G0q-le;WHS}fO*Up_$Q$K*%z18H-+r5P+ijL0O7*3_j>VI$YNZvX!K=q zOyl?Q5G|YWTvh~&5%WOb>iSA1ua|Rcx@c_~$Ah>bH1KlJyOSaf@<=pCLI3@M>1&oK zQz(E3cq`Kr4H`=P<`rp8k*1>{{qDe|v%Yra%2M?Eab8}_=-rr=@-QRniekK_7+?Qy z8LNpKkm^S{bayIZh{j$}jBUlZH44U`9kIp(y83|i@lE}r%E8Sb2V;N89K;^IZF^zV owr&0hwrz3of7^DzcuLz=n*8m@*Z;idf8qApy-(k{_4ZHy065TBi2wiq literal 0 HcmV?d00001 diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.syncinfo.snap b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RealOne/.syncinfo.snap new file mode 100644 index 0000000000000000000000000000000000000000..91d6c541512db06197e1b732473d567ce4b92d6a GIT binary patch literal 16 YcmZ?R*xjhShe1S2b=vdAllRF105-b@zW@LL literal 0 HcmV?d00001 diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap new file mode 100644 index 0000000000000000000000000000000000000000..91d6c541512db06197e1b732473d567ce4b92d6a GIT binary patch literal 16 YcmZ?R*xjhShe1S2b=vdAllRF105-b@zW@LL literal 0 HcmV?d00001 diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap new file mode 100644 index 0000000000000000000000000000000000000000..91d6c541512db06197e1b732473d567ce4b92d6a GIT binary patch literal 16 YcmZ?R*xjhShe1S2b=vdAllRF105-b@zW@LL literal 0 HcmV?d00001 diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap new file mode 100644 index 0000000000000000000000000000000000000000..91d6c541512db06197e1b732473d567ce4b92d6a GIT binary patch literal 16 YcmZ?R*xjhShe1S2b=vdAllRF105-b@zW@LL literal 0 HcmV?d00001 diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/3.tree b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/4.tree similarity index 97% rename from PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/3.tree rename to PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.root/4.tree index 54e77b2999d4ba73698eadf42d70dc528abffafa..c3eb0c58251dc477fc2fc114fb5348b08b32e0be 100644 GIT binary patch delta 35 lcmaEwbUKlTg_((o0Sq{LC-NAwGB7eRGHg84YQO>#1OR}71}y*p delta 190 zcmX?|_%w-!g_((o0SwrePUJDHXJTLvN=?l1&r4-6$}dXSOHIznEGSOZOHL`#%T3Hn zOixWoD$UGENiEV#&M!*UOHa+qP0UV(ia`v58DK$-0l~?Md3mWt&iQ$1ndwdf5VJw% aFtRW+Ffnd)YBdmH1o9XeASBodAOQfsLNy}* diff --git a/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/PlaygroundYoupi/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index 0646ac144b669251fd73879ba94a5baf06a0c960..18b9250ec430d8ea77c976c2ca86049dd8424154 100644 GIT binary patch delta 237 zcmeytdW2(wHiwb1m9dGHslntmj7pQW8965#GI>ru$H+GMFC*7venu@0QzH{g149dw z$&QSYKncx>e|dmvlqTyi@o?ztl@z6>+L}yGXSAi7Nk+oqsVNG6`DF@*77B(2RtBa( y1ascRZSHW_SulwM+1wKoWGAjwpZHHu3g#SMt^*OjKP&HH5RnS}+*7@~{1^b#cSkk= delta 192 zcmX@Y@q=}OHiw~sm5HU5sqth(W~Irem^H*xQj<#4^-42sONvTUdAaoUN{UibZH*^S zWRjZvnOSXOEzjgOX4%Qwj6BRh6%)7Uau}GIS{hpzn*o(b@+PO0=q2YDrGm9j&SkVk zw}E>yFQeSV;F@SzMZwl3Apen~khm$`h*MHISBv zu-Um87}$eL5{pVo3xMv#p)nGw@jH@6aiB(*qRg_?qGF&%k>C(tVWHHV#cWR*7viuH0bi%U>6 z?1pMMhNR&c0|OUK16t_pfGR%@q@l6Rb_%GxIKQ+gIkgxqFeQOjg8 - - + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration ModelMigrationProcessor.001 - + @@ -12,9 +12,9 @@ topLevel shellMaximized - - - + + + persp.actionSet:com.st.stm32cube.ide.mcu.informationcenter.actionSet3 persp.actionSet:org.eclipse.ui.cheatsheets.actionSet @@ -70,68 +70,70 @@ persp.viewSC:com.st.stm32cube.ide.mcu.buildanalyzer.view persp.viewSC:com.st.stm32cube.ide.mcu.stackanalyzer.stackanalyzer.view persp.viewSC:com.st.stm32cube.ide.mcu.sfrview - - - + + + active + noFocus + View categoryTag:General - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:General - - - - - + + + + + View categoryTag:General - + View categoryTag:General - + View categoryTag:Make - - - + + + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - - + + View categoryTag:C/C++ - + View categoryTag:C/C++ @@ -140,7 +142,7 @@ - + persp.actionSet:com.st.stm32cube.ide.mcu.informationcenter.actionSet3 persp.actionSet:org.eclipse.ui.cheatsheets.actionSet @@ -157,20 +159,20 @@ persp.actionSet:org.eclipse.debug.ui.launchActionSet persp.newWizSC:com.st.stm32cube.common.projectcreation.ui.stm32projectwizard persp.newWizSC:com.st.stm32cube.common.projectcreation.ui.stm32projectfromiocwizard - - - + + + View categoryTag:General active - - - - - - + + + + + + View categoryTag:Device Configuration Tool @@ -179,7 +181,7 @@ - + persp.actionSet:com.st.stm32cube.ide.mcu.informationcenter.actionSet3 persp.actionSet:org.eclipse.ui.cheatsheets.actionSet @@ -226,116 +228,116 @@ persp.viewSC:com.st.stm32cube.ide.mcu.livewatch.LiveExpressionsView persp.viewSC:com.st.stm32cube.ide.mcu.faultanalyzer.view persp.viewSC:com.st.stm32cube.ide.mcu.sfrview - - - + + + org.eclipse.e4.primaryNavigationStack - + View categoryTag:Debug - + View categoryTag:General - - + + View categoryTag:Debug - - - - + + + + org.eclipse.e4.secondaryNavigationStack - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + Debug - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug @@ -344,1953 +346,1960 @@ - - + + View categoryTag:Help - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:Help - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:Help - - + + org.eclipse.e4.primaryDataStack EditorStack - active - - + + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - active - activeOnClose - + Editor removeOnHide org.eclipse.cdt.ui.editor.asm.AsmEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor - + Editor removeOnHide org.eclipse.cdt.ui.editor.CEditor + + + Editor + removeOnHide + org.eclipse.cdt.ui.editor.CEditor + - + View categoryTag:General - + active + ViewMenu menuContribution:menu - + - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:General - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:Make - + ViewMenu menuContribution:menu - + - + View categoryTag:C/C++ - + ViewMenu menuContribution:menu - + - + View categoryTag:C/C++ - + ViewMenu menuContribution:menu - + - + View categoryTag:Device Configuration Tool - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - - + + toolbarSeparator - + - + Draggable - + - + toolbarSeparator - + - + Draggable - + toolbarSeparator - + - + Draggable - + Draggable - + Draggable - + Draggable - + toolbarSeparator - + - + Draggable - + - - toolbarSeparator - - - - toolbarSeparator - - - + Draggable - + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + stretch SHOW_RESTORE_MENU - + Draggable HIDEABLE SHOW_RESTORE_MENU - - + + stretch - + Draggable - + Draggable - - + + TrimStack Draggable - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - + + - - - - + + + + - - - + + + - - - - - + + + + + - - + + - - + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - - - + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + platform:win32 - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - + + + - - + + platform:win32 - - - - - - + + + + + + - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor removeOnHide - + View categoryTag:Device Configuration Tool - + View categoryTag:C/C++ - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:SWV - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Make - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Help - + View categoryTag:Connections - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Team - + View categoryTag:Team - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - - + + glue move_after:PerspectiveSpacer SHOW_RESTORE_MENU - + move_after:Spacer Glue HIDEABLE SHOW_RESTORE_MENU - + glue move_after:SearchField SHOW_RESTORE_MENU - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + - - + + - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PlaygroundYoupi/.metadata/version.ini b/PlaygroundYoupi/.metadata/version.ini index 1ba44d5..38dd9d8 100644 --- a/PlaygroundYoupi/.metadata/version.ini +++ b/PlaygroundYoupi/.metadata/version.ini @@ -1,3 +1,3 @@ -#Tue Nov 17 08:14:44 CET 2020 +#Wed Nov 18 09:40:21 CET 2020 org.eclipse.core.runtime=2 org.eclipse.platform=4.13.0.v20190916-1045 diff --git a/RealOne/Core/Src/main.c b/RealOne/Core/Src/main.c index 7f70e86..a6a5c53 100644 --- a/RealOne/Core/Src/main.c +++ b/RealOne/Core/Src/main.c @@ -290,3 +290,50 @@ void SystemClock_Config_80M(void) // Error_Handler(); } } + +// partie commune a toutes les utilisations du wakeup timer +static void RTC_wakeup_init( int delay ) +{ +LL_RTC_DisableWriteProtection( RTC ); +LL_RTC_WAKEUP_Disable( RTC ); +while ( !LL_RTC_IsActiveFlag_WUTW( RTC ) ) + { } +// connecter le timer a l'horloge 1Hz de la RTC +LL_RTC_WAKEUP_SetClock( RTC, LL_RTC_WAKEUPCLOCK_CKSPRE ); +// fixer la duree de temporisation +LL_RTC_WAKEUP_SetAutoReload( RTC, delay ); // 16 bits +LL_RTC_ClearFlag_WUT(RTC); +LL_RTC_EnableIT_WUT(RTC); +LL_RTC_WAKEUP_Enable(RTC); +LL_RTC_EnableWriteProtection(RTC); +} + +// Dans le cas des modes STANDBY et SHUTDOWN, le MPU sera reveille par reset +// causé par 1 wakeup line (interne ou externe) (le NVIC n'est plus alimenté) +void RTC_wakeup_init_from_standby_or_shutdown( int delay ) +{ +RTC_wakeup_init( delay ); +// enable the Internal Wake-up line +LL_PWR_EnableInternWU(); // ceci ne concerne que Standby et Shutdown, pas STOPx +} + +// Dans le cas des modes STOPx, le MPU sera reveille par interruption +// le module EXTI et une partie du NVIC sont encore alimentes +// le contenu de la RAM et des registres étant préservé, le MPU +// reprend l'execution après l'instruction WFI +void RTC_wakeup_init_from_stop( int delay ) +{ +RTC_wakeup_init( delay ); +// valider l'interrupt par la ligne 20 du module EXTI, qui est réservée au wakeup timer +LL_EXTI_EnableIT_0_31( LL_EXTI_LINE_20 ); +LL_EXTI_EnableRisingTrig_0_31( LL_EXTI_LINE_20 ); +// valider l'interrupt chez NVIC +NVIC_SetPriority( RTC_WKUP_IRQn, 1 ); +NVIC_EnableIRQ( RTC_WKUP_IRQn ); +} + +// wakeup timer interrupt Handler (inutile mais doit etre defini) +void RTC_WKUP_IRQHandler() +{ +LL_EXTI_ClearFlag_0_31( LL_EXTI_LINE_20 ); +} diff --git a/RealOne/Debug/Core/Src/main.su b/RealOne/Debug/Core/Src/main.su index 7c719f4..e69de29 100644 --- a/RealOne/Debug/Core/Src/main.su +++ b/RealOne/Debug/Core/Src/main.su @@ -1,34 +0,0 @@ -stm32l4xx_ll_rcc.h:2270:22:LL_RCC_LSE_Enable 4 static -stm32l4xx_ll_rcc.h:2316:22:LL_RCC_LSE_SetDriveCapability 16 static -stm32l4xx_ll_rcc.h:2362:26:LL_RCC_LSE_IsReady 4 static -stm32l4xx_ll_rcc.h:2489:22:LL_RCC_MSI_Enable 4 static -stm32l4xx_ll_rcc.h:2509:26:LL_RCC_MSI_IsReady 4 static -stm32l4xx_ll_rcc.h:2523:22:LL_RCC_MSI_EnablePLLMode 4 static -stm32l4xx_ll_rcc.h:2548:22:LL_RCC_MSI_EnableRangeSelection 4 static -stm32l4xx_ll_rcc.h:2581:22:LL_RCC_MSI_SetRange 16 static -stm32l4xx_ll_rcc.h:2656:22:LL_RCC_MSI_SetCalibTrimming 16 static -stm32l4xx_ll_rcc.h:2742:22:LL_RCC_SetSysClkSource 16 static -stm32l4xx_ll_rcc.h:2756:26:LL_RCC_GetSysClkSource 4 static -stm32l4xx_ll_rcc.h:2776:22:LL_RCC_SetAHBPrescaler 16 static -stm32l4xx_ll_rcc.h:2792:22:LL_RCC_SetAPB1Prescaler 16 static -stm32l4xx_ll_rcc.h:2808:22:LL_RCC_SetAPB2Prescaler 16 static -stm32l4xx_ll_rcc.h:3650:22:LL_RCC_SetRTCClockSource 16 static -stm32l4xx_ll_rcc.h:3674:22:LL_RCC_EnableRTC 4 static -stm32l4xx_ll_rcc.h:3714:22:LL_RCC_ReleaseBackupDomainReset 4 static -stm32l4xx_ll_rcc.h:3733:22:LL_RCC_PLL_Enable 4 static -stm32l4xx_ll_rcc.h:3754:26:LL_RCC_PLL_IsReady 4 static -stm32l4xx_ll_rcc.h:3800:22:LL_RCC_PLL_ConfigDomain_SYS 24 static -stm32l4xx_ll_rcc.h:4178:22:LL_RCC_PLL_EnableDomain_SYS 4 static -stm32l4xx_ll_bus.h:1089:22:LL_APB1_GRP1_EnableClock 24 static -stm32l4xx_ll_system.h:1400:22:LL_FLASH_SetLatency 16 static -stm32l4xx_ll_system.h:1428:26:LL_FLASH_GetLatency 4 static -stm32l4xx_ll_cortex.h:272:22:LL_SYSTICK_EnableIT 4 static -stm32l4xx_ll_cortex.h:310:22:LL_LPM_EnableSleep 4 static -stm32l4xx_ll_pwr.h:344:22:LL_PWR_SetRegulVoltageScaling 16 static -stm32l4xx_ll_pwr.h:398:22:LL_PWR_EnableBkUpAccess 4 static -stm32l4xx_ll_pwr.h:408:22:LL_PWR_DisableBkUpAccess 4 static -main.c:20:6:SysTick_Handler 8 static -main.c:41:5:main 8 static,ignoring_inline_asm -main.c:116:6:SystemClock_Config_24M_LSE_FL3_VS2 8 static -main.c:184:6:SystemClock_Config_24M_LSE 8 static -main.c:249:6:SystemClock_Config_80M 8 static