[linux] Create dfu-util script to select correct program (32/64-bit) #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to support dfu-util as a first-class upload option in linux, there needs to be a script that will choose the correct compiled program (x86_64/i386). This PR was inspired by this PR comment.
Why
Since dfu-util is already bundled when installing the STM32 core, this PR removes any outside software dependency necessary for the end-user. Additionally, the STM32CubeProgrammer installer is known to have issues on the mac -- there are workarounds, but it's one more hurdle for the end-user to jump through.
Directory Change
Part of this PR is to rename the
dfu-util
directory todfu-util_i386
so the main script could be calleddfu-util
in the linux directory. (this makes theplatform.txt
config more straight forward) I'm not sure if this changes any kind of build step necessary for the releases.Related Issue
While testing this PR, I noticed a related issue. It seems like the i386 compiled binary is actually compiled for x86_64 systems.
That issue can be ignored if this is expected.I have updated the i386 binaries from the official distribution and tested them on a virtualized 32-bit system.