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

Unable to reset stm32wba52cgux using Python API. #1658

Open
Vadim-klika opened this issue Jan 10, 2024 · 0 comments
Open

Unable to reset stm32wba52cgux using Python API. #1658

Vadim-klika opened this issue Jan 10, 2024 · 0 comments

Comments

@Vadim-klika
Copy link

Vadim-klika commented Jan 10, 2024

Hello,
I am exploring pyocd and trying to write a simple script to reset my NUCLEO-WBA52CG board.

from pyocd.core.helpers import ConnectHelper

if __name__ == '__main__':
    session = ConnectHelper.session_with_chosen_probe(
        unique_id="<my_unique_id>",
        options={
            "target_override": "stm32wba52cgux",
            "dap_protocol": "swd",
            "reset_type": "hw"
        }
    )
    target = session.target
    print(f'TARGET IS {target}')
    target.reset()

    # Close the session and connection.
    session.close()

But I have got the following AssertionError:

TARGET IS <pyocd.target.pack.pack_target.Stm32wba52cgux object at 0x0000026694B00510>
Traceback (most recent call last):
  File "D:\projects\sidewalk\stmc-sid-autotests\qualification\clients\pyoc_client.py", line 14, in <module>
    target.reset()
  File "D:\projects\sidewalk\stmc-sid-autotests\venv\Lib\site-packages\pyocd\coresight\coresight_target.py", line 338, in reset
    self.dp.reset()
  File "D:\projects\sidewalk\stmc-sid-autotests\venv\Lib\site-packages\pyocd\coresight\dap.py", line 665, in reset
    self.probe.reset()
  File "D:\projects\sidewalk\stmc-sid-autotests\venv\Lib\site-packages\pyocd\probe\stlink_probe.py", line 200, in reset
    self._link.drive_nreset(True)
  File "D:\projects\sidewalk\stmc-sid-autotests\venv\Lib\site-packages\pyocd\probe\stlink\stlink.py", line 354, in drive_nreset
    response = self._device.transfer([Commands.JTAG_COMMAND, Commands.JTAG_DRIVE_NRST, value], readSize=2)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\projects\sidewalk\stmc-sid-autotests\venv\Lib\site-packages\pyocd\probe\stlink\usb.py", line 231, in transfer
    assert self._ep_out
AssertionError

On the other hand, it works well when I try it with CLI:

pyocd reset -m hw -t stm32wba52cgux -u <my_unique_id>

What am I doing wrong?

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

No branches or pull requests

1 participant