I checked serial output of it on baud 74480 which is its bootloader output ,in the hang state it just shows some lines till boot mode and then no serial on any baud rate.
I failed to know the reason. I tried different code but I don't think the code is problem . It just randomly stuck at boot sometimes. Can anyone help me ?