Tiva tm4c123gh6pm的工程,使用MDK编写,在编译的时候全部通过,但是在链接的时候库文件都显示undefined symbol 。如SysCtlClockGet显示为Error:L6218:Undefined symbol SysCtlClockGet(referred from main.o)头文件路径也定义了。但是比较奇怪的是在rom.h里面的函数就没有报错。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tiva tm4c123gh6pm的工程,使用MDK编写,在编译的时候全部通过,但是在链接的时候库文件都显示undefined symbol 。如SysCtlClockGet显示为Error:L6218:Undefined symbol SysCtlClockGet(referred from main.o)头文件路径也定义了。但是比较奇怪的是在rom.h里面的函数就没有报错。
嗯,确实是有漏掉了一部分的C文件,但是有一个IntRegister的函数始终没办法解决。然后现在是暂时先屏蔽掉使用
贴出IntRegister部分的代码和报错的信息看看。这个函数看名字像是中断函数的。
interrupt.c中
void
IntRegister(uint32_t ui32Interrupt, void (*pfnHandler)(void))
{
uint32_t ui32Idx, ui32Value;
//
// Check the arguments.
//
ASSERT(ui32Interrupt < NUM_INTERRUPTS);
//
// Make sure that the RAM vector table is correctly aligned.
//
ASSERT(((uint32_t)g_pfnRAMVectors & 0x000003ff) == 0);
//
// See if the RAM vector table has been initialized.
//
if(HWREG(NVIC_VTABLE) != (uint32_t)g_pfnRAMVectors)
{
//
// Copy the vector table from the beginning of FLASH to the RAM vector
// table.
//
ui32Value = HWREG(NVIC_VTABLE);
for(ui32Idx = 0; ui32Idx < NUM_INTERRUPTS; ui32Idx++)
{
g_pfnRAMVectors[ui32Idx] = (void (*)(void))HWREG((ui32Idx * 4) +
ui32Value);
}
//
// Point the NVIC at the RAM vector table.
//
HWREG(NVIC_VTABLE) = (uint32_t)g_pfnRAMVectors;
}
//
// Save the interrupt handler.
//
g_pfnRAMVectors[ui32Interrupt] = pfnHandler;
}
1.你中断表中有滴答定时器中断,而实际没有定义这个。
2.你实际用的是IntRegister,函数原型的定义是SystickIntRegister,所以报错的吧。