K_sleep from main function

Hi,

It seems like my system is crushing before going to deep sleep,

I have noticed that if I remove a k_sleep of 500 ms, just before going to deep sleep the system does not crush.

I was wondering if it is allowed to call k_sleep from main function. I know in other rtos is is not allowed since main is not running in a thread context. I would like to know if this the case in zephyr as well