cancel
Showing results for 
Search instead for 
Did you mean: 

Converting STM32F4Discovery Demonstration to High Speed USB

RobG
Associate III

Been searching, but I can find anything. Most responses refer to the fact that you need the ULPI PHY. I have a USB330 ULPI board plugged. I configured the new pins. If I recall one was shared with the accelerometer so I switched the mouse to be GPIO buttons rather the accelerometer. I did USBD_Init(&hUSBDDevice, &HID_Desc, DEVICE_HS); instead of DEVICE_FS. Note if I use DEVICE_FS the mouse still works. I modified USBD_LL_Init to add:

if (pdev->id == DEVICE_HS) {

// Link The driver to the stack

/* */

hpcd.pData = pdev;

pdev->pData = &hpcd;

hpcd.Instance = USB_OTG_HS;

hpcd.Init.dev_endpoints = 6;

hpcd.Init.speed = PCD_SPEED_HIGH;

hpcd.Init.dma_enable = DISABLE;

hpcd.Init.ep0_mps = DEP0CTL_MPS_64;

hpcd.Init.phy_itface = USB_OTG_ULPI_PHY;

hpcd.Init.Sof_enable = DISABLE;

hpcd.Init.low_power_enable = DISABLE;

hpcd.Init.lpm_enable = DISABLE;

hpcd.Init.vbus_sensing_enable = DISABLE;

hpcd.Init.use_dedicated_ep1 = DISABLE;

hpcd.Init.use_external_vbus = DISABLE;

if (HAL_PCD_Init(&hpcd) != HAL_OK)

{

Error_Handler();

}

HAL_PCDEx_SetRxFiFo(&hpcd, 0x200);

HAL_PCDEx_SetTxFiFo(&hpcd, 0, 0x80);

HAL_PCDEx_SetTxFiFo(&hpcd, 1, 0x174);

}

It is seen by the host and enumeration is started, but fails. My Beagle SUB 480 protocol analyzer shows a response, but I think it is at the wrong time.

Any thoughts? I can post more information, but maybe this will be enough.

Thanks in Advance

3 REPLIES 3
RobG
Associate III

I didn't think this would be a tough question, surprise! So does anyone know of any examples running as a high speed device on the STM32f4 Discovery? Thanks again.

RobG
Associate III

0690X000006D82gQAC.pngIt may be a little hard to read, but I think my issues is the first Setup packet is naked. Anyone?

RobG
Associate III

Turns out I did everything right in FW. There was a pin conflict in HW. Thanks for your help.