Hi Bin, I hope you're doing well!
I checked your attached code and found that the line causing the issue is the PRINTF. Errors like these can happen if the UART Debug Console is not used within Wireless SDK Examples.
Due to the implementation of the Wireless Stacks, the examples should be imported with the SDK Debug Console set to UART instead of Semihost.
After a project is imported, the Debug Console can be changed by modifying the following setting:

Please let me know if you have any further issues.
Best regards,
Sebastian