Search code examples
armstm32keilnucleostm32f0

How to convert STM32 snippet (code examples) written for target device STM32F072B to STM32F030r8


Dears,

I am newbie in embedded systems.

I have downloaded code examples from st.com written for target device STM32F072B. As I am using Nucleo-64 with STM32F030r8 MCU, I need to convert the downloaded code examples to support my target device STM32F030r8.

I can build the code examples (written for STM32F072B) in Keil, but when I am changing the target device to STM32F030r8 I am getting an error:

..\system_stm32f0xx.c(301): error:  #20: identifier "RCC_CFGR_PLLSRC_HSI48_PREDIV" is undefined

Please help me either by telling the way to convert the downloaded code examples to support my target device STM32F030r8.

Regards Niyas


Solution

  • Thank-you Dears, I found the answer. Guillaume Petitjean 's reply made me to read more documents and finally I made it.

    Question: The STM32SnippetsF0 (C-code examples) downloaded from https://www.st.com/en/embedded-software/stm32snippetsf0.html#overview is designed to run on the STM32F072B Discovery board. So changing target device(my case STM32F030r8) need many changes like adding supported header files etc. *I got the mentioned error previously because I compiled simply after changing target device in setting but without adding proper header file. :(

    *I was asking this. Don't know whether I asked properly. Anyway the solution i found is sharing with you all.

    Answer:

    This document tells how the snippet code can be used on other target device

    https://www.st.com/resource/en/data_brief/stm32snippetsf0.pdf

    After reading the document and adding necessary driver header files I am able to compile and build the code