Thank you for the answer. Yes the delay is using interrupts, the function is definied in ARM_SysTick.c (attached file).
1.Previously I used FRDM - K20, on this processor I run this same code, and there is running fine. Is it a difference with interrupt handling on these two processors KL25Z (M0+) and K20 (M4)?
2. I developing quadcopter control software, I have two interrupts:
The first is for PID control, motor power controlling, etc... this is should go on 400 Hz. - pid_interrupt()
The second is going in lower speed 50 Hz, its for logging data (speed, altitude, motor powers, etc) to SDcard. - log_interrupt()
On K20 when log_interrupt is executed and and there is interrupt request for pid_interrupt(), the program from the log_interrupt() immediately jumps to the pid_interrupt() function.
But on KL25Z first all lines in log_interrupt() is handled and only after this the program jumps to the pid_interrupt. Why? Is it any way to solve this?
The pid_interrupt() has higher priority than log_interrupt().
Thank you!