Skip to content

Commit d569a17

Browse files
gromeronashif
authored andcommitted
cmake: emu: Allow QEMU to serve serial on a TCP/IP port
This commit enables users to pass -DQEMU_SOCKET=y for 'west' when selecting to run the build on a QEMU VM. This allows the target's serial port to be served to the host via a TCP/IP port for convenience, easing communication with the target from the external world. Signed-off-by: Erik Schilling <[email protected]> Signed-off-by: Gustavo Romero <[email protected]>
1 parent 139407f commit d569a17

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/emu/qemu.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ elseif(QEMU_PIPE)
6767
foreach(target ${qemu_targets})
6868
list(APPEND PRE_QEMU_COMMANDS_FOR_${target} COMMAND ${CMAKE_COMMAND} -E touch ${QEMU_PIPE})
6969
endforeach()
70+
elseif(QEMU_SOCKET)
71+
# Serve serial console on a TCP/IP port.
72+
list(APPEND QEMU_FLAGS -chardev socket,id=con,mux=on,server=on,host=127.0.0.1,port=4321)
7073
else()
7174
# Redirect console to stdio, used for manual debugging.
7275
list(APPEND QEMU_FLAGS -chardev stdio,id=con,mux=on)

0 commit comments

Comments
 (0)