-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[stm32] Wait until the PHYC PLL is stable #3126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you provide the RM/specs that specify how long we should wait ?
Unfortunately no, the RM0431 p1560 does not mention anything about PLL stability. |
#2074 is tested with h747, which I don't think have USB_HS_PHYC as F723, therefore it is probably another issue. I also have the F723 discovery and has no issue with stocked examples. Can you make an minimal changes to oone of stock example that coould cause the issue ? |
👀 |
Ah, well… at first I also couldn't reproduce this issue with the tinyusb examples, until I power cycled the board: cd tinyusb
python3 tools/get_deps.py stm32f7
cd examples/device/cdc_msc
rm -rf _build; \
make BOARD=stm32f723disco RHPORT_DEVICE=1 LOG=2 all && \
openocd -f board/stm32f7discovery.cfg -c "program _build/stm32f723disco/cdc_msc.elf verify reset exit" *power cycle board* picocom --imap lfcrlf -b 115200 /dev/tty.usbmodem103 *reset board*
If you then apply my patch, it progresses past the reset. So something related to the PLL in the DWC2 core is sticky? Or it's an issue with GCC 14: $ arm-none-eabi-gcc --version
arm-none-eabi-gcc (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)) 14.2.1 20241119 EDIT: Nope, I tried this exact procedure with GCC12 and GCC13 and the behavior does not change. |
I still can't reproduce the issue with your binary. UART is connected from jumper CN6 to allow full power-off, no matter power cycle (cable unplug&re-plug) or press reset button it always runs correctly. I'm wondering if it's related to chip/board revision, I have:
|
@Lurcy38 Hi, do you know anything about this ? |
Hm, I have the exact same board and MCU revison as you… |
Describe the PR
Thank you for this awesome project, very enjoyable to work with!
I've been integrating TinyUSB using custom firmware on the STM32F723E-DISCOVERY board and got stuck in
reset_core
when initializing the HS port. Waiting 2ms after PLL enablement fixes this issue.Additional context
The solution for this was already discovered in #2074 (comment), where the CubeHAL waits 2ms, since there's no USB_HS_PHYC_PLLRDY bit in the USB_HS_PHYC peripheral
Closes #2074.