Sorry for my delay.
I don't think the problem resides on the usleep and sleep functions. After some tests not using this functions, i had the same problem.
On my code i have a extern interrupt that triggers a software procedure on xgate, this extern interrupt is frequent trigger on a timer basis ~500 ms, meanwhile i have the 4 timers running on free mode setting a interruption flag after the timer has reach the configuration value for timeout. During my tests, after a while between 30 minutes to 2 hours (the "crash" doesnot have a exact time), the CPU has stopped, and xgate too.
I have write code on CPU to send something to the serial port whenever the main cicle has ended, and on xgate to toggle a led on the begining of the software procedure begin.
Before the crash i have received both "signals", the serial port character to my hyperterminal and i have seen the led toggling, after the crash, no characters and no led toggling.
If i comment the xgate rotine, the crash takes a lot longer time to crash, but it crashes.
If i comment the timers, the CPU and xgate does not crashes.
I believe there is some problem attending the interrupts caused by the timers. Maybe the timers for some reason stops generating the interrupts.