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

Poor validation of -O option names/values #1103

Open
pfalcon opened this issue Mar 1, 2021 · 0 comments
Open

Poor validation of -O option names/values #1103

pfalcon opened this issue Mar 1, 2021 · 0 comments

Comments

@pfalcon
Copy link

pfalcon commented Mar 1, 2021

Using pyocd 0.29.0. I'm trying to try different reset types with my board. I tried pyocd flash -v -v -t k64f -f 3000000 -O reset_type=hw zephyr.bin, and don't see any effect from that (related: #1042) - debug logging still says 0003602:DEBUG:cortex_m:reset, core 0, type=SW_SYSRESETREQ as if without the -O reset_type option.

My next motion is to see if that option being considered at all. The usual way would be to pass an invalid option value, and see if the tool errors out. It doesn't:

# pyocd flash -v -v -t k64f -f 3000000 -O reset_type=h2w  zephyr.bin
0001511:DEBUG:session:Project directory: /root
0001517:INFO:board:Target type is k64f
0001535:DEBUG:pyusb_backend:Detaching Kernel Driver of Interface 3 from USB device (VID=0d28 PID=0204).
...

Actually, passing invalid option name to -O doesn't lead to error either:

# pyocd flash -v -v -t k64f -f 3000000 -O reset_ty2pe=h2w  zephyr.bin
0001435:WARNING:cmdline:ignoring unknown session option 'reset_ty2pe'
0001510:DEBUG:session:Project directory: /root
0001515:INFO:board:Target type is k64f
0001534:DEBUG:pyusb_backend:Detaching Kernel Driver of Interface 3 from USB device (VID=0d28 PID=0204).

Generally, I could understand such behavior - a random local tool I've written in a day would behave like that - would look only for supported options/their values, and silently ignore any other value ;-). But that's not the behavior users expect from the standard Cortex-M management tool. So, I hope parameter validation can be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants