Bugreport STM32CubeMX 4.20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-13 7:52 AM
1. Faulty code generation
STMCube Generates to following code in the function: void SystemClock_Config(void)
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;�?
this results that the SystemClock_Config function always enters the Error_Handler
HSE Clock is used as main clock.
By removing the RCC_OSCILATORTYPE_HSI define code functions normally2. Non working code USB MSC
Code generated for USB MSC stops working after the usb command USB Set Configuration Request
Device Manager reports Error Code 10 (can't start device)
The usb analyzer tool of wireshark shows no communication after host sends Set Configuration Request.
Problem observed from at least STM32CubeMX V4.18+
Changing driver versions does not solve the isuue
Tested on STM32446e-Eval and STM23F446ZC
PC: Windows 10 Toolchain: KEIL µVsion V5 #stm32cube-bug #bug-stm32cubemxSolved! Go to Solution.
- Labels:
-
STM32Cube MCU Packages
-
STM32CubeMX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-04-28 12:24 AM
Hello all,
Sorry for our late answer.
I would inform you that this issue is fixed in
V 4.20.1.Sorry for any inconvenience this may cause you.
BR. Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-13 8:09 AM
Hi
Zwarteveld.Johan
,Thank you for your feedback. The issue has been reported to our MX team for check..Sorry for the inconvenience it may bring.
-Nesrine-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-17 5:03 AM
For future reference :
2. Non working code USB MSC
Code generated for USB MSC stops working after the usb command USB Set Configuration Request
Device Manager reports Error Code 10 (can't start device)
The usb analyzer tool of wireshark shows no communication after host sends Set Configuration Request.
Problem observed from at least STM32CubeMX V4.18+
STM32CubeMx generates:
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
if (pdev->id == DEVICE_FS) {
/* Link The driver to the stack */
hpcd_USB_OTG_FS.pData = pdev;
pdev->pData = &hpcd_USB_OTG_FS;
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
hpcd_USB_OTG_FS.Init.dev_endpoints = 6;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE;
hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK)
{
Error_Handler();
}
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x40);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x80);
}
return USBD_OK;
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
if the following line is changed from:
hpcd_USB_OTG_FS.Init.dev_endpoints = 6;�?�?
to
hpcd_USB_OTG_FS.Init.dev_endpoints = 4;�?�?
the code start working again and my OS recognizes the device as mass storage.
is suspect that the set configuration command fails because there are an additional 2 uninitialized / unused endpoints
Please include the mentioned abnormalities in the next update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-17 11:21 AM
THANK YOU for posting this. Spent like 3 days measuring everything electrically trying to figure out why an HSE was not being selected. This bug is the reason, now works like a charm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-03-30 5:53 AM
Thanks a lot, change 4 boards, 2 IDEs
µVsion and SW4STM32, HSE still not work, Now running good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-04-28 12:24 AM
Hello all,
Sorry for our late answer.
I would inform you that this issue is fixed in
V 4.20.1.Sorry for any inconvenience this may cause you.
BR. Eric
