Fixed serial port logging

Before writing on the serial port, the port must be opened.

Change-Id: I630c6807f1c19070aa2981708a0d85f9a12e370a