cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX has BEGIN BEGIN blocks instead of BEGIN END for user code

andreasnh
Visitor

Thus overwriting it every time.

When generating this function:

/**
 * @brief  USBD_Get_Configuration_Number
 *         Return configuration number
 *   class_type : Device class type
 *   interface_type : Device interface type
 * @retval configuration number
 */
uint16_t USBD_Get_Configuration_Number(uint8_t class_type, uint8_t interface_type)
{
    uint8_t cfg_num = 1U;

    /* USER CODE BEGIN USBD_Get_CONFIGURATION_Number0 */

    /* USER CODE BEGIN USBD_Get_CONFIGURATION_Number0 */

    /* USER CODE BEGIN USBD_Get_CONFIGURATION_Number1 */

    /* USER CODE BEGIN USBD_Get_CONFIGURATION_Number1 */

    return cfg_num;
}

CubeMX version: 6.14.0

3 REPLIES 3
Mahmoud Ben Romdhane
ST Employee

Hello @andreasnh .

 

First let me thank you for posting and welcome to the ST Community.

For more investigation, I suggest please that you provide your Ioc.File.

 

Thanks.

Mahmoud

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

andreasnh
Visitor

Hello, @Mahmoud Ben Romdhane and thanks for the quick reply.

I'm reporting for an issue we encounter in development of a commercial product and I don't think I can just send the ioc file. I can check individual settings if that can suffice?

Can you not just generate a dummy project which illustrates the issue?

 

Or you could raise a support case - in private: https://ols.st.com/s/

Or contact your distributor: https://www.st.com/content/st_com/en/support/support-home.html 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.