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

humility i2c could maybe return a non-zero exit code when the I2C operation returns an error #489

Open
hawkw opened this issue May 21, 2024 · 0 comments

Comments

@hawkw
Copy link
Member

hawkw commented May 21, 2024

I wanted to use a bash until loop to retry a humility i2c command until it succeeds, but it looks like humility i2c (and possibly also humility hiffy?) exits with 0 when it was able to successfully execute the hiffy IPC operation on the device, but the IPC returned an error. For example:

eliza@niles ~ $ pfexec humility -t gimlet-c i2c -b rear --device 0x20 --register 0x00 --nbytes 1 --timeout 10000
humility: attached to 0483:3754:000D00344741500820383733 via ST-Link V3
Controller I2C4, device 0x20, register 0x0 = Err(BusLocked)
eliza@niles ~ $ echo $?
0
eliza@niles ~ $

IMO, it would be a bit nicer for humility to exit with a non-zero exit code when the on-device operation fails. That way, the error is visible to the user's shell and you don't have to do things like grepping for the string that indicates an error...

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