diff --git a/os/hal/ports/STM32/LLD/USBv1/stm32_usb.h b/os/hal/ports/STM32/LLD/USBv1/stm32_usb.h index 8e47136f1..9acf0686f 100644 --- a/os/hal/ports/STM32/LLD/USBv1/stm32_usb.h +++ b/os/hal/ports/STM32/LLD/USBv1/stm32_usb.h @@ -112,6 +112,8 @@ typedef struct { * @name Register aliases * @{ */ +#define RXCOUNT1 TXCOUNT0 +#define TXCOUNT1 RXCOUNT0 #define RXADDR1 TXADDR0 #define TXADDR1 RXADDR0 /** @} */ @@ -247,7 +249,7 @@ typedef struct { */ #define USB_GET_DESCRIPTOR(ep) \ ((stm32_usb_descriptor_t *)((uint32_t)STM32_USBRAM_BASE + \ - (uint32_t)STM32_USB->BTABLE * 2 + \ + (uint32_t)STM32_USB->BTABLE + \ (uint32_t)(ep) * \ sizeof(stm32_usb_descriptor_t))) diff --git a/readme.txt b/readme.txt index 6266a2b42..07ff70285 100644 --- a/readme.txt +++ b/readme.txt @@ -141,6 +141,8 @@ (backported to 3.0.3). - HAL: Fixed RTC module loses day of week when converting (bug #664) (backported to 3.0.3). +- HAL: Fixed STM32 USBv1 wrong multiplier when calculating descriptor address + in BTABLE (bug #661)(backported to 3.0.4 and 2.6.10). - HAL: Fixed STM32 USBv1 does not make use of BTABLE_ADDR define (bug #660) (backported to 3.0.4 and 2.6.10). - HAL: Fixed invalid class type for sdPutWouldBlock() and sdGetWouldBlock()