twister: fix baud setting for detected devices

When generating new map we store serial_baud, but the schema has 'baud'
only, so call this baud in the class and resolve the issue of creating
new maps.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2021-12-14 18:28:17 -05:00
commit 018ccd6210

View file

@ -740,7 +740,7 @@ class DeviceHandler(Handler):
else:
serial_device = hardware.serial
logger.debug("Using serial device {} @ {} baud".format(serial_device, hardware.serial_baud))
logger.debug(f"Using serial device {serial_device} @ {hardware.baud} baud")
if (self.suite.west_flash is not None) or runner:
command = ["west", "flash", "--skip-rebuild", "-d", self.build_dir]
@ -799,7 +799,7 @@ class DeviceHandler(Handler):
try:
ser = serial.Serial(
serial_device,
baudrate=hardware.serial_baud,
baudrate=hardware.baud,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
@ -4089,9 +4089,7 @@ class DUT(object):
runner=None):
self.serial = serial
self.serial_baud = 115200
if serial_baud:
self.serial_baud = serial_baud
self.baud = serial_baud or 115200
self.platform = platform
self.serial_pty = serial_pty
self._counter = Value("i", 0)