Stm32f070 programming

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

Stm32f070 programming

Post by ridvan5005 »

Hi, I want to use stm32f070 for a project. I installed the blink code on my board by selecting malyan m200 v2 and malyan m300 from 3d printer cards, but it did not work. The reason is that malyan works with the bootloader and installs the program to 0x008002000. Is there a solution to this?

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Stm32f070 programming

Post by fpiSTM »

You best bet is to create your own variant, I guess.

ridvan5005
Posts: 7
Joined: Sat Sep 19, 2020 3:54 pm

Re: Stm32f070 programming

Post by ridvan5005 »

Thank you for your answer. I changed the Malyan M200 V2 and Malyan M300 settings in board.txt. I made the settings to write to 0x8000000, but again Blink did not work.
I created my own variant. I created and saved the linkerscript and system clock settings with the STM32CUBE IDE. Unfortunately my own variant did not work.
Can you help me?

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Stm32f070 programming

Post by fpiSTM »

well you can always share it, I will try to have a quick look.

ridvan5005
Posts: 7
Joined: Sat Sep 19, 2020 3:54 pm

Re: Stm32f070 programming

Post by ridvan5005 »

Here is the code I added in my board.txt. (in 3d printer boards)
(My board name "FIREPLACE")

Code: Select all

# FIREPLACE board
3dprinter.menu.pnum.FIREPLACE=Fireplace V0.1
3dprinter.menu.pnum.FIREPLACE.upload.maximum_size=122880
3dprinter.menu.pnum.FIREPLACE.upload.maximum_data_size=15168
3dprinter.menu.pnum.FIREPLACE.build.mcu=cortex-m0
3dprinter.menu.pnum.FIREPLACE.build.board=FIREPLACE
3dprinter.menu.pnum.FIREPLACE.build.series=STM32F0xx
3dprinter.menu.pnum.FIREPLACE.build.product_line=STM32F070xB
3dprinter.menu.pnum.FIREPLACE.build.variant=FIREPLACE_070
3dprinter.menu.pnum.FIREPLACE.build.cmsis_lib_gcc=arm_cortexM0l_math
SystemClock_Config () in variant.cpp in the variant folder I got the code from stm32Cube id and as follows.

Code: Select all

 RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
  RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4;
  RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
  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_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();
  }
  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB|RCC_PERIPHCLK_USART1;
  PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK1;
  PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL;

  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
  {
    Error_Handler();
  }

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Stm32f070 programming

Post by fpiSTM »

Like this all seems ok.
So your board has an HSE of 8MHz?

ridvan5005
Posts: 7
Joined: Sat Sep 19, 2020 3:54 pm

Re: Stm32f070 programming

Post by ridvan5005 »

yes, the first thing I tried was to create the blink codes on STM32Cubeide and upload them to my board. He worked there and had no clock issues. But it did not work on my own board that I created with the codes above. I did not fully understand where the problem was. :?

ridvan5005
Posts: 7
Joined: Sat Sep 19, 2020 3:54 pm

Re: Stm32f070 programming

Post by ridvan5005 »

Stm32Duino won't release a version that supports stm32f070?

User avatar
fpiSTM
Posts: 746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Stm32f070 programming

Post by fpiSTM »

ridvan5005 wrote:
Mon Sep 21, 2020 7:05 pm
Stm32Duino won't release a version that supports stm32f070?
Generic variants will be released.

Share all your variant folder else I could not help.

ridvan5005
Posts: 7
Joined: Sat Sep 19, 2020 3:54 pm

Re: Stm32f070 programming

Post by ridvan5005 »

My variant documents.
Attachments
fireplace_variant.7z
Fireblace_board
(17.52 KiB) Downloaded 11 times

Post Reply

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