2020-07-02 04:18 AM
Hello,
STM32Cube_FW_F7_V1.16.0 Drivers/CMSIS/Device/ST/STM32F7xx/Include/stm32f730xx.h
defines
#define USB_HS_PHYC_LDO_ENABLE_Pos USB_HS_PHYC_LDO_DISABLE_Pos
#define USB_HS_PHYC_LDO_ENABLE_Msk USB_HS_PHYC_LDO_DISABLE_Msk
#define USB_HS_PHYC_LDO_ENABLE USB_HS_PHYC_LDO_DISABLE
This seems strange to me. Does setting USB_HS_PHYC_LDO_DISABLE bit enable or disable the LDO. Please comment/fix!
Solved! Go to Solution.
2020-07-07 12:57 AM
Hello,
Thank you for reported this issue.
You are right, this is looks a documentation issue.
Bit 2 LDO_DISABLE: Controls disable of the High Speed PHY's LDO.
0: LDO enabled
1: LDO disabled
Should be inverted writing 1 to this bit enables the LDO.
I raised this internally for fix.
Best Regards,
Imen
2020-07-02 05:11 AM
> Does setting USB_HS_PHYC_LDO_DISABLE bit enable or disable the LDO
The reference manual is always the best source of information about what the registers do.
Bit 2 LDO_DISABLE: Controls disable of the High Speed PHY's LDO.
0: LDO enabled
1: LDO disabled
> Please comment/fix!
Agreed it's a bit odd, but it is defined within the "/* Legacy */" section of the header file clearly indicating it's there to support old code which expects those definitions. The choice by ST is either to include it in the header and have old code work fine, or to take it out and have users ask why their code no longer works.
2020-07-02 05:16 AM
Actually, on further review, it seems like the reference manual could be wrong. The code in "stm32f7xx_ll_usb.c" includes:
/* Enable LDO */
USB_HS_PHYC->USB_HS_PHYC_LDO |= USB_HS_PHYC_LDO_ENABLE;
Either the reference manual is wrong, or that code doesn't do what they think it will do.
There are some google hits which suggest the code snippet works correctly.
2020-07-02 05:33 AM
Yes, that needs clafification from ST!
2020-07-02 10:46 AM
What a shame.
JW
2020-07-07 12:57 AM
Hello,
Thank you for reported this issue.
You are right, this is looks a documentation issue.
Bit 2 LDO_DISABLE: Controls disable of the High Speed PHY's LDO.
0: LDO enabled
1: LDO disabled
Should be inverted writing 1 to this bit enables the LDO.
I raised this internally for fix.
Best Regards,
Imen