Commit 47f7befc authored by Gerson Fernando Budke's avatar Gerson Fernando Budke Committed by Christopher Friedt
Browse files

boards: arm: mps2_an521: Enable qemu host tty



This configure and connect host /dev/pts/N to arm qemu uart-1. It can
use a real device like /dev/ttyS0. Just switch config between serial
and pty chardev options.

In addition, this update QEMU_EXTRA_FLAGS to use only variables instead
hard coded values.

Signed-off-by: default avatarGerson Fernando Budke <gerson.budke@ossystems.com.br>
parent 1d89cc5a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -12,6 +12,10 @@ set(QEMU_FLAGS_${ARCH}
  )
board_set_debugger_ifnset(qemu)

 # To enable a host tty switch between serial and pty
 #  -chardev serial,path=/dev/ttyS0,id=hostS0
list(APPEND QEMU_EXTRA_FLAGS -chardev pty,id=hostS0 -serial chardev:hostS0)

if (CONFIG_BUILD_WITH_TFM)
  # Override the binary used by qemu, to use the combined
  # TF-M (Secure) & Zephyr (Non Secure) image (when running
@@ -21,5 +25,5 @@ if (CONFIG_BUILD_WITH_TFM)
elseif (CONFIG_SOC_MPS2_AN521_CPU1)
  set(CPU0_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/zephyr/boards/arm/mps2_an521/empty_cpu0-prefix/src/empty_cpu0-build/zephyr)
  set(QEMU_KERNEL_OPTION "-device;loader,file=${CPU0_BINARY_DIR}/zephyr.elf")
  set(QEMU_EXTRA_FLAGS "-device;loader,file=${CMAKE_CURRENT_BINARY_DIR}/zephyr/zephyr.elf")
  list(APPEND QEMU_EXTRA_FLAGS "-device;loader,file=${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}")
endif()
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
		led1 = &led_1;
		sw0 = &user_button_0;
		sw1 = &user_button_1;
		uart-1 = &uart1;
		watchdog0 = &wdog0;
	};

@@ -110,3 +111,7 @@
&nvic {
	arm,num-irq-priority-bits = <3>;
};

&uart1 {
	status = "okay";
};