Skip to main content
Explorer
March 24, 2024
Question

Cube IDE Version: 1.15.0 failed at SystemClock_Config()

  • March 24, 2024
  • 8 replies
  • 2605 views

Hi :

      I updated  STM32CubeIDE a few hours ago.

Version: 1.15.0

Build: 20695_20240315_1429 (UTC)

 

Now it will failed at the SystemClock_Config() and missing arm_sorting.h

 

void SystemClock_Config(void)

{

RCC_OscInitTypeDef RCC_OscInitStruct = {0};

RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

 

/** Configure the main internal regulator output voltage

*/

if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE3) != HAL_OK)

{

Error_Handler();

}

 

/** Initializes the CPU, AHB and APB buses clocks

*/

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;

RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;

RCC_OscInitStruct.HSIState = RCC_HSI_ON;

RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;

RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;

RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV1;

RCC_OscInitStruct.PLL.PLLM = 1;

RCC_OscInitStruct.PLL.PLLN = 16;

RCC_OscInitStruct.PLL.PLLP = 8;

RCC_OscInitStruct.PLL.PLLQ = 2;

RCC_OscInitStruct.PLL.PLLR = 2;

RCC_OscInitStruct.PLL.PLLRGE = RCC_PLLVCIRANGE_1;

RCC_OscInitStruct.PLL.PLLFRACN = 0;

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) ----> failed here

{

Error_Handler();

}

 

/** Initializes the CPU, AHB, and APB buses clocks

*/

RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK

|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2

|RCC_CLOCKTYPE_PCLK3;

RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;

RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;

RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;

RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;

 

if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)

{

Error_Handler();

}

}

 here are the details

 Dev Board Nucleo-U5A5ZJ-Q

 

Name : Error_Handler

Details:{void (void)} 0x800068c <Error_Handler>

Default:{void (void)} 0x800068c <Error_Handler>

Decimal:-128

Hex:0x80

Binary:10000000

Octal:0200

 

S_Ong_0-1711292059277.png

I have no such error before update.

Any idea how to resolve this?

 

Simon

    This topic has been closed for replies.

    8 replies

    Technical Moderator
    March 24, 2024

    Hello @S_Ong 

    Could you share your project here. I think you should update your paths. 

    Best Regards.

    STTwo-32 

    S_OngAuthor
    Explorer
    March 25, 2024

    Hi @STTwo-32 :

                              Sure, do you need the whole file in zip? FYI I, installed the Cube IDE Version: 1.15.0 in another new laptop, and it has the same problem. But with the same laptop installed with the earlier version, the project ran without error.  Please let me know how to share the project.

     

    Best Regards.

     

    Simon

     

     

     

     

    Technical Moderator
    March 25, 2024

    Hello, you have just to share the project in any one of the supported formats.

    Best regards.

    STTwo32

     

    S_OngAuthor
    Explorer
    March 25, 2024

    Hi @STTwo-32 :

    S_Ong_2-1711373737811.png

     

     

    S_Ong_0-1711373686256.png

    S_Ong_3-1711373774344.png

    S_Ong_4-1711373956876.png

     

    I don't see any  "arm_sorting.h" at both folders. 

    "dsp/support_functions.h" yes, the support_functions header file is in both folder.

    is this what you are looking for?

     

    Regards and Thanks

     

    Simon

     

     

     

    S_OngAuthor
    Explorer
    March 25, 2024

    Hello @STTwo-32 :

    Please bear with me, I am new to this community. Here is the main.c

     

    /* USER CODE BEGIN Header */
    /**
     ******************************************************************************
     * @file : main.c
     * @brief : Main program body
     ******************************************************************************
     * @attention
     *
     * Copyright (c) 2024 STMicroelectronics.
     * All rights reserved.
     *
     * This software is licensed under terms that can be found in the LICENSE file
     * in the root directory of this software component.
     * If no LICENSE file comes with this software, it is provided AS-IS.
     *
     ******************************************************************************
     */
    /* USER CODE END Header */
    /* Includes ------------------------------------------------------------------*/
    #include "main.h"
    
    /* Private includes ----------------------------------------------------------*/
    /* USER CODE BEGIN Includes */
    #include <stdio.h>
    
    /* USER CODE END Includes */
    
    /* Private typedef -----------------------------------------------------------*/
    /* USER CODE BEGIN PTD */
    
    /* USER CODE END PTD */
    
    /* Private define ------------------------------------------------------------*/
    /* USER CODE BEGIN PD */
    
    /* USER CODE END PD */
    
    /* Private macro -------------------------------------------------------------*/
    /* USER CODE BEGIN PM */
    
    /* USER CODE END PM */
    
    /* Private variables ---------------------------------------------------------*/
    
    PCD_HandleTypeDef hpcd_USB_OTG_HS;
    
    /* USER CODE BEGIN PV */
    uint16_t counter=0;
    /* USER CODE END PV */
    
    /* Private function prototypes -----------------------------------------------*/
    void SystemClock_Config(void);
    static void SystemPower_Config(void);
    static void MX_GPIO_Init(void);
    static void MX_ICACHE_Init(void);
    static void MX_USB_OTG_HS_PCD_Init(void);
    /* USER CODE BEGIN PFP */
    
    /* USER CODE END PFP */
    
    /* Private user code ---------------------------------------------------------*/
    /* USER CODE BEGIN 0 */
    int _write(int file, char *ptr, int len)
    {
     (void)file;
     int DataIdx;
    
     for (DataIdx = 0; DataIdx < len; DataIdx++)
     {
     // __io_putchar(*ptr++);
    	 ITM_SendChar(*ptr++);
     }
     return len;
    }
    
    /* USER CODE END 0 */
    
    /**
     * @brief The application entry point.
     * @retval int
     */
    int main(void)
    {
    
     /* USER CODE BEGIN 1 */
    
     /* USER CODE END 1 */
    
     /* MCU Configuration--------------------------------------------------------*/
    
     /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
     HAL_Init();
    
     /* USER CODE BEGIN Init */
     
     /* USER CODE END Init */
    
     /* Configure the system clock */
     SystemClock_Config();
    
     /* Configure the System Power */
     SystemPower_Config();
    
     /* USER CODE BEGIN SysInit */
    
     /* USER CODE END SysInit */
    
     /* Initialize all configured peripherals */
     MX_GPIO_Init();
     MX_ICACHE_Init();
     MX_USB_OTG_HS_PCD_Init();
     /* USER CODE BEGIN 2 */
    
     /* USER CODE END 2 */
    
     /* Infinite loop */
     /* USER CODE BEGIN WHILE */
     while (1)
     {
     /* USER CODE END WHILE */
    
     /* USER CODE BEGIN 3 */
    	 printf("Counter Value ");
    	 HAL_Delay(10000);
     }
     /* USER CODE END 3 */
    }
    
    /**
     * @brief System Clock Configuration
     * @retval None
     */
    void SystemClock_Config(void)
    {
     RCC_OscInitTypeDef RCC_OscInitStruct = {0};
     RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
    
     /** Configure the main internal regulator output voltage
     */
     if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE3) != HAL_OK)
     {
     Error_Handler();
     }
    
     /** Initializes the CPU, AHB and APB buses clocks
     */
     RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;
     RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
     RCC_OscInitStruct.HSIState = RCC_HSI_ON;
     RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
     RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
     RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
     RCC_OscInitStruct.PLL.PLLMBOOST = RCC_PLLMBOOST_DIV1;
     RCC_OscInitStruct.PLL.PLLM = 1;
     RCC_OscInitStruct.PLL.PLLN = 16;
     RCC_OscInitStruct.PLL.PLLP = 8;
     RCC_OscInitStruct.PLL.PLLQ = 2;
     RCC_OscInitStruct.PLL.PLLR = 2;
     RCC_OscInitStruct.PLL.PLLRGE = RCC_PLLVCIRANGE_1;
     RCC_OscInitStruct.PLL.PLLFRACN = 0;
     if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
     {
     Error_Handler();
     }
    
     /** Initializes the CPU, AHB and APB buses clocks
     */
     RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
     |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
     |RCC_CLOCKTYPE_PCLK3;
     RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
     RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
     RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
     RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
     RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;
    
     if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
     {
     Error_Handler();
     }
    }
    
    /**
     * @brief Power Configuration
     * @retval None
     */
    static void SystemPower_Config(void)
    {
     HAL_PWREx_EnableVddIO2();
    
     /*
     * Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral
     */
     HAL_PWREx_DisableUCPDDeadBattery();
    
     /*
     * Switch to SMPS regulator instead of LDO
     */
     if (HAL_PWREx_ConfigSupply(PWR_SMPS_SUPPLY) != HAL_OK)
     {
     Error_Handler();
     }
    /* USER CODE BEGIN PWR */
    /* USER CODE END PWR */
    }
    
    /**
     * @brief ICACHE Initialization Function
     * @param None
     * @retval None
     */
    static void MX_ICACHE_Init(void)
    {
    
     /* USER CODE BEGIN ICACHE_Init 0 */
    
     /* USER CODE END ICACHE_Init 0 */
    
     /* USER CODE BEGIN ICACHE_Init 1 */
    
     /* USER CODE END ICACHE_Init 1 */
    
     /** Enable instruction cache in 1-way (direct mapped cache)
     */
     if (HAL_ICACHE_ConfigAssociativityMode(ICACHE_1WAY) != HAL_OK)
     {
     Error_Handler();
     }
     if (HAL_ICACHE_Enable() != HAL_OK)
     {
     Error_Handler();
     }
     /* USER CODE BEGIN ICACHE_Init 2 */
    
     /* USER CODE END ICACHE_Init 2 */
    
    }
    
    /**
     * @brief USB_OTG_HS Initialization Function
     * @param None
     * @retval None
     */
    static void MX_USB_OTG_HS_PCD_Init(void)
    {
    
     /* USER CODE BEGIN USB_OTG_HS_Init 0 */
    
     /* USER CODE END USB_OTG_HS_Init 0 */
    
     /* USER CODE BEGIN USB_OTG_HS_Init 1 */
    
     /* USER CODE END USB_OTG_HS_Init 1 */
     hpcd_USB_OTG_HS.Instance = USB_OTG_HS;
     hpcd_USB_OTG_HS.Init.dev_endpoints = 9;
     hpcd_USB_OTG_HS.Init.speed = PCD_SPEED_HIGH;
     hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_HS_EMBEDDED_PHY;
     hpcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
     hpcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
     hpcd_USB_OTG_HS.Init.lpm_enable = DISABLE;
     hpcd_USB_OTG_HS.Init.use_dedicated_ep1 = DISABLE;
     hpcd_USB_OTG_HS.Init.vbus_sensing_enable = DISABLE;
     hpcd_USB_OTG_HS.Init.dma_enable = DISABLE;
     if (HAL_PCD_Init(&hpcd_USB_OTG_HS) != HAL_OK)
     {
     Error_Handler();
     }
     /* USER CODE BEGIN USB_OTG_HS_Init 2 */
    
     /* USER CODE END USB_OTG_HS_Init 2 */
    
    }
    
    /**
     * @brief GPIO Initialization Function
     * @param None
     * @retval None
     */
    static void MX_GPIO_Init(void)
    {
     GPIO_InitTypeDef GPIO_InitStruct = {0};
    /* USER CODE BEGIN MX_GPIO_Init_1 */
    /* USER CODE END MX_GPIO_Init_1 */
    
     /* GPIO Ports Clock Enable */
     __HAL_RCC_GPIOC_CLK_ENABLE();
     __HAL_RCC_GPIOH_CLK_ENABLE();
     __HAL_RCC_GPIOB_CLK_ENABLE();
     __HAL_RCC_GPIOG_CLK_ENABLE();
     __HAL_RCC_GPIOA_CLK_ENABLE();
    
     /*Configure GPIO pin Output Level */
     HAL_GPIO_WritePin(LED_RED_GPIO_Port, LED_RED_Pin, GPIO_PIN_RESET);
    
     /*Configure GPIO pin Output Level */
     HAL_GPIO_WritePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin, GPIO_PIN_RESET);
    
     /*Configure GPIO pin Output Level */
     HAL_GPIO_WritePin(GPIOB, UCPD_DBn_Pin|LED_BLUE_Pin, GPIO_PIN_RESET);
    
     /*Configure GPIO pin : PC13 */
     GPIO_InitStruct.Pin = GPIO_PIN_13;
     GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
    
     /*Configure GPIO pin : VBUS_SENSE_Pin */
     GPIO_InitStruct.Pin = VBUS_SENSE_Pin;
     GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     HAL_GPIO_Init(VBUS_SENSE_GPIO_Port, &GPIO_InitStruct);
    
     /*Configure GPIO pin : UCPD_FLT_Pin */
     GPIO_InitStruct.Pin = UCPD_FLT_Pin;
     GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     HAL_GPIO_Init(UCPD_FLT_GPIO_Port, &GPIO_InitStruct);
    
     /*Configure GPIO pin : PB15 */
     GPIO_InitStruct.Pin = GPIO_PIN_15;
     GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
    
     /*Configure GPIO pin : LED_RED_Pin */
     GPIO_InitStruct.Pin = LED_RED_Pin;
     GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
     HAL_GPIO_Init(LED_RED_GPIO_Port, &GPIO_InitStruct);
    
     /*Configure GPIO pin : LED_GREEN_Pin */
     GPIO_InitStruct.Pin = LED_GREEN_Pin;
     GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
     HAL_GPIO_Init(LED_GREEN_GPIO_Port, &GPIO_InitStruct);
    
     /*Configure GPIO pins : T_VCP_TX_Pin T_VCP_RX_Pin */
     GPIO_InitStruct.Pin = T_VCP_TX_Pin|T_VCP_RX_Pin;
     GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
     GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
     HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
    
     /*Configure GPIO pin : PA15 */
     GPIO_InitStruct.Pin = GPIO_PIN_15;
     GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
    
     /*Configure GPIO pins : UCPD_DBn_Pin LED_BLUE_Pin */
     GPIO_InitStruct.Pin = UCPD_DBn_Pin|LED_BLUE_Pin;
     GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
     GPIO_InitStruct.Pull = GPIO_NOPULL;
     GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
     HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
    
    /* USER CODE BEGIN MX_GPIO_Init_2 */
    /* USER CODE END MX_GPIO_Init_2 */
    }
    
    /* USER CODE BEGIN 4 */
    
    /* USER CODE END 4 */
    
    /**
     * @brief This function is executed in case of error occurrence.
     * @retval None
     */
    void Error_Handler(void)
    {
     /* USER CODE BEGIN Error_Handler_Debug */
     /* User can add his own implementation to report the HAL error return state */
     __disable_irq();
     while (1)
     {
     }
     /* USER CODE END Error_Handler_Debug */
    }
    
    #ifdef USE_FULL_ASSERT
    /**
     * @brief Reports the name of the source file and the source line number
     * where the assert_param error has occurred.
     * @param file: pointer to the source file name
     * @param line: assert_param error line source number
     * @retval None
     */
    void assert_failed(uint8_t *file, uint32_t line)
    {
     /* USER CODE BEGIN 6 */
     /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
     /* USER CODE END 6 */
    }
    #endif /* USE_FULL_ASSERT */

     

    Regards

     

    Simon

    Technical Moderator
    March 26, 2024

    Could you please Compress your project and add it as attachment to this post.

    Best Regards.

    STTwo-32

    S_OngAuthor
    Explorer
    March 26, 2024

    @STTwo-32 :

                       How to attach files? I don't see any selection for files attachment .

    Best Regards

    simon

    S_OngAuthor
    Explorer
    March 26, 2024

    @STTwo-32 :

                           My apologies :grinning_face_with_sweat:. Here is the attached files

    Technical Moderator
    March 26, 2024

    I've personally test it and it works perfectly for me. 

    Best Regards.

    STTwo-32

    S_OngAuthor
    Explorer
    March 26, 2024

    @STTwo-32 :

                         You have mentioned earlier regarding something about the path:

    here is the link:

     

    https://github.com/ARM-software/CMSIS_5/issues/910

    below is the comment:

     

    "You need to include the folder DSP/PrivateInclude when building.

    This folder contains headers that are used only for building the libraries but not to use it.

    The other folder DSP/Include is for headers which are needed to use the library. "

    I can locate the arm_sorrting.h header files as mentioned in the link.

     

    You did mentioned about path, build path ? if yes where can I check and probably change it? 

     

    Best Regards

    Simon

     

     

     

     

     

     

    S_OngAuthor
    Explorer
    March 28, 2024

    hi @STTwo-32 :

                             I get passed the " SystemClock_Config()" but now it stop at  MX_USB_OTG_HS_HCD_Init().

     

     

    static void MX_USB_OTG_HS_HCD_Init(void)
    {
    
     /* USER CODE BEGIN USB_OTG_HS_Init 0 */
    
     /* USER CODE END USB_OTG_HS_Init 0 */
    
     /* USER CODE BEGIN USB_OTG_HS_Init 1 */
    
     /* USER CODE END USB_OTG_HS_Init 1 */
     hhcd_USB_OTG_HS.Instance = USB_OTG_HS;
     hhcd_USB_OTG_HS.Init.Host_channels = 16;
     hhcd_USB_OTG_HS.Init.speed = HCD_SPEED_HIGH;
     hhcd_USB_OTG_HS.Init.dma_enable = DISABLE;
     hhcd_USB_OTG_HS.Init.phy_itface = USB_OTG_HS_EMBEDDED_PHY;
     hhcd_USB_OTG_HS.Init.Sof_enable = DISABLE;
     hhcd_USB_OTG_HS.Init.low_power_enable = DISABLE;
     hhcd_USB_OTG_HS.Init.use_external_vbus = ENABLE;
     if (HAL_HCD_Init(&hhcd_USB_OTG_HS) != HAL_OK) ----> it hang up here.
     {
     Error_Handler();
     }
     
     /* USER CODE BEGIN USB_OTG_HS_Init 2 */
    
     /* USER CODE END USB_OTG_HS_Init 2 */
    
    }

     

    it hang at 

    if (HAL_HCD_Init(&hhcd_USB_OTG_HS) != HAL_OK)

    {

    Error_Handler();

    }

    Do you think it is about setting?

    Best Regards

     

    Simon