Hello Marco,
Whether the is the hardware problem , doest the 32.768 RTC work well ?
I have test you project on FRDM-K22f board , the chip is MK22FN512, it work well .
On first built , there have one simple project , after i include the header file "#include "gpio_pins.h"" on the
file of "trata_teclas.c" , it can work well .
I also take a screenshot about single-step debug , you can check it can run well on the function of "CLOCK_SYS_EnableRtcClock" .
So i please check the hardware , you can refer to the sch of frdm-k22f.







Hope it helps
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Have a great day,
Alice Yang