![]() * dropped because of memory failure (except for the TCP timers). * to become availale since the stack doesn't retry to send a packet You might consider waiting for space in the DMA queue * Returning ERR_MEM here if a DMA queue of your MAC is full can lead to ![]() * an err_t value if the packet couldn't be sent IP packet including MAC addresses and type) * netif the lwip network interface structure for this ethernetif * contained in the pbuf that is passed to the function. * This function should do the actual transmission of the packet. * Enable MAC and DMA transmission and reception */ netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP * don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ HAL_ETH_DMARxDescListInit(&heth, DMARxDscrTab, &Rx_Buff, ETH_RXBUFNB) * Initialize Rx Descriptors list: Chain Mode */ HAL_ETH_DMATxDescListInit(&heth, DMATxDscrTab, &Tx_Buff, ETH_TXBUFNB) * Initialize Tx Descriptors list: Chain Mode */ heth.Instance->DMAOMR = ETH_DMAOMR_RSF | ETH_DMAOMR_TSF heth.Instance->MACFFR = ETH_MACFFR_HPF | ETH_MACFFR_HM hal_eth_init_status = HAL_ETH_Init(&heth) static void stm32f7_low_level_init(struct netif *netif) * netif the already initialized lwip network interface structure * In this function, the hardware should be initialized. void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth) * Ethernet Rx Transfer completed callback ![]() HAL_GPIO_DeInit(GPIOG, GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13) HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7) ![]() HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5) void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth) HAL_NVIC_SetPriority(ETH_IRQn, 0x7, 0) * Enable the Ethernet global Interrupt */ GPIO_InitStructure.Pin = GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13 HAL_GPIO_Init(GPIOC, &GPIO_InitStructure) GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5 HAL_GPIO_Init(GPIOB, &GPIO_InitStructure) HAL_GPIO_Init(GPIOA, &GPIO_InitStructure) GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7 GPIO_InitStructure.Alternate = GPIO_AF11_ETH GPIO_InitStructure.Mode = GPIO_MODE_AF_PP GPIO_InitStructure.Speed = GPIO_SPEED_HIGH void HAL_ETH_MspInit(ETH_HandleTypeDef* heth) static err_t stm32f7_low_level_output(struct netif *netif, struct pbuf *p) static err_t stm32f7_etharp_output(struct netif *netif, struct pbuf *q, ip_addr_t *ipaddr) static void stm32f7_phy_task(void *arg) static sys_sem_t rx_ready_sem /* receive ready semaphore */ _ALIGN_BEGIN uint8_t Tx_Buff _ALIGN_END /* Ethernet Transmit Buffer */ ![]() _ALIGN_BEGIN ETH_DMADescTypeDef DMATxDscrTab _ALIGN_END /* Ethernet Tx DMA Descriptor */ _ALIGN_BEGIN uint8_t Rx_Buff _ALIGN_END /* Ethernet Receive Buffer */ _ALIGN_BEGIN ETH_DMADescTypeDef DMARxDscrTab _ALIGN_END /* Ethernet Rx MA Descriptor */ ** lwipstm32f7xx_emac_DRIVER stm32f7 EMAC driver for LWIP ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |