diff --git a/source/FreeRTOS_IP.c b/source/FreeRTOS_IP.c index d2fc0cbeb..7883e40de 100644 --- a/source/FreeRTOS_IP.c +++ b/source/FreeRTOS_IP.c @@ -418,8 +418,9 @@ static void prvProcessIPEventsAndTimers( void ) /* The network stack has generated a packet to send. A * pointer to the generated buffer is located in the pvData * member of the received event structure. */ + LOG_SYSCLK_COUNT; // vProcessGeneratedUDPPacket( ( NetworkBufferDescriptor_t * ) xReceivedEvent.pvData ); - + LOG_SYSCLK_COUNT; if( request_stat == 1 ) { vGetTxLatency( uiMeasureCycleCountStop( &TxCycleCountData ) ); diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index 6595a6eb2..d089f123e 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -1443,12 +1443,16 @@ static int32_t prvSendUDPPacket( const FreeRTOS_Socket_t * pxSocket, xStackTxEvent.pvData = pxNetworkBuffer; /* Ask the IP-task to send this packet */ + LOG_SYSCLK_COUNT; // 2 + #if ( ipconfigRAW_PACKETS == 1 ) if( ( ( UBaseType_t ) xFlags & ( UBaseType_t ) FREERTOS_AF_RAW ) != 0U ) { /* The packet was successfully sent to the IP task. */ lReturn = ( int32_t ) uxTotalDataLength; + LOG_SYSCLK_COUNT; // 1 vProcessGeneratedUDPPacket( pxNetworkBuffer ); + LOG_SYSCLK_COUNT; // 2 } else #endif @@ -1596,6 +1600,10 @@ int32_t FreeRTOS_sendto( Socket_t xSocket, size_t uxMaxPayloadLength = 0; size_t uxPayloadOffset = 0; + LOG_SYSCLK_COUNT_RESET; + + LOG_SYSCLK_COUNT; // 0 + #if ( ipconfigIPv4_BACKWARD_COMPATIBLE == 1 ) struct freertos_sockaddr xTempDestinationAddress; @@ -1663,6 +1671,14 @@ int32_t FreeRTOS_sendto( Socket_t xSocket, } } + LOG_SYSCLK_COUNT; // 3 + + extern uint32_t time_logger[], time_logg_cntr; + for(int i = 0; i < time_logg_cntr; ++i) + { + FreeRTOS_debug_printf(("ID: %d Timestamp: %u Delta: %u \r\n", i , time_logger[i], i == 0 ? 0 : time_logger[i] - time_logger[i-1])); + } + return lReturn; } /* Tested */ /*-----------------------------------------------------------*/ diff --git a/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c b/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c index 3197b8594..3e734b1db 100644 --- a/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c +++ b/source/portable/NetworkInterface/STM32Fxx/NetworkInterface.c @@ -799,7 +799,7 @@ static BaseType_t xSTM32F_NetworkInterfaceOutput( NetworkInterface_t * pxInterfa /* As there is only a single instance of the EMAC, there is only one pxInterface object. */ ( void ) pxInterface; - xSemaphoreTake(xTXNetworkInterfaceOutSem, portMAX_DELAY); + //xSemaphoreTake(xTXNetworkInterfaceOutSem, portMAX_DELAY); /* Open a do {} while ( 0 ) loop to be able to call break. */ do @@ -944,7 +944,7 @@ static BaseType_t xSTM32F_NetworkInterfaceOutput( NetworkInterface_t * pxInterfa vReleaseNetworkBufferAndDescriptor( pxDescriptor ); } - xSemaphoreGive(xTXNetworkInterfaceOutSem); + //xSemaphoreGive(xTXNetworkInterfaceOutSem); return xReturn; }