в обработчике прерывания еth только чтения причины и отпускание
семафора
inline void eth_irq_handler() { ETH_HandleTypeDef* heth = &EthHandle ; BaseType_t higher_priority_task_woken ; if (__HAL_ETH_DMA_GET_IT(heth, ETH_DMACSR_RI)) // Packet received if (__HAL_ETH_DMA_GET_IT_SOURCE(heth, ETH_DMACIER_RIE)) { __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMACSR_RI | ETH_DMACSR_NIS); // Clear the Eth DMA Rx IT pending bits eth_rx_semaphore_give_fFrom_isr(&higher_priority_task_woken); } if (__HAL_ETH_DMA_GET_IT(heth, ETH_DMACSR_TI)) // Packet transmitted if (__HAL_ETH_DMA_GET_IT_SOURCE(heth, ETH_DMACIER_TIE)) { __HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMACSR_TI | ETH_DMACSR_NIS); // Clear the Eth DMA Tx IT pending bits eth_tx_semaphore_give_fFrom_isr(&higher_priority_task_woken); } if (__HAL_ETH_DMA_GET_IT(heth, ETH_DMACSR_AIS)) // ETH DMA Error { if (__HAL_ETH_DMA_GET_IT_SOURCE(heth, ETH_DMACIER_AIE)) { heth->ErrorCode |= HAL_ETH_ERROR_DMA; if (__HAL_ETH_DMA_GET_IT(heth, ETH_DMACSR_FBE)) // if fatal bus error occurred { heth->DMAErrorCode = READ_BIT(heth->Instance->DMACSR, (ETH_DMACSR_FBE | ETH_DMACSR_TPS | ETH_DMACSR_RPS)); // Get DMA error code __HAL_ETH_DMA_DISABLE_IT(heth, ETH_DMACIER_NIE | ETH_DMACIER_AIE); // Disable all interrupts heth->gState = HAL_ETH_STATE_ERROR; // Set HAL state to ERROR } else { heth->DMAErrorCode = READ_BIT(heth->Instance->DMACSR, (ETH_DMACSR_CDE | ETH_DMACSR_ETI | ETH_DMACSR_RWT | ETH_DMACSR_RBU | ETH_DMACSR_AIS)); // Get DMA error status __HAL_ETH_DMA_CLEAR_IT(heth, (ETH_DMACSR_CDE | ETH_DMACSR_ETI | ETH_DMACSR_RWT | ETH_DMACSR_RBU | ETH_DMACSR_AIS)); // Clear the interrupt summary flag } if((HAL_ETH_GetDMAError(heth) & ETH_DMACSR_RBU) == ETH_DMACSR_RBU) eth_rx_semaphore_give_fFrom_isr(&higher_priority_task_woken); } } scheduler_t::yeld_from_isr( higher_priority_task_woken ) ; }