2023-01-19 09:03 AM
STM32CubeMx version 6.7.0
STM32Cube_FW_U5_V1.1.1
STM32Cube_FW_U5_V1.1.1\Projects\B-U585I-IOT02A\Applications\USBX\Ux_Device_HID_CDC_ACM\Ux_Device_HID_CDC_ACM.ioc
Copying the ioc file to a new location, double clicking and clicking "generate code" shows the same problem
2023-01-30 08:13 AM
Hello @Inbara and welcome to the community,
Could you please specify the used board?
Mohamed Aymen
2023-01-31 02:36 AM
Hi,
Thanks for your reply
I'm using my own hardware, but my problem is not with the HW but with the SW generation phase
Using a sample ioc file for a B-U585I-IOT02A board has the same issue
Also, it would be very useful if there was a usb device sample that can be used without cleaning out the application code
Thanks!
2023-01-31 06:17 AM
Can you please share your .ioc file ?
Mohamed Aymen
2023-01-31 07:27 AM
STM32Cube_FW_U5_V1.1.1\Projects\B-U585I-IOT02A\Applications\USBX\Ux_Device_HID_CDC_ACM\Ux_Device_HID_CDC_ACM.ioc
2023-01-31 07:52 AM
It's not empty, this is what the function contains in the app_usbx_device.c file:
/**
* @brief MX_USB_Device_Init
* Initialization of USB device.
* Init USB device Library, add supported class and start the library
* @retval None
*/
void MX_USB_Device_Init(void)
{
/* USER CODE BEGIN USB_Device_Init_PreTreatment_0 */
/* USER CODE END USB_Device_Init_PreTreatment_0 */
/* USB_OTG_HS init function */
MX_USB_OTG_FS_PCD_Init();
/* USER CODE BEGIN USB_Device_Init_PreTreatment_1 */
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x10);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x20);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 2, 0x10);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 3, 0x10);
/* USER CODE END USB_Device_Init_PreTreatment_1 */
/* Initialize the device controller driver*/
_ux_dcd_stm32_initialize((ULONG)USB_OTG_FS, (ULONG)&hpcd_USB_OTG_FS);
/* USER CODE BEGIN USB_Device_Init_PostTreatment */
/* USER CODE END USB_Device_Init_PostTreatment */
}
Mohamed Aymen
2023-02-08 09:01 AM
Sorry, what I needed was MX_USBX_Device_Init
In any case I found the answer
The MX_USBX_Device_Init function is not generated, it has to be written manually