cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030CC stm32f0xx.h configuration

karlis
Associate II
Posted on March 16, 2016 at 14:09

Hello all.

I am trying to configure UART interrupts, but I can't seem to find where/how to define which MCU am I using. When I made the project I chose the STM32F030CC which I am using, but in stm32f0xx.h file it seems like STM32f030 is selected. I will add some screenshots so it is easier to understand.

/* Uncomment the line below according to the target STM32F0 device used in your 
application 
*/
#if !defined (STM32F030) && !defined (STM32F031) && !defined (STM32F051) && \
!defined (STM32F072) && !defined (STM32F042) && !defined (STM32F091) && \
!defined (STM32F070xB) && !defined (STM32F070x6) && !defined (STM32F030xC)
/* #define STM32F030 */ 
/* #define STM32F031 */ 
/* #define STM32F051 */ 
/* #define STM32F072 */
/* #define STM32F070xB */ 
/* #define STM32F042 */
/* #define STM32F070x6 */ 
/* #define STM32F091 */
/* #define STM32F030xC */

I deleted /* */ in the #define STM32f030xC but it is still in gray color, and does not let me to compile. 0690X00000605BdQAI.png This is how it looks like on/*!< Interrupt Number Definition */ section , STM32F030xC section is gray, but STM32F030 is not. 0690X00000605EyQAI.png I uploaded

http://www.filedropper.com/stm32f0xx

too. Can someone please help? #stm32f0xx.h #stm32f030cc
4 REPLIES 4
Amel NASRI
ST Employee
Posted on March 16, 2016 at 16:41

Hi karlis77,

Check the preprocessor values defined for your project. STM32F030 should be defined there (check the options of your project depending on the used IDE).

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

karlis
Associate II
Posted on March 17, 2016 at 10:05

I checked the preprocessor macros and there is only DEBUG.

0690X00000605ExQAI.png

I have chosen STM32F030CC when I made the project.

0690X00000605NOQAY.png

When I make project with STM32F051R8 with same method then everything works fine, and STM32F051R8 is chosen in stm32f0xx.h file. 

Why this does not work with STM32F030CC ? :\ Maybe I should contact with Microsoft Visual Studio support too...

Posted on March 17, 2016 at 15:43

Maybe you just need to slap in a couple of defines and move on, the developers of free tools are overwhelmed with thousands of new parts, and shifting libraries. Save them some time and DIY.

The SPL project templates would use these, and some board specific ones for the EVAL series.

USE_STDPERIPH_DRIVER

STM32F030

USE_DEFAULT_TIMEOUT_CALLBACK

USE_FULL_ASSERT (optional)

The SPL model shouldn't require you to change library source. The inclusion of stm32f0xx.h should pull in the project specific stm32f0xx_conf.h file which should have board/project specific stuff, and pulls in the other include files for the peripherals. You'd have a local copy of that in the project, and modify it. The system_stm32f0xx.c file is also one that can be localized, as it deal with clocking models that are user driven.

You might also want to specify HSE_VALUE if the default value is different.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
karlis
Associate II
Posted on March 18, 2016 at 09:14

Thanks for answer.

I used the preprocessor macros which you advised and copied a stm32f0xx_conf.h in project directory and it gets included in stm32f0xx.h when there is USE_STDPERIPH_DRIVER preprocessor macro, but there is another problem.

When I open the stm32f0xx_conf.h it looks like this:

0690X00000605KIQAY.png