Maximum code lines per thread (2.x)

Hello,

I am using compute capability 2.x so i can have a recursive function in device and it seems like i am limited by the number of lines of code.
For example when i write 2 or 3 lines like printf("…"); inside the recursive function, the error comes earlier.
So i want to ask if there is a maximum of lines of code per thread in CUDA.

Thanks,
Alexandros