CCS version : 12.7.0
Arm compiler version : 3.2.2LTS
Syscfg version : 1.20.0
I tested the UART function every minute in the basic_ble project of SDK: 7.40.00.64. When I open the UART for the first time, it's normal, then I also called UART2_close() to close it, but as long as I called sleep() or usleep(). As a result, my second call to UART2_open() failed. I used the Debug mode to check and found that object->state.opened in UART2_open() was set to true, resulting in return NULL, but I am sure that after I called UART2_close() , object->state.opened is set to false, but it will be set to true after calling sleep()。
I wrote the same Code to SDK: 7.10.00.35 and it doesn't happen.
Calling UART2_close() and calling sleep() are in different threads. Is it because it enters sleep() first, so UART2_close() is not actually executed successfully?