Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Where's the error in this code for a Cortex M3 (stm32F103)

Status
Not open for further replies.

ledieuaeris

Newbie level 1
Joined
Oct 23, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Error in simple code for a Cortex M3 (stm32F103)

Hi,

I just started to program an ARM with Keil. To understand how to do that, I have written that:

#include <stm32f10x_lib.h>

int main(void){

GPIO_InitTypeDef GPIO_InitStructure;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_Init( GPIOD, &GPIO_InitStructure);

}

Keil said me:

arm.axf: Error: L6218E: Undefined symbol GPIO_Init (referred from main.o).

Can you say me what's wrong and how to make this code working.

Thanks,
Michel

PS: Sorry for my bad english
 
Last edited:

Re: Error in simple code for a Cortex M3 (stm32F103)

You should compile the stm32f10x_gpio.c file too.
 

1) make sure that stm32f10x_gpio.h is included in stm32f10x_lib.h.
2) you will also need to enable the port clock before using it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top