delay in XMC_SCU_CLOCK_Init() function

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ipek
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked
Hello,

At the beginning of every code in my projects I call 2 functions: XMC_SCU_CLOCK_Init(&clockConfig); and SysTick_Config(SystemCoreClock / ticksPerSecond);
XMC_SCU_CLOCK_Init is to select clock source and frequency, SysTick_Config is to configure tick interrupt.
I have several questions about this XMC_SCU_CLOCK_Init function.
-It takes approximately 2 seconds to pass through that function. This duration may not be tolerable for my projects. So I commented out that function and everything works fine(CAN, UART..) Correct me If I am wrong but if I am working with
default values (clock source = DCO1, fdiv = 0, idiv = 1 pclock = 2 x mclock) I don't have to call this function right ?
- Sometimes I cannot pass throug that function... I have several xmc1400 boot kit boards. And with one of them I cannot exit XMC_SCU_CLOCK_Init function. When I debug, I saw that program keep looping in this do-while :
(xmc1_scu.c, XMC_SCU_CLOCK_Init(const, XMC_SCU_CLOCK_CONFIG_t * const config) function, lines 545-560)
do
{
...
}while(SCU_INTERRUPT->SRRAW1 & SCU_INTERRUP_SRRAW_LOECI_Msk);
Weird thing is, I errase chip before doing anything, I use the exactly same code for all these boards, they have the same hardware configuration but some of them have this problem..
For now I comment it out only. But I know this is not a solution.

Best regards,
İpek
0 Likes
1 Reply
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
0 Likes