Hi,
I read the manual for GIPO library for MCBSTR9 board, and I saw a few examples. Unfortunately, when trying to use them in the program pops up the information about some errors.
Source code:
int main (void) { u8 Read_Value; GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All; GPIO_InitStruct.GPIO_Direction = GPIO_PinInput; GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull; GPIO_InitStruct.GPIO_Alternate = GPIO_InputAlt1; GPIO_Init (GPIO1, &GPIO_InitStruct); Read_Value=GPIO_ReadBit(GPIO1,GPIO_Pin_7); }
Build output: Build target 'STR910 Flash with CFG' compiling Blinky.c... Blinky.c(33): warning: #550-D: variable "Read_Value" was set but never used Blinky.c: u8 Read_Value; Blinky.c: ^ Blinky.c: Blinky.c: 1 warning, 0 errors linking... .\Flash\Blinky.axf: Error: L6218E: Undefined symbol GPIO_Init (referred from blinky.o). .\Flash\Blinky.axf: Error: L6218E: Undefined symbol GPIO_ReadBit (referred from blinky.o). .\Flash\Blinky.axf: Not enough information to list image symbols. .\Flash\Blinky.axf: Not enough information to list the image map. .\Flash\Blinky.axf: Finished: 2 information, 0 warning and 2 error messages. Target not created
I dont know what is the problem .\Flash\Blinky.axf: Error: L6218E: Undefined symbol GPIO_Init (referred from blinky.o). .\Flash\Blinky.axf: Error: L6218E: Undefined symbol GPIO_ReadBit (referred from blinky.o).
because all this functions are declared in 91x_gpio.h this same problem have with example functions from 91x_tim.h
That's right: they are just declared in the header - they are not defined.
You also need the definitions of those functions to be able to use them.
This is standard 'C' stuff - nothing specifically to do with Keil.
I don't know why, but it seems this whole world needs tools, books etc that in very large text, every time people open programs, says: "Including a header file into your project will _not_ be enough to make your linker happy. Header files makes the compiler happy. Libraries and object files makes the linker happy!"
Thank you for your help. I couldn't find the answer in other forums that I decided to write here. Now everything is ok, I know where I made a mistake. Thanks and best regards Irek Cz.