diff --git a/scripts/pylib/power-twister-harness/stm32l562e_dk/PowerShieldConfig.py b/scripts/pylib/power-twister-harness/stm32l562e_dk/PowerShieldConfig.py index abd3a9d7e320c..07c39dc175385 100644 --- a/scripts/pylib/power-twister-harness/stm32l562e_dk/PowerShieldConfig.py +++ b/scripts/pylib/power-twister-harness/stm32l562e_dk/PowerShieldConfig.py @@ -70,7 +70,6 @@ class SamplingFrequency: FREQ_2 = "2" # 2 Hz frequency FREQ_1 = "1" # 1 Hz frequency - output_file: str = "rawData.csv" sampling_frequency: str = SamplingFrequency.FREQ_1K data_format: str = DataFormat.BIN_HEXA function_mode: str = FunctionMode.HIGH diff --git a/scripts/pylib/power-twister-harness/test_power.py b/scripts/pylib/power-twister-harness/test_power.py index 693850f5d006c..9ab0aecc8721e 100644 --- a/scripts/pylib/power-twister-harness/test_power.py +++ b/scripts/pylib/power-twister-harness/test_power.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 import logging +import os import pytest from abstract.PowerMonitor import PowerMonitor @@ -27,6 +28,11 @@ def test_power_harness(probe_class: PowerMonitor, test_data, request, dut: Devic # Initialize the probe with the provided path probe = probe_class # Instantiate the power monitor probe + # Set path for raw output data + build_dir_path = request.config.getoption("--build-dir") + if os.path.exists(build_dir_path): + probe.power_shield_conf.output_file = os.path.join(build_dir_path, "power_raw_data.csv") + # Get test data measurements_dict = test_data