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

fix: improve forwards compatibility with spsdk 2.1+ #524

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

kmohrf
Copy link
Contributor

@kmohrf kmohrf commented Apr 9, 2024

Hi,

This PR fixes an incompatibility with spsdk 2.1 which is shipped in Arch Linux. spsdk recently switched to the python-native Enum library and renamed the desc method to get_description in the process.

Changes

get_description is called first and falls back to desc.

Checklist

Make sure to run make check and make fix before creating a PR, otherwise the CI will fail.

  • tested with Python3.9
  • signed commits
  • updated documentation (e.g. parameter description, inline doc, docs.nitrokey)
  • added labels

Feel free to make this change without attribution if you don’t feel comfortable merging it without the checks :)

Test Environment and Execution

  • OS: Arch Linux
  • device's model: Nitrokey 3A NFC
  • device's firmware version: 1.6.0

Cheers

Konrad

@robin-nitrokey
Copy link
Member

Thank you for the PR! We are currently working on vendoring the spsdk dependency to avoid many unnecessary dependencies, see: #519. I’m not sure if that will make it into the next release though. Therefore I’d hold off on merging this to avoid additional merge conflicts with #519. If we are closer to a release, we can decide which one to merge.

@robin-nitrokey
Copy link
Member

Updated to just use McuBoot.status_string which works for both spsdk 2.0 and spsdk 2.1.

spsdk recently switched to the python-native Enum library and renamed
the `desc` method to `get_description` in the process.  By using
device.status_string instead, our code works with both versions.

Co-authored-by: Robin Krahl <robin@nitrokey.com>
@robin-nitrokey robin-nitrokey merged commit 50067b5 into Nitrokey:master Apr 17, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants