I have the same problems. As the problem looks like, it causes / dev / ttyAMA0:
How to solve the problem? The application works until the serial port is closed.
I would ask the user "micro" if he can say more about how he solved the problem.
I've tried several suggestions from the Internet, but none has been successful. I do not use the ttyAMA0 port itself because I have a USB / RS232 adapter connected to USB, so I only use ttyUSB0 in the application.
After some research I realized that the problem is caused by the USB to UART bridge.
Something is probably wrong with the driver. When I have more time, I will try to find out more.