cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `RCC_APB2PeriphClockCmd' Problem

lizerd
Associate III
Posted on June 23, 2010 at 23:17

undefined reference to `RCC_APB2PeriphClockCmd' Problem

5 REPLIES 5
swhite2
Associate III
Posted on May 17, 2011 at 13:55

You need to edit the ''stm32f10x_conf.h'' file and uncomment the #include statements for the peripherals you intent to use.

John F.
Senior
Posted on May 17, 2011 at 13:55

You also need to - Project (right click) ''Add Existing File'' stm32f10x_rcc.c to your project. Similarly if you use GPIO, add stm32f10x_gpio.c etc.

 

lizerd
Associate III
Posted on May 17, 2011 at 13:55

Hi and thanks.

i get another error so i´m moving in the right direction i think =)

now a get

THUMB Flash Debug/stm32f10x_gpio.o: In function `GPIO_DeInit':

C:/Users/Lizerd/Documents/CrossWorks Projects/test66/stm32f10x_gpio.c:110: undefined reference to `assert_param'

THUMB Flash Debug/stm32f10x_gpio.o: In function `GPIO_Init':

C:/Users/Lizerd/Documents/CrossWorks Projects/test66/stm32f10x_gpio.c:177: undefined reference to `assert_param'

i have moved this files to project folder

stm32f10x_rcc h and c

stm32f10x_gpio h and c

stm32f10x_conf.h

stm32f10x.h

i have include/link to

stm32f10x_conf.h

stm32f10x_gpio.c

stm32f10x_rcc.c

stm32f10x.h

i have change stm32f10x_conf.h to

/* Includes ------------------------------------------------------------------*/

/* Uncomment the line below to enable peripheral header file inclusion */

/* #include ''stm32f10x_adc.h'' */

/* #include ''stm32f10x_bkp.h'' */

/* #include ''stm32f10x_can.h'' */

/* #include ''stm32f10x_cec.h'' */

/* #include ''stm32f10x_crc.h'' */

/* #include ''stm32f10x_dac.h'' */

/* #include ''stm32f10x_dbgmcu.h'' */

//#include ''stm32f10x_dma.h''

//#include ''stm32f10x_exti.h''

//#include ''stm32f10x_flash.h''

//#include ''stm32f10x_fsmc.h''

#include ''stm32f10x_gpio.h''

/*#include ''stm32f10x_i2c.h''*/

/* #include ''stm32f10x_iwdg.h'' */

//#include ''stm32f10x_pwr.h''

#include ''stm32f10x_rcc.h''

/* #include ''stm32f10x_rtc.h'' */

/* #include ''stm32f10x_sdio.h'' */

//#include ''stm32f10x_spi.h''

/* #include ''stm32f10x_tim.h'' */

//#include ''stm32f10x_usart.h''

/* #include ''stm32f10x_wwdg.h'' */

//#include ''misc.h'' /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */

very thankful for all the help a can get, would be very happy if a can get this to compile without any errors.

Best regards // Micke

John F.
Senior
Posted on May 17, 2011 at 13:55

You probably need to define,

USE_STDPERIPH_DRIVER

You can do that in CrossWorks in the Solution or Project Properties - Preprocessor Options / Preprocessor Definitions. Decide first if you're going to set properties in the Solution or the Project and stick to it. I find it very easy to get confused with properties. Also, make sure you set Private / Common properties - don't change the Public Configurations.

You can also set the STM32 type here (low med high) and do things like initialise the stack (see below). When you do get things working, you'll probably eventually overflow the stack. You can use the Symbol Browser Tool to see the stack then ''Locate Memory''.

USE_STDPERIPH_DRIVER

STM32F10X_HD

INITIALIZE_STACK

Use ST's Library html help for more info. Main Page, scroll down and click on ''How to use the Library''.

Hope this works for you.

John F.

lizerd
Associate III
Posted on May 17, 2011 at 13:55

Yees finaly it works to compile without errors.

Many Thanks // Micke