diff --git a/project/Core/Inc/stm32f7xx_it.h b/project/Core/Inc/stm32f7xx_it.h index 13d4b27..1441fef 100644 --- a/project/Core/Inc/stm32f7xx_it.h +++ b/project/Core/Inc/stm32f7xx_it.h @@ -47,6 +47,7 @@ /* Exported functions prototypes ---------------------------------------------*/ void TIM1_UP_TIM10_IRQHandler(void); +void ETH_IRQHandler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ diff --git a/project/Core/Src/main.c b/project/Core/Src/main.c index 7cbc6f6..73e069d 100644 --- a/project/Core/Src/main.c +++ b/project/Core/Src/main.c @@ -147,7 +147,7 @@ int main(void) { /* Create the thread(s) */ /* definition and creation of app */ - osThreadDef(app, app_main, osPriorityNormal, 0, 128); + osThreadDef(app, app_main, osPriorityNormal, 0, 1024); appHandle = osThreadCreate(osThread(app), NULL); /* USER CODE BEGIN RTOS_THREADS */ diff --git a/project/Core/Src/stm32f7xx_it.c b/project/Core/Src/stm32f7xx_it.c index 023205e..2d00e89 100644 --- a/project/Core/Src/stm32f7xx_it.c +++ b/project/Core/Src/stm32f7xx_it.c @@ -55,6 +55,7 @@ /* USER CODE END 0 */ /* External variables --------------------------------------------------------*/ +extern ETH_HandleTypeDef heth; extern TIM_HandleTypeDef htim1; /* USER CODE BEGIN EV */ @@ -86,6 +87,20 @@ void TIM1_UP_TIM10_IRQHandler(void) /* USER CODE END TIM1_UP_TIM10_IRQn 1 */ } +/** + * @brief This function handles Ethernet global interrupt. + */ +void ETH_IRQHandler(void) +{ + /* USER CODE BEGIN ETH_IRQn 0 */ + + /* USER CODE END ETH_IRQn 0 */ + HAL_ETH_IRQHandler(&heth); + /* USER CODE BEGIN ETH_IRQn 1 */ + + /* USER CODE END ETH_IRQn 1 */ +} + /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ diff --git a/project/LWIP/Target/ethernetif.c b/project/LWIP/Target/ethernetif.c index 87c8826..c0f67cc 100644 --- a/project/LWIP/Target/ethernetif.c +++ b/project/LWIP/Target/ethernetif.c @@ -623,6 +623,9 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef* ethHandle) GPIO_InitStruct.Alternate = GPIO_AF11_ETH; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + /* Peripheral interrupt init */ + HAL_NVIC_SetPriority(ETH_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(ETH_IRQn); /* USER CODE BEGIN ETH_MspInit 1 */ /* USER CODE END ETH_MspInit 1 */ @@ -656,6 +659,9 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* ethHandle) HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7); + /* Peripheral interrupt Deinit*/ + HAL_NVIC_DisableIRQ(ETH_IRQn); + /* USER CODE BEGIN ETH_MspDeInit 1 */ /* USER CODE END ETH_MspDeInit 1 */ diff --git a/project/project.ioc b/project/project.ioc index 191e812..8918781 100644 --- a/project/project.ioc +++ b/project/project.ioc @@ -8,7 +8,7 @@ ETH.MediaInterface=HAL_ETH_RMII_MODE ETH.PhyAddress=0 FREERTOS.FootprintOK=true FREERTOS.IPParameters=Tasks01,configUSE_NEWLIB_REENTRANT,FootprintOK -FREERTOS.Tasks01=app,0,128,app_main,As weak,NULL,Dynamic,NULL,NULL +FREERTOS.Tasks01=app,0,1024,app_main,As weak,NULL,Dynamic,NULL,NULL FREERTOS.configUSE_NEWLIB_REENTRANT=1 File.Version=6 KeepUserPlacement=true @@ -184,6 +184,7 @@ MxCube.Version=6.8.1 MxDb.Version=DB.6.0.81 NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:false\:false\:true\:false\:false NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:false\:false\:true\:false\:false +NVIC.ETH_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true NVIC.ForceEnableDMAVector=true NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:false\:false\:true\:false\:false NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false\:false\:true\:false\:false