Skip to content

Conversation

hakehuang
Copy link
Contributor

  1. Create adc_power_shield sample for any board with adc can be used for power measurement.
  2. Add general_adc_platform power shiled, which can be used for power measurement with the sample application.
  3. the power data is stored in the power_shield folder for further analysis

@zephyrbot zephyrbot added area: ADC Analog-to-Digital Converter (ADC) platform: NXP NXP area: Twister Twister area: Samples Samples labels Aug 27, 2025
@hakehuang
Copy link
Contributor Author

log for mimxrt595_evk board

((.venv) ) ubuntu@ubuntu-OptiPlex-7050:/home/shared/disk/zephyr_project/zephyr_test/zephyr$ scripts/twister --device-testing --hardware-map /home/ubuntu/nxp/mimxrt595_evk_cm33/map.yaml -T samples/boards/nxp/mimxrt595_evk/system_off
ZEPHYR_BASE unset, using "/home/shared/disk/zephyr_project/zephyr_test/zephyr"
Renaming previous output directory to /home/shared/disk/zephyr_project/zephyr_test/zephyr/twister-out.1
INFO    - Using Ninja..
INFO    - Zephyr version: v4.2.0-2411-g0f6f916cbaa4
INFO    - Using 'zephyr' toolchain.
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/shared/disk/zephyr_project/zephyr_test/zephyr/twister-out/testplan.json

Device testing on:

| Platform                      |        ID | Serial device                                         |
|-------------------------------|-----------|-------------------------------------------------------|
| mimxrt595_evk/mimxrt595s/cm33 | 727562924 | /dev/serial/by-id/usb-SEGGER_J-Link_000727562924-if00 |

INFO    - JOBS: 8
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - Total complete:    1/   1  100%  built (not run):    0, filtered:    0, failed:    0, error:    0
INFO    - 1 test scenarios (1 configurations) selected, 0 configurations filtered (0 by static filter, 0 at runtime).
INFO    - 1 of 1 executed test configurations passed (100.00%), 0 built (not run), 0 failed, 0 errored, with no warnings in 29.99 seconds.
INFO    - 1 of 1 executed test cases passed (100.00%) on 1 out of total 1154 platforms (0.09%).
INFO    - 1 test configurations executed on platforms, 0 test configurations were only built.


enable power shield testing on mimxrt595_evk

```
scripts/twister --device-testing --device-serial /dev/ttyACM0
-T samples/boards/nxp/mimxrt595_evk/system_off
-X pm_probe:/dev/ttyACM1,115200
```

an power_shield folder will be created in the build path
whith measured voltage/current/power

Signed-off-by: Hake Huang <[email protected]>
@hakehuang hakehuang force-pushed the lc_power_shield branch 4 times, most recently from 59e3ca2 to 8f0f3f4 Compare August 27, 2025 12:24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at #94585, and only keep 1 platform per vendor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @JarmouniA PR #94585 looks good, I will update according after your PR merged

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to wait for it to be merged, just apply the same filtering and only keep overlay/conf of 1 platform per vendor in the new sample.


config SEQUENCE_32BITS_REGISTERS
bool "ADC data sequences are on 32bits"
default n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default n

zephyr,input-positive = <6>;
zephyr,vref-mv = <3300>;
};
channel@7 { // Connector A0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline line 35

zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
channel@3 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline between nodes

Comment on lines 36 to 37
pinctrl-0 = <&adc0_default>;
pinctrl-names = "default";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move above child node

@hakehuang hakehuang marked this pull request as draft August 28, 2025 03:32
@hakehuang hakehuang force-pushed the lc_power_shield branch 5 times, most recently from a113789 to cd51acf Compare August 28, 2025 07:31
@hakehuang hakehuang marked this pull request as ready for review August 28, 2025 08:01
add power_shield sample for general_adc_platform
power shiled, to record power/voltage/current

Signed-off-by: Hake Huang <[email protected]>
1. general power shield work with the adc_power_shield sample
2. config samples to config probe
3. add readme

Signed-off-by: Hake Huang <[email protected]>
Copy link

Copy link
Contributor

@dsseng dsseng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a really great addition

Comment on lines +29 to +31
# Additional development tools
ipython>=8.0.0
jupyter>=1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these actually used here?

Comment on lines +8 to +14
# Set UTF-8 encoding for stdout/stderr
os.environ['PYTHONIOENCODING'] = 'utf-8'

# For Python 3.7+, you can also reconfigure stdout/stderr
if hasattr(sys.stdout, 'reconfigure'):
sys.stdout.reconfigure(encoding='utf-8')
sys.stderr.reconfigure(encoding='utf-8')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this under def main or __name__ == "__main__" so that the module is cleanly importable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Samples Samples area: Twister Twister platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants