Get OpenOCDDriver instance from pytest #1517
-
Hello, I am trying to get an However with the following fixture (or when called directly from my test): def openocddriver(target):
yield target.get_driver('OpenOCDDriver') I have the following error when running pytest
Here is the content of my target yaml env file: tools:
openocd: '/opt/zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/bin/openocd'
targets:
main:
resources:
- RawSerialPort:
name: shell_zephyr
port: /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTAD1ABG-if00-port0
- USBDebugger:
match:
ID_PATH: pci-0000:08:00.0-usb-0:1.2
drivers:
- SerialDriver:
name: shell_zephyr_driver
txdelay: 0.001
bindings:
port: shell_zephyr
- OpenOCDDriver:
config: 'boards/vossloh/pmdb/support/openocd.cfg'
search: 'boards/vossloh/pmdb/support'
load_commands:
- 'init'
- 'targets'
- 'reset init'
- 'flash write_image erase {filename}'
- 'reset run'
- 'shutdown' And now for the weird part, when I try this in a standalone python console, it works fine:
The probe is an st-link v2, I got
I don't understand what I am doing wrong here, according to the documentation, it looks like I am doing the proper thing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Ok I understand what I did wrong, I had multiple python virtual env, and the one I used with pytest did not have the modification in labgrid to specify the usb id code of the stlinkv2, after installing the modified labgrid into the virtual env used to run pytest it works fine. Do you want me to file a PR ? |
Beta Was this translation helpful? Give feedback.
Ok I understand what I did wrong, I had multiple python virtual env, and the one I used with pytest did not have the modification in labgrid to specify the usb id code of the stlinkv2, after installing the modified labgrid into the virtual env used to run pytest it works fine.
Do you want me to file a PR ?