Problems with TimingDelay_Decrement
Dear ARM-Experts,
i'm programming with the STM32F4Discovery and now i'm setting up my Crossworks workspace.
Everything's fine except this two errors:
THUMB Debug/stm32f4xx_it.o: In function `SysTick_Handler':
undefined reference to `TimingDelay_Decrement'
I used the std_piriph_lib. there is in the main.h:
/* Exported functions ------------------------------------------------------- */
void TimingDelay_Decrement(void);
void Delay(__IO uint32_t nTime);
But only sollution i can solve this error is copy this to main.c or somewhere:
static volatile uint32_t TimingDelay;
void Delay(uint32_t nTime){
TimingDelay = nTime;
while(TimingDelay != 0);
}void TimingDelay_Decrement(void)
{ if (TimingDelay != 0x00)
{
TimingDelay--;
}
}-
This TimingDelay_Decrement() function is part of the SysTick example from ST, and can be found in the example subfolder of the peripheral libs. That function is called from within the SysTick interrupt. The handler routine usually resides in stm32fxxx_it.c.
If you declare the TimingDelay variable static, as given in your post:
staticvolatileuint32_t TimingDelay;you need to have this TimingDelay_Decrement() function in the same module, as it accesses it. This could be main.c, as it is also in the SysTick example.I suggest to check this example project, as the purpose of this functions is somewhat explained there.Nothing special otherwise, just a plain linker and visibility issue.
Please sign in to leave a comment.
Comments
4 comments