[STM32H753] USB33RDY is not asserting
Dear all,
I'm coming to you with a very simple problem, after not being able to wrap my head around it. I'am trying to design a board using the STM32H753VIT6 (V revision) and a USB3320 ULPI interface. While writing firmware for the custom board, I noticed that sometimes, the USB33RDY flag does not get asserted. Thus I suspect the USB regulator does not run correctly. The thing is, it is very moody... It works one day, than stops the other.
There is not much mentioned about this in the datasheet so after peeking into it today, I figured it probably has to be an power issue with my board and I went to try it on the NUCLEO-H753ZI. I uploaded a very simple test code that just enables the USB reguator and the voltage level detector, the code is as follows:
#include "main.hpp"
#include "stm32h753xx.h"
#include "core_cm7.h"
#include "cmsis_compiler.h"
extern "C" void SystemInit(void){
}
extern "C" int main(void){
//Enable the USB regulator and wait for it to be ready
PWR->CR3 |= (PWR_CR3_USBREGEN | PWR_CR3_USB33DEN);
while(!(PWR->CR3 & PWR_CR3_USB33RDY_Msk)){;}
while(1){
asm("nop");
}
}And still, I cannot get it working. The code hangs at line 14 (in the while loop) and the ready flag is not set in the register view. I've attached the complete project with startup, linker, etc. bellow (without the CMSIS).
My question is: Am I doing something wrong with the powerup sequence? Do I need to enable something else first, before enabling the USB regulator? The weirdest thing to me is that this exact code sometimes works and sometimes does not... I'm powering the nucleo through the USB cable from a PC, so I guess it could still be some kind of noisy USB power issue...
Thanks for any kicks in the right direction!
Debugger: BlackMagic Probe
Compiler: GCC 10.3.1.
IDE: VSCode
OS: Windows




