2024-04-25 03:21 AM
Hello everyone.
I recently purchased a Nucleo STM32H7S3L8 board, and it is giving me problems.
I am using STM32CUBEIde to create a usb host and a CDC class.
I am using the x-cube-tcpp module, USB_OTH_HS and the problem is that the usb host does not initialize. It stops at the USB_CoreReset function,
exactly USBx->GRSTCTL is always 1, it doesn't change.
Can anybody help me?
Solved! Go to Solution.
2024-06-14 02:27 PM
Hi Everyone,
I was able to get it to work if you update: USB_HS_REGEN to 'enabled' under the power and thermal tab
2024-04-25 09:53 AM
Could you explain more the issue? Did you have an issue with the example provided in Cube Firmware. If your application is completely different, please share your code so that we can help you
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.
2024-04-26 03:40 AM
Thanks in advance.
I am connecting a USB-C modem using a specific CDC class.
To activate VBUS I have modified the code generated by x-cube-tcpp, using only what is necessary to power VBUS. The Green LED lights up correctly and so does the modem.
I have added the USB_OTG_HS feature and USB-HOST package in stm32CubeIde but the application crashes when the system calls usb_CoreReset().
The calling order is:
MX_TCPP_Init()
(usb led lights up)
MX_USB_HOST_init()
USBH_Init()
USBH_LL_Init()
HAL_HCD_Init()
USB_CoreInit()
USB_CoreReset()
and here it waits for HAL_TIMEOUT, since the USBx->GRSTCTL register does not finish initializing the PHY.
The modifications in TCPP are (app_tcpp.c):
/* ADC_Start();*/
/*USBnoPD_State = USBnoPD_State_DETACHED;*/
HAL_Delay(500);
BSP_USBPD_PWR_VBUSDischargeOff(USBPD_PWR_TYPE_C_PORT_1);
BSP_USBPD_PWR_VBUSOn(USBPD_PWR_TYPE_C_PORT_1);
2024-05-02 09:58 AM
After further investigation, it seems you have encountered an issue while porting your project (Disco board to Nucleo board).
If your target seemed to be damaged, you can recover using CubeProgrammer and connect in Power Down mode so that you can erase the chip. In fact, you may have flashed an SMPS project and your nucleo power supply by default is LDO as referenced in the user manual STM32H7Rx/7Sx Nucleo-144 board (MB1737) - User manual
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.
2024-05-02 03:23 PM - edited 2024-05-02 03:27 PM
I am experiencing the same issue on the NUCLEO-H7S3L8.
USB_OTG_GRSTCTL_CSRST is stuck to 1
During usb configuration/initialisation
static HAL_StatusTypeDef USB_CoreReset(USB_OTG_GlobalTypeDef *USBx)
{
__IO uint32_t count = 0U;
/* Wait for AHB master IDLE state. */
do
{
count++;
if (count > HAL_USB_TIMEOUT)
{
return HAL_TIMEOUT;
}
} while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_AHBIDL) == 0U);
/* Core Soft Reset */
count = 0U;
USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;
do
{
count++;
if (count > HAL_USB_TIMEOUT)
{
return HAL_TIMEOUT;
}
} while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST); //<<< Never leaves this state!!!
return HAL_OK;
}
Can someone help with the above?
Thanks
Harry
2024-05-03 03:24 AM
Hello.
He didn't quite understand her answer. I have the board configuration all by default.
Tests carried out:
x-cube-tcpp (WORKS, vbus is ok).
USB-HOST (not working, crash on usb_corereset)
USB device (not working, crash on usb_corereset).
I just have to try the example from the repository (https://github.com/STMicroelectronics/STM32CubeH7RS/tree/main/Projects/NUCLEO-H7S3L8/Applications/USB_Device/CDC_Standalone).
Sincerely: Jaime Lujan
2024-05-03 06:39 AM
Could you please specify NUCLEO-H7S3L8 board revision? It works as expected on my end (using B02)
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.
2024-05-05 02:58 AM
Hi.
It's the same B02.
Hi.
With the example it works correctly.
I have tried to create a new example from the .ioc file, but it does not work since there are differences between files.
Using STM32CubeIde for a new project and adding USBPD, no reference to device TCPP0203 is included, so VBUS is not enabled in HOST mode.
Is there any example of USB-HOST for this board?
Thank you.
2024-05-07 09:42 AM
Hello @JaimeLujanLozano & @Harry_S
I reproduced the issue on my side too and reported it to dedicated team. It seems the configuration of USB core in both instances is not correct after code generation. In fact, BSVLD bit field should be set in OTG_GOTGCTL.
Internal ticket number 180898
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.
2024-05-07 03:02 PM
Is the USB core issue specific to that board, or other boards as well? I'm working on the B-U585-IOT02A board right now.