Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

armv7m4: add stlink host reset #337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maska989
Copy link
Contributor

JIRA: CI-433

Description

Implemented soft reset for host environment to run test runner without using GPIO's.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: armv7m4-stm32l4x6-nucleo (On host env).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

Copy link

github-actions bot commented Mar 15, 2024

Unit Test Results

7 218 tests   - 242   6 527 ✅  - 217   36m 43s ⏱️ - 1m 57s
  420 suites ±  0     686 💤  -  29 
    1 files   ±  0       5 ❌ +  4 

For more details on these failures, see this check.

Results for commit fb0aa8f. ± Comparison against base commit 04b1486.

This pull request removes 246 and adds 4 tests. Note that renamed tests count towards both.
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.data_in
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.data_in_big
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.data_out
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.data_out_big
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.in_val
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.invalid_req
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.no_data
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit.ioctl.not_valid_fd
…
phoenix-rtos-tests/ioctl/unit ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/ioctl/unit
phoenix-rtos-tests/libc/misc ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/libc/misc
phoenix-rtos-tests/libc/pthread ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/libc/pthread
phoenix-rtos-tests/libc/scanf ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/libc/scanf

♻️ This comment has been updated with latest results.

trunner/target/armv7m4.py Outdated Show resolved Hide resolved
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
timeout=20,
cwd=os.getcwd(),
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't use the os module, since TargetBase should have specific paths to certain locations created (for example self.project_dir).

Also, I'm thinking if we should check if the reset was successful

Copy link
Contributor Author

@maska989 maska989 Apr 26, 2024

Choose a reason for hiding this comment

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

First part is done.

Sadly, second one is not possible, OpenOCD throw non-zero status even if MCU voltage reading is below 3.3v (In our projects this reading is not even used and causing non-zero status return)

trunner/target/armv7m4.py Show resolved Hide resolved
# TODO add text mode
# NOTE: changing boot modes not needed/supported for this target
pass
def _reboot_dut_text(self, hard):
Copy link
Contributor

Choose a reason for hiding this comment

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

According to our last meeting it will be better to add another method, for example called _reboot_dut_command, because as you can see sending a reset command to onboard debugger is definitely not a text mode.

Suggested change
def _reboot_dut_text(self, hard):
def _reboot_dut_command(self, hard):

Then we should introduce a launch_context, where we could specify what reset do we want to use. For now we can just change it temporary this way if needed:
Screenshot from 2024-04-15 12-24-41

@maska989 maska989 force-pushed the maska989/smt32l4x6_host_reset branch from 9b79739 to 14151d9 Compare April 26, 2024 11:15
@maska989 maska989 force-pushed the maska989/smt32l4x6_host_reset branch 2 times, most recently from d2307c4 to e575aa6 Compare April 26, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants