POC for a new harness designed for power measurement purposes.#85130
Conversation
679de9e to
c474ca5
Compare
| pytest_args: [--probe=stm_powershield, | ||
| --probe-port=<path_to>/STMicroelectronics_PowerShield__Virtual_ComPort] |
There was a problem hiding this comment.
These two args (--probe and --probe-port ) should be provided via the command line, as they vary, as opposed to the pytest_dut_scope: session and the properties in test_expected_values.yaml file which are "portable"/"fixed" regardless of the probe and port used :)
There was a problem hiding this comment.
Would it be possible to move
- name: "wakeup_timer"
measurement_time: 2
num_of_transitions: 1
rms: [0.26, 140]
to
harness_config:
measurements:
- name: "wakeup_timer"
measurement_time: 2
num_of_transitions: 1
rms: [0.26, 140]
instead of the separate file? not sure what having the commands in a separate file acheives :)
4109da0 to
1424b32
Compare
|
@bjarki-andreasen Please take another look. I'm not sure that moving |
Would you argue the same for the --serial option and its parameters? The probe and probe-port are instances of actual hardware right? If i ran the same test locally, would I not need to change the port to match my setup? |
380d8c0 to
91fa4eb
Compare
Yes, you need to change the port to match your setup. @bjarki-andreasen , @nashif Please take a look. |
f202877 to
c0e83bd
Compare
01c20fa to
3aeb382
Compare
|
@PerMac I've changed the code according to your suggestions, please take a look again. |
9ea235c to
d93e39e
Compare
PerMac
left a comment
There was a problem hiding this comment.
In pytest, using yield in a fixture is generally preferred when you need to perform setup and teardown actions. The yield statement allows you to define a teardown step that will be executed after the test completes, ensuring proper cleanup.
Here's why using yield is beneficial in your case:
Explicit Teardown: By using yield, you can explicitly define the teardown process within the fixture, making it clear and maintainable.
Resource Management: It ensures that resources like serial connections are properly closed, avoiding potential issues with resource leaks.
Using del for cleanup is not recommended because:
Unpredictable Timing: The del method is called when an object is garbage collected, which can be unpredictable and may not happen immediately after the test.
Resource Leaks: If the garbage collector does not run promptly, resources may remain open longer than necessary.
8c1760f to
206b8f6
Compare
Add support for powerShield of stm32l562e_dk board. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
206b8f6 to
648a9c8
Compare
|
@PerMac Thank you for your feedback, I've applied your suggestions, please take a look. |
PerMac
left a comment
There was a problem hiding this comment.
All my comments were addressed
If so, please resolve all your conversations, Thank you. |
nashif
left a comment
There was a problem hiding this comment.
Hey, the second commit:
CI: Add power_states, power_wakeup_timer and power_residency_time tests
This is not related to CI, please split this into 3 commits with more details in the commit body explaining what is being tested, for example:
tests: power_states: tests blah blah
This test verified foo bar using the power harness using the STM32XYZ board.....
Do the same for the other tests.
648a9c8 to
09738a8
Compare
…tates During the test, pytest detects each step and calculates the RMS (Root Mean Square) current for every detected state. The test then compares the calculated RMS values against the expected values. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
…tate This test evaluates the residency time of different power states on the stm32l562e_dk board and calculates the RMS (Root Mean Square) current for every detected state. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
As above, the test verify the ability to wake up CPU from the lowest power state. The test has been prepared for stm32l562e_dk board. Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
09738a8 to
b500c13
Compare
POC of Power twister harness.
This pr adds support for power measurements for twister and three example tests.
pm.states: Verifies the transition to all available power states on stm32l562e_dk.
During the test, pytest detects each step and calculates the RMS (Root Mean Square) current for every detected state. The test then compares the calculated RMS values against the expected values, which have been determined manually through experimental observation
pm.residency_time: Tests the residency time of each power state.
This test evaluates the residency time of different power states on the stm32l562e_dk board.
pm.wakeup_timer: Tests the RTC alarm’s ability to wake the CPU from the lowest power state.
Each test calculates RMS current values for each detected state and compares them to expected values, which were manually set based on experimental data.
Setup


To reproduce.:
Power Monitor: e.g.,
/dev/ttyACM0or/dev/serial/by-id/usb-STMicroelectronics_PowerShield__Virtual_ComPort_in_FS_Mode__FFFFFFFEFFFF-if00Target: e.g.,
/dev/ttyACM1or/dev/serial/by-id/usb-STMicroelectronics_STLINK-V3_004##############39-if02