cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong code in stm32f4xx_ll_usb.c line 2004

cs
Associate III

Hello,

In this file, the line:

USBx_HC((uint32_t)ch_num)->HCSPLT |= USB_OTG_HCSPLT_XACTPOS_Pos;

wrongly alters bits 1 to 3 of register HCSPLT

That can be fixed simply by removing this line, since middle payload is encoded by bits 00 in the XACTPOS field.

 

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @cs 

I assume middle payload must be encoded as 00 as described in register description fields

An internal ticket CDM0062710   is submitted to dedicated team to report this potential bug.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL

View solution in original post

3 REPLIES 3
Pavel A.
Super User

Link to the source:

https://github.com/STMicroelectronics/stm32f4xx-hal-driver/blob/61d71646b8e8d7ff76404fbbc95f03d38bcaa938/Src/stm32f4xx_ll_usb.c#L2004

Do you mean that these bits should not be touched after assignment to HCSPLT in line 1972 ?

 

Exactly same code for STM32H7 , here,   here

Exactly same code for STM32H5,  here.

Possibly in other MCUs too.

@mƎALLEm 

 

 

cs
Associate III

Yes, it's what I think. The coding style here is to set appropriate bits to one in the XACTPOS field, and all XACTPOS bits are zero for middle payload.

FBL
ST Employee

Hi @cs 

I assume middle payload must be encoded as 00 as described in register description fields

An internal ticket CDM0062710   is submitted to dedicated team to report this potential bug.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL