-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Describe the bug
Building off the solution for #37538, I'm finding that the bossac runner cannot import devicetree.edtlib, as evident from the warning generated by
zephyr/scripts/west_commands/runners/bossac.py
Lines 250 to 253 in 14d59b3
| if MISSING_EDTLIB: | |
| self.logger.warning( | |
| 'could not import edtlib; something may be wrong with the ' | |
| 'python environment') |
Manually installing the devicetree pkg fixed this problem
python -m pip install scripts/dts/python-devicetree
But I'm wondering if there is a more runner specific solution instead of manually installing the pkg.
To Reproduce
I'm using samples/basic/blinky targeting the adafruit_itsybitsy_m4_express
Steps to reproduce the behavior:
-
west build -b adafruit_itsybitsy_m4_express samples/basic/blinky -
Notes:
west -v flash --bossac='C:\Program Files (x86)\BOSSA\bossac.exe' --bossac-port='COM16'-vis only used to get the trace back for the warning about not importingedtlib.- the path to the bossac.exe is using v1.9.1 x64 from official releases, but I also was able to use the executable shipped with the Adafruit Arduino core for the SAMD v1.7.1 (which seems to use bossac.exe v1.8.0-48-gb176eee)
- Observe error via Python's trace back output.
- Manually install the lib and repeat step 2
python -m pip install scripts/dts/python-devicetree - Observe the led blinking on the board 🎉
Expected behavior
Since other modules in the scripts dynamically add the devicetree pkg to sys.path, I would expect the bossac runner to do something similar.
zephyr/scripts/dts/gen_defines.py
Lines 30 to 33 in 4f0cfdd
| sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'python-devicetree', | |
| 'src')) | |
| from devicetree import edtlib |
But, maybe there's a more elegant solution.
Impact
Unable to flash programs using the bossac executable.
Environment (please complete the following information):
- OS: Windows (not using WSL, rather just using powershell)
- Toolchain Zephyr SDK 0.16.0
- Zephyr v3.2.99 with patch from scripts: runners: bossac: Enable BOSSAC to run on Windows (native) #53783
Additional context
The samples/hello_world seems to require extra config to enumerate the USB CDC serial device (for the adafruit_itsybotsy_m4_express), but I haven't delved into that. Not sure if that is even specific to the bossac runner; I'm still rather new to the zephyr project but I'm highly motivated to learn.