Stm32f070 programming

All about boards manufactured by ST
ridvan5005
Posts: 7
Joined: Sat Sep 19, 2020 3:54 pm

Re: Stm32f070 programming

Post by ridvan5005 »

hello again, i fixed my codes and ran it. But I'm having a problem. When I install a program by activating USB CDC ,program running but I cannot connect to ST-LINK UTILITY. I can only connect after boot mode. But when the USB CDC is off and after installing the program I am connecting to ST-LINK UTILITY.
Also, when USB CDC is on and optimized Fast (-O1), I connect to ST-LINK UTILITY but USB is not active.
The new variant is as follows:

Code: Select all

# FIREPLACE board

GenF0.menu.pnum.FIREPLACE=Fireplace v1
GenF0.menu.pnum.FIREPLACE.upload.maximum_size=131072
GenF0.menu.pnum.FIREPLACE.upload.maximum_data_size=20480
GenF0.menu.pnum.FIREPLACE.build.mcu=cortex-m0
GenF0.menu.pnum.FIREPLACE.build.board=FIREPLACE
GenF0.menu.pnum.FIREPLACE.build.series=STM32F0xx
GenF0.menu.pnum.FIREPLACE.build.product_line=STM32F070xB
GenF0.menu.pnum.FIREPLACE.build.variant=FIREPLACE_R
GenF0.menu.pnum.FIREPLACE.build.cmsis_lib_gcc=arm_cortexM0l_math
What do these mean?

Code: Select all

GenF0.menu.pnum.FIREPLACE.upload.maximum_size=131072
GenF0.menu.pnum.FIREPLACE.upload.maximum_data_size=20480


Code: Select all

WEAK void SystemClock_Config(void)
{

  RCC_OscInitTypeDef RCC_OscInitStruct;
  RCC_ClkInitTypeDef RCC_ClkInitStruct;
  RCC_PeriphCLKInitTypeDef PeriphClkInit;

  /* Initializes the CPU, AHB and APB busses clocks */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI14
                                     | RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.HSI14State = RCC_HSI14_ON;
  RCC_OscInitStruct.HSICalibrationValue = 16;
  RCC_OscInitStruct.HSI14CalibrationValue = 16;
  RCC_OscInitStruct.LSIState = RCC_LSI_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
  RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
  HAL_RCC_OscConfig(&RCC_OscInitStruct);

  /* 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_1) != HAL_OK) {
    _Error_Handler(__FILE__, __LINE__);
  }

  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_USART1
                                       | RCC_PERIPHCLK_I2C1;
  PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK1;
  PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI;
  PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL;

  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
    _Error_Handler(__FILE__, __LINE__);
  }
}

ST-LINK UTILITY output:

Code: Select all

17:19:41 : ST-LINK SN : 7A91080032124647524B4E00
17:19:41 : ST-LINK Firmware version : V2J34S7
17:19:41 : Connected via SWD.
17:19:41 : SWD Frequency = 4,0 MHz.
17:19:41 : Connection mode : HotPlug.
17:19:41 : Debug in Low Power mode enabled.
17:19:42 : Device ID:0x448 
17:19:42 : Device flash Size : 128KBytes
17:19:42 : Device family :STM32F072xx/F078xx
17:19:49 : [Blink.ino.hex] opened successfully.
17:19:49 : [Blink.ino.hex] checksum : 0x001BBA1B 
17:19:52 : Memory programmed in 1s and 578ms.
17:19:53 : Disconnected from device.
17:19:53 : Connection to device is lost: check power supply and debug connection.
17:19:53 : If the target is in low power mode, please enable "Debug in Low Power mode" option from Target->settings menu.

Post Reply

Return to “STM boards (Discovery, Eval, Nucleo, ...)”