From 94a40d8833653fbcf9ef26020ba454ec9202112a Mon Sep 17 00:00:00 2001 From: bvernoux Date: Mon, 22 Aug 2022 13:11:46 +0200 Subject: [PATCH] HydraUSB3_USB_benchmark v1.0.1 Force USB3 Bulk endpoint2 to 4 burst (as 8burst or more have issue on some PC with USB3) --- HydraUSB3_USB_benchmark/HydraUSB3_USB_benchmark.c | 6 +++--- HydraUSB3_USB_benchmark/Makefile | 2 +- libusb_portable/libusb_portable.c | 8 ++++++-- libusb_portable/libusb_portable.h | 7 ++++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/HydraUSB3_USB_benchmark/HydraUSB3_USB_benchmark.c b/HydraUSB3_USB_benchmark/HydraUSB3_USB_benchmark.c index a3689f9..863adf0 100644 --- a/HydraUSB3_USB_benchmark/HydraUSB3_USB_benchmark.c +++ b/HydraUSB3_USB_benchmark/HydraUSB3_USB_benchmark.c @@ -1,8 +1,8 @@ /********************************** (C) COPYRIGHT ******************************* * File Name : HydraUSB3_USB_benchmark.c * Author : bvernoux -* Version : V1.0 -* Date : 2022/08/20 +* Version : V1.0.1 +* Date : 2022/08/22 * Description : * Copyright (c) 2022 Benjamin VERNOUX * SPDX-License-Identifier: Apache-2.0 @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) } log_printf_init(pFile); - log_printf("HydraUSB3_USB_benchmark v%s B.VERNOUX 20-Aug-2022\n", VERSION); + log_printf("HydraUSB3_USB_benchmark v%s B.VERNOUX 22-Aug-2022\n", VERSION); log_printf("Options: verbose=%d\n", config.verbose); diff --git a/HydraUSB3_USB_benchmark/Makefile b/HydraUSB3_USB_benchmark/Makefile index ee259cd..c71b1e3 100644 --- a/HydraUSB3_USB_benchmark/Makefile +++ b/HydraUSB3_USB_benchmark/Makefile @@ -1,4 +1,4 @@ -VERSION = 1.0.0 +VERSION = 1.0.1 # Install paths PREFIX = /usr/local diff --git a/libusb_portable/libusb_portable.c b/libusb_portable/libusb_portable.c index 180d345..73d5344 100644 --- a/libusb_portable/libusb_portable.c +++ b/libusb_portable/libusb_portable.c @@ -1,8 +1,8 @@ /********************************** (C) COPYRIGHT ******************************* * File Name : libusb_portable.c * Author : bvernoux -* Version : V1.0 -* Date : 2022/08/20 +* Version : V1.0.1 +* Date : 2022/08/22 * Description : * Copyright (c) 2022 Benjamin VERNOUX * SPDX-License-Identifier: Apache-2.0 @@ -127,9 +127,11 @@ void log_printf_dbg(const char* fmt, ...) va_start(args, fmt); vfprintf(stdout, fmt, args); + fflush(stdout); if(pFile != NULL) { vfprintf(pFile, fmt, args); + fflush(pFile); } va_end(args); } @@ -140,9 +142,11 @@ void log_printf(const char* fmt, ...) va_start(args, fmt); vfprintf(stdout, fmt, args); + fflush(stdout); if(pFile != NULL) { vfprintf(pFile, fmt, args); + fflush(pFile); } va_end(args); } diff --git a/libusb_portable/libusb_portable.h b/libusb_portable/libusb_portable.h index f1dbbf5..f776049 100644 --- a/libusb_portable/libusb_portable.h +++ b/libusb_portable/libusb_portable.h @@ -1,8 +1,8 @@ /********************************** (C) COPYRIGHT ******************************* * File Name : libusb_portable.h * Author : bvernoux -* Version : V1.0 -* Date : 2022/08/20 +* Version : V1.0.1 +* Date : 2022/08/22 * Description : * Copyright (c) 2022 Benjamin VERNOUX * SPDX-License-Identifier: Apache-2.0 @@ -28,7 +28,8 @@ extern "C" #define LIBUSB_BULK_TRANSFER_TIMEOUT_MILLISEC (2000) #define USB3_EP1_BULK_BURST_SIZE (4*1024) // This size corresponds to USB3 EP1 Bulk with 4 burst(so 4x1024 bytes) -#define USB3_EP2_BULK_BURST_SIZE (8*1024) // This size corresponds to USB3 EP2 Bulk with 8 burst(so 8x1024 bytes) +// Warning USB3 enpoint 2 bulk with 8 or 16 burst can be problematic on some PC so default is set to 4 +#define USB3_EP2_BULK_BURST_SIZE (4*1024) // This size corresponds to USB3 EP2 Bulk with 4 burst(so 4x1024 bytes) #define USB2_BULK_SIZE 512 uint32_t swap_uint32(uint32_t val);