Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qitas committed Oct 29, 2021
1 parent c2f45aa commit 13680d7
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 142 deletions.
6 changes: 3 additions & 3 deletions project/IAP/.mxproject

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions project/IAP/Core/Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ void Error_Handler(void);
#define LED1_Pin LL_GPIO_PIN_4
#define LED1_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
extern IWDG_HandleTypeDef hiwdg;
#define feed_dog() HAL_IWDG_Refresh(&hiwdg) //LL_IWDG_ReloadCounter(IWDG) //LL_mDelay(0) //
// extern IWDG_HandleTypeDef hiwdg;
#define feed_dog() LL_mDelay(0) //LL_IWDG_ReloadCounter(IWDG) //HAL_IWDG_Refresh(&hiwdg) //
/* USER CODE END Private defines */

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion project/IAP/Core/Inc/stm32g0xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extern "C" {
/* #define HAL_HCD_MODULE_ENABLED */
/* #define HAL_I2C_MODULE_ENABLED */
/* #define HAL_I2S_MODULE_ENABLED */
#define HAL_IWDG_MODULE_ENABLED
/* #define HAL_IWDG_MODULE_ENABLED */
/* #define HAL_IRDA_MODULE_ENABLED */
/* #define HAL_LPTIM_MODULE_ENABLED */
/* #define HAL_PCD_MODULE_ENABLED */
Expand Down
1 change: 1 addition & 0 deletions project/IAP/Core/Inc/stm32g0xx_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void HardFault_Handler(void);
void SVC_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void FLASH_IRQHandler(void);
void EXTI4_15_IRQHandler(void);
void USART1_IRQHandler(void);
/* USER CODE BEGIN EFP */
Expand Down
32 changes: 0 additions & 32 deletions project/IAP/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/
IWDG_HandleTypeDef hiwdg;

/* USER CODE BEGIN PV */

Expand All @@ -55,7 +54,6 @@ void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_USART1_UART_Init(void);
static void MX_RTC_Init(void);
static void MX_IWDG_Init(void);
/* USER CODE BEGIN PFP */

/* USER CODE END PFP */
Expand Down Expand Up @@ -107,7 +105,6 @@ int main(void)
MX_GPIO_Init();
MX_USART1_UART_Init();
MX_RTC_Init();
MX_IWDG_Init();
/* USER CODE BEGIN 2 */
uart_init();
char buf[50];
Expand Down Expand Up @@ -251,35 +248,6 @@ void SystemClock_Config(void)
LL_RCC_SetUSARTClockSource(LL_RCC_USART1_CLKSOURCE_PCLK1);
}

/**
* @brief IWDG Initialization Function
* @param None
* @retval None
*/
static void MX_IWDG_Init(void)
{

/* USER CODE BEGIN IWDG_Init 0 */

/* USER CODE END IWDG_Init 0 */

/* USER CODE BEGIN IWDG_Init 1 */

/* USER CODE END IWDG_Init 1 */
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_4;
hiwdg.Init.Window = 4095;
hiwdg.Init.Reload = 4095;
if (HAL_IWDG_Init(&hiwdg) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN IWDG_Init 2 */

/* USER CODE END IWDG_Init 2 */

}

/**
* @brief RTC Initialization Function
* @param None
Expand Down
5 changes: 5 additions & 0 deletions project/IAP/Core/Src/stm32g0xx_hal_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ void HAL_MspInit(void)

/* System interrupt init*/

/* Peripheral interrupt init */
/* FLASH_IRQn interrupt configuration */
HAL_NVIC_SetPriority(FLASH_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(FLASH_IRQn);

/* USER CODE BEGIN MspInit 1 */

/* USER CODE END MspInit 1 */
Expand Down
14 changes: 14 additions & 0 deletions project/IAP/Core/Src/stm32g0xx_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ void SysTick_Handler(void)
/* please refer to the startup file (startup_stm32g0xx.s). */
/******************************************************************************/

/**
* @brief This function handles Flash global interrupt.
*/
void FLASH_IRQHandler(void)
{
/* USER CODE BEGIN FLASH_IRQn 0 */

/* USER CODE END FLASH_IRQn 0 */
HAL_FLASH_IRQHandler();
/* USER CODE BEGIN FLASH_IRQn 1 */

/* USER CODE END FLASH_IRQn 1 */
}

/**
* @brief This function handles EXTI line 4 to 15 interrupts.
*/
Expand Down
25 changes: 11 additions & 14 deletions project/IAP/IAP.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ File.Version=6
GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false
Mcu.Family=STM32G0
Mcu.IP0=IWDG
Mcu.IP1=NVIC
Mcu.IP2=RCC
Mcu.IP3=RTC
Mcu.IP4=SYS
Mcu.IP5=USART1
Mcu.IPNb=6
Mcu.IP0=NVIC
Mcu.IP1=RCC
Mcu.IP2=RTC
Mcu.IP3=SYS
Mcu.IP4=USART1
Mcu.IPNb=5
Mcu.Name=STM32G030C(6-8)Tx
Mcu.Package=LQFP48
Mcu.Pin0=PC13
Expand All @@ -18,16 +17,16 @@ Mcu.Pin2=PA10
Mcu.Pin3=PA13
Mcu.Pin4=PA14-BOOT0
Mcu.Pin5=PB4
Mcu.Pin6=VP_IWDG_VS_IWDG
Mcu.Pin7=VP_RTC_VS_RTC_Activate
Mcu.Pin8=VP_SYS_VS_Systick
Mcu.PinsNb=9
Mcu.Pin6=VP_RTC_VS_RTC_Activate
Mcu.Pin7=VP_SYS_VS_Systick
Mcu.PinsNb=8
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32G030C8Tx
MxCube.Version=6.3.0
MxDb.Version=DB.6.0.30
NVIC.EXTI4_15_IRQn=true\:0\:0\:false\:false\:true\:true\:true
NVIC.FLASH_IRQn=true\:0\:0\:false\:false\:true\:true\:true
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false
Expand Down Expand Up @@ -80,7 +79,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5.32
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-SystemClock_Config-RCC-false-LL-false,3-MX_USART1_UART_Init-USART1-false-LL-true,4-MX_RTC_Init-RTC-false-LL-true,5-MX_IWDG_Init-IWDG-false-HAL-true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-LL-true,2-SystemClock_Config-RCC-false-LL-false,3-MX_USART1_UART_Init-USART1-false-LL-true,4-MX_RTC_Init-RTC-false-LL-true,5-MX_IWDG_Init-IWDG-false-LL-true
RCC.ADCFreq_Value=64000000
RCC.AHBFreq_Value=64000000
RCC.APBFreq_Value=64000000
Expand Down Expand Up @@ -111,8 +110,6 @@ SH.GPXTI13.0=GPIO_EXTI13
SH.GPXTI13.ConfNb=1
USART1.IPParameters=VirtualMode-Asynchronous
USART1.VirtualMode-Asynchronous=VM_ASYNC
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
VP_SYS_VS_Systick.Mode=SysTick
Expand Down
22 changes: 5 additions & 17 deletions project/IAP/MDK-ARM/IAP.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c</PathWithFileName>
<FilenameWithoutPath>stm32g0xx_hal_iwdg.c</FilenameWithoutPath>
<PathWithFileName>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</PathWithFileName>
<FilenameWithoutPath>stm32g0xx_ll_rtc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
Expand Down Expand Up @@ -944,26 +944,14 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</PathWithFileName>
<FilenameWithoutPath>stm32g0xx_ll_rtc.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.c</PathWithFileName>
<FilenameWithoutPath>stm32g0xx_hal_tim.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>29</FileNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
Expand All @@ -975,7 +963,7 @@
</File>
<File>
<GroupNumber>4</GroupNumber>
<FileNumber>30</FileNumber>
<FileNumber>29</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
Expand All @@ -995,7 +983,7 @@
<RteFlg>0</RteFlg>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>31</FileNumber>
<FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
Expand Down
80 changes: 7 additions & 73 deletions project/IAP/MDK-ARM/IAP.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
<MiscControls></MiscControls>
<Define>STM32G030xx,BLT,USE_FULL_LL_DRIVER,USE_HAL_DRIVER</Define>
<Undefine></Undefine>
<IncludePath>../Core/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc; ../Drivers/CMSIS/Device/ST/STM32G0xx/Include; ../Drivers/CMSIS/Include; ..\User\Inc; ..\User\Src;../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy</IncludePath>
<IncludePath>../Core/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc; ../Drivers/CMSIS/Device/ST/STM32G0xx/Include; ../Drivers/CMSIS/Include; ..\User\Inc; ..\User\Src; ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy</IncludePath>
</VariousControls>
</Cads>
<Aads>
Expand Down Expand Up @@ -658,9 +658,9 @@
</FileOption>
</File>
<File>
<FileName>stm32g0xx_hal_iwdg.c</FileName>
<FileName>stm32g0xx_ll_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c</FilePath>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
Expand Down Expand Up @@ -1395,62 +1395,6 @@
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>stm32g0xx_ll_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>2</AlwaysBuild>
<GenerateAssemblyFile>2</GenerateAssemblyFile>
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
<Cads>
<interw>2</interw>
<Optim>0</Optim>
<oTime>2</oTime>
<SplitLS>2</SplitLS>
<OneElfS>2</OneElfS>
<Strict>2</Strict>
<EnumInt>2</EnumInt>
<PlainCh>2</PlainCh>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<wLevel>0</wLevel>
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>stm32g0xx_hal_tim.c</FileName>
<FileType>1</FileType>
Expand Down Expand Up @@ -2084,9 +2028,9 @@
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_gpio.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_hal_iwdg.c</FileName>
<FileName>stm32g0xx_ll_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c</FilePath>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_ll_rcc.c</FileName>
Expand Down Expand Up @@ -2158,11 +2102,6 @@
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_ll_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_hal_tim.c</FileName>
<FileType>1</FileType>
Expand Down Expand Up @@ -2712,9 +2651,9 @@
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_gpio.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_hal_iwdg.c</FileName>
<FileName>stm32g0xx_ll_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_iwdg.c</FilePath>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_ll_rcc.c</FileName>
Expand Down Expand Up @@ -2786,11 +2725,6 @@
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_ll_rtc.c</FileName>
<FileType>1</FileType>
<FilePath>../Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_ll_rtc.c</FilePath>
</File>
<File>
<FileName>stm32g0xx_hal_tim.c</FileName>
<FileType>1</FileType>
Expand Down

0 comments on commit 13680d7

Please sign in to comment.