cancel
Showing results for 
Search instead for 
Did you mean: 

AZURE USB MSC not working on STM32U5A5V using USB HS.

clemente
Associate III

Hello to all,

I have some problems running HS USB MSC device type on a STM32U5 using AZURE. 

After the program is running on my board, I see this new device on the Device Manager of my PC:"Azure RTO USBX storage dev USBdevice".

But there are no hard drives visible in Explorer. I'm using a exFAT formatted SDCard of about 256GByte. The initialization of the SDCard completed well, and I have the IRQ for the DMA transfer fired without problems.

I added this command inside the file usb_otg.c :

void MX_USB_OTG_HS_PCD_Init(void)
{

  /* USER CODE BEGIN USB_OTG_HS_Init 0 */
  __HAL_RCC_SYSCFG_CLK_ENABLE();
  /* USER CODE END USB_OTG_HS_Init 0 */

 

And  I start the USB thread like this:

static VOID app_ux_device_thread_entry(ULONG thread_input)
{
  /* USER CODE BEGIN app_ux_device_thread_entry */
  TX_PARAMETER_NOT_USED(thread_input);

  MX_USB_OTG_HS_PCD_Init();

  HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x100);
  HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x60);
  HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x60);
  HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 2, 0x60);
  /* USER CODE END USB_Device_Init_PreTreatment_1 */

  /* initialize the device controller driver*/
  _ux_dcd_stm32_initialize((ULONG)USB_OTG_HS, (ULONG)&hpcd_USB_OTG_HS);

  /* Start device USB */
  HAL_PCD_Start(&hpcd_USB_OTG_HS);
}

 

And if I put in pause randomly the program, I see that it is always inside this function: _ux_device_stack_transfer_request.

 

I posted on github  some screenshot, files and the complete project: I hope to post the solution too, to help other people.

 

Someone can help me? Where am I wrong?

TIA

Clemente

1 REPLY 1
clemente
Associate III

Hello to all,

just an update.

Following this discussion STM32U5A5: USB HS without XTAL oscillator - WORKS  I have recompiled my project on my github page with the HSE clock setting as described.

Unfortunately the project still doesn't work, behaving the same as before.

TIA

Clemente