cancel
Showing results for 
Search instead for 
Did you mean: 

Run USBX on STM32H563VIT

konsul41
Associate II

Sorry, Google Translate changed my previous post to Polish. That's probably why no one answered me.
Now the post is correct.

 

I'm creating a custom board using a used STM32H563VIT. Nice processor, but I can't understand how to create an Audo class, even if it's BT 1.0.
In the F series of processors, e.g. STM32F720, it was simple, but here it is somehow mixed up.

 

USB parts diagram:

image.png

 

I am trying to use a USB Adio class device.
For this reason, there is no AZURE RTOS in the IDE (H5).
I have configured the USB

 

image (1).png

I configured USBX as FS_Device

 

image (2).png

I took the stack size

image (3).png

After my changes

 

The device is in working order     HAL_PCD_STATE_READY

 

UINT MX_USBX_Device_Init(VOID)
{
UINT ret = UX_SUCCESS;

...
UX_PARAMETER_NOT_USED(ux_device_byte_pool_buffer);
...

return  ret;
}

However, the system does not detect the device.
What else should I do for the system to detect the device?

 

 

13 REPLIES 13
AScha.3
Chief III

Hi,

i made Audio host , with Azure/threadx, so its not same, but : 

- i needed a lot more memory, to get it work -> so try more memory

AScha3_0-1715586251451.png

+

AScha3_1-1715586278846.png

Try enabled ... if not sure, that disabled is, what you want.

If you feel a post has answered your question, please click "Accept as Solution".

Ok. ThreadX They started.

Teraz krąży w tx_thread_schedule.

Zastanawiam się czy nie powinienem mieć
Jak tutaj:

https://github.com/STMicroelectronics/x-cube-azrtos-l4/blob/main/Projects/STM32L4R9I-Discovery/Applications/USBX/Ux_Device_HID_CDC_ACM/USBX/App/app_usbx_device.c

To jest przykład dla CDC

Did you have additional code to initialize the USB stack?

 

 

 

 

 

No...it should connect.

 

just try something to send.

 

If you feel a post has answered your question, please click "Accept as Solution".

My computer does not detect the device, so it cannot be shipped.

Try another usb cable (except, you are 100% sure, this is working ).

+

Check, is USB power enabled ? 

in  MX_USB_HCD_Init() .

+

Try debug -> SFR : usb registers, state of DP+ (needs to switch on the pullup, to start enumeration from host/PC ).

If you feel a post has answered your question, please click "Accept as Solution".

I don't have the HCD function, I have PCD

static void MX_USB_PCD_Init(void)

{

 

/* USER CODE BEGIN USB_Init 0 */

 

/* USER CODE END USB_Init 0 */

 

/* USER CODE BEGIN USB_Init 1 */

 

/* USER CODE END USB_Init 1 */

hpcd_USB_DRD_FS.Instance = USB_DRD_FS;

hpcd_USB_DRD_FS.Init.dev_endpoints = 8;

hpcd_USB_DRD_FS.Init.speed = USBD_FS_SPEED;

hpcd_USB_DRD_FS.Init.phy_itface = PCD_PHY_EMBEDDED;

hpcd_USB_DRD_FS.Init.Sof_enable = DISABLE;

hpcd_USB_DRD_FS.Init.low_power_enable = DISABLE;

hpcd_USB_DRD_FS.Init.lpm_enable = DISABLE;

hpcd_USB_DRD_FS.Init.battery_charging_enable = DISABLE;

hpcd_USB_DRD_FS.Init.vbus_sensing_enable = DISABLE;

hpcd_USB_DRD_FS.Init.bulk_doublebuffer_enable = DISABLE;

hpcd_USB_DRD_FS.Init.iso_singlebuffer_enable = DISABLE;

if (HAL_PCD_Init(&hpcd_USB_DRD_FS) != HAL_OK)

{

Error_Handler();

}

/* USER CODE BEGIN USB_Init 2 */

 

/* USER CODE END USB_Init 2 */

 

}

state of DP+ (needs to switch on the pullup, to start enumeration from host/PC ).

 

This isn't what the stack currently does?
I know in the previous ones this was handled by the stack.

Did you enter additional code for this?

 

/* USER CODE END USB_Init 2 */

 

}

 

 

 

>Did you enter additional code for this?

As i wrote, i only made host with Azure, so i cannot tell you much about device.

+

Try debug -> SFR : usb registers, state of DP+

to see, is power enabled etc.

If you feel a post has answered your question, please click "Accept as Solution".

I checked with an oscilloscope, no signal on DP.
I only see power disturbances

SDS00009.png

After soldering the 1K5 resistor to +3.3V, the system recognizes the device, but does not recognize it.

 

SDS00010.png

 

Now I have
The descriptor request failed

 

>I checked with an oscilloscope, no signal on DP.

So its not powered or started . 

In my usb-host setup, no power was enabled, so i had to add (in xxx_hal_msp.c )

 /* USER CODE BEGIN USB_DRD_FS_MspInit 1 */
    HAL_PWREx_EnableVddUSB();
  /* USER CODE END USB_DRD_FS_MspInit 1 */

Look, if your "version" has it - or just try, add it.

+

No need for the 1k5 , the chip doing this - if enabled.

AScha3_0-1715624486447.png

 

If you feel a post has answered your question, please click "Accept as Solution".