2024-01-20 06:06 AM
I modified sys clock config as
```C
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
/** Configure the main internal regulator output voltage
*/
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
/** Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
/* RCC_OscInitStruct.LSIState = RCC_LSI_OFF; */
RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
RCC_OscInitStruct.PLL.PLLN = 32;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB busses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
{
Error_Handler();
}
}
```
after I do this ,I cann't connect stm32g070cbt6 now ,is the chip broken
Solved! Go to Solution.
2024-01-20 07:27 AM - edited 2024-01-20 07:28 AM
What is your programmer ? ( st-link V2 "sticks" might not work here.)
Use stm32CubeProgrammer ->
Try to connect "under reset" -
or try starting bootloader (boot0 = hi) -
then load a program with correct clock/pll settings.
2024-01-20 06:09 AM
as you can see I set PLLN to 32 accidentally..:frowning_face:
2024-01-20 07:27 AM - edited 2024-01-20 07:28 AM
What is your programmer ? ( st-link V2 "sticks" might not work here.)
Use stm32CubeProgrammer ->
Try to connect "under reset" -
or try starting bootloader (boot0 = hi) -
then load a program with correct clock/pll settings.
2024-01-20 09:01 AM
I use st-link v2, and I do with like https://blog.csdn.net/Yetty1990/article/details/121610677 to slove this issue. tks for youe reply.