Closed DedkovArtem closed 1 year ago
ST Internal Reference: 128000
Hi @DedkovArtem,
There is actually no use of the osSemaphoreAcquire()
within the function err_t low_level_output()
as part of the ethernetif.c, the below instruction is rather used:
Moreover, TxPktSemaphore and RxPktSemaphore are by default set to 0, we have double checked and low_level_output()
and low_level_input()
are not passing instantly.
I guess you are not using the newest version of the STM32CubeF4. Would you please try to the latest one and check if you are still having the same issue. Meanwhile, please allow me to close this thread. You may reopen it at anytime if you have any details to share with us in order to help you to solve the issue. Thank you for your comprehension.
With regards,
Describe the set-up
Describe the bug The first packet sent is released without waiting for the end of sending.
How To Reproduce In the ethernetif.c file in the procedure _static err_t low_leveloutput(struct netif netif, struct pbuf p) cycle
while(osSemaphoreAcquire(TxPktSemaphore, TIME_WAITING_FOR_INPUT)!=osOK);
passes instantly, because semaphore TxPktSemaphore created with initialization value = 1, and there is no interrupt waiting on sending the first packetAdditional context It seems to me more correct when creating a semaphore in a procedure _static void low_levelinit(struct netif *netif) create a semaphore with initialization value = 0
TxPktSemaphore = osSemaphoreNew(1, 0, NULL);
The RxPktSemaphore semaphore has a similar problem. The semaphore must be released by the received frame, not by the procedure that creates the semaphore. Respectively, it is more correct to create a semaphore for receiving, with initialization value = 0
RxPktSemaphore = osSemaphoreNew(1, 0, NULL);