Thanks for your feedback.
I have identified that the problem is due to the EDBG chip (usb-serial bridge) which requires DTR signal to enable the serial port RXD and TXD pins.
Including the line of code "serial->setDataTerminalReady(true);" after opening the serial port, the serial port application is now working fine. I guess this is automatically carried out on hyper-terminal software and tera-term software.
Whether the communication uses the flow control or not,some of the hardware bridge requires the flow control signals to be set for the first time after power ON.