Gast
#1986273
Hi,
hab in letzter Zeit mein Programm für den PMBus geschrieben das jetzt
funktioniert. Jetzt wollte ich die Funktionen in C - files auslagern was
eigentlich immer funktioniert. Jedoch bekomm ich beim Compilieren einen
Fehler den ich nicht erklären kann.
µC Infos: STM32L152
Die Funktion "I2CInit" ist in dem C-File "i2ccom.c". Der Prototyp
befindet sich in der zugehörigen .h datei. Die .h datei ist per include
in das "bootloader.c" file eingefügt in dem auch die Funktion aufgerufen
wird.
Als Fehler bekomme ich:
Error: L6218E: Undefined symbol I2CInit() (referred from bootmain.o).
Not enough information to produce a SYMDEFs file.
Not enough information to list image symbols.
Finished: 2 information, 0 warning and 1 error messages.
Vielleicht weiss von euch jemand was zu tun ist?
Ich bin für jede Hilfe sehr Dankbar!
Gruß R. Griesser
Code:
bootmain.c:
/**************************************************************/
/***********************INCLUDES*******************************/
/**************************************************************/
#include <stdio.h>
#include <stdint.h>
#include "bsp/system_stm32l1xx.h"
#include "lib/STM32L1xx_StdPeriph_Driver/inc/stm32l1xx_conf.h"
#include "lib/CMSIS/CM3/CoreSupport/core_cm3.h"
#include "systemcore/pcc_common/includes/pcc_types.h"
#include "bootmain.h"
#include "interrupt.h"
#include "i2ccom.h"
/**************************************************************/
/***********************DEFINITIONS****************************/
/**************************************************************/
//defines
#define Transmitter 0x00
#define Receiver 0x01
#define Write 0x00
#define Read 0x01
//prototypes
void PinInit(void);
void EXTI0Init(void);
void EXTI1Init(void);
void TestWrite(void);
void TestRead(void);
void PollAdresses(void);
void I2CReadFunction(void);
void I2CWriteFunction(void);
//variables
uint8_t SlaveAddress;
uint8_t Direction;
uint8_t Command;
__IO uint8_t TransmissionData;
__IO uint8_t ExpectedData;
__IO uint8_t Tx_Index;
__IO uint8_t Rx_Index;
uint8_t I2C_Tx_Buffer[32];
uint8_t I2C_Rx_Buffer[32];
uint8_t addressBuffer[128];
int TestReadFlag;
int TestWriteFlag;
/**************************************************************/
/**************************MAIN METHOD*************************/
/**************************************************************/
int main(void)
{
PinInit();
EXTI0Init();
EXTI1Init();
I2CInit();
TestWriteFlag = FALSE;
TestReadFlag = FALSE;
while(1)
{
if (TestReadFlag == TRUE) TestRead();
if (TestWriteFlag == TRUE) TestWrite();
}
}
i2ccom.c:
/**************************************************************/
/***********************INCLUDES*******************************/
/**************************************************************/
#include "i2ccom.h"
#include <stdio.h>
#include <stdint.h>
#include "bsp/system_stm32l1xx.h"
#include "lib/STM32L1xx_StdPeriph_Driver/inc/stm32l1xx_conf.h"
#include "lib/CMSIS/CM3/CoreSupport/core_cm3.h"
/**************************************************************/
/***********************DEFINITIONS****************************/
/**************************************************************/
void I2CInit(void);
GPIO_InitTypeDef GPIO_InitStructure;
I2C_InitTypeDef I2C_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
extern uint8_t SlaveAddress;
extern uint8_t Direction;
extern uint8_t Command;
extern __IO uint8_t TransmissionData;
extern __IO uint8_t ExpectedData;
extern __IO uint8_t Tx_Index;
extern __IO uint8_t Rx_Index;
extern uint8_t I2C_Tx_Buffer[32];
extern uint8_t I2C_Rx_Buffer[32];
extern uint8_t addressBuffer[128];
extern int TestReadFlag;
extern int TestWriteFlag;
/**************************************************************/
/**************************METHODS*****************************/
/**************************************************************/
void I2CInit(void)
{
}
i2ccom.h:
#ifndef I2CCOM_H_
#define I2CCOM_H_
#endif /*I2CCOM_H_*/
/**************************************************************/
/***********************DEFINITIONS****************************/
/**************************************************************/
#include "bootmain.h"
/**************************************************************/
/************************Prototypes****************************/
/**************************************************************/
void I2CInit(void);