-
Notifications
You must be signed in to change notification settings - Fork 132
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
Support writing binary images directly from flash command. #770
Comments
I made a working POC by using code from the @jessebraham A clean solution for this would involve some refactoring of that code, probably in a way where a lot of handling moves into the FirmwareImage trait and it implementers. I'd be willing to give that a go, but I don't know if you have anything planned for #772 in that area. |
Sorry for the late response. With regards to your first comment, I think is is reasonable enough functionality to add. I guess it overlaps a bit with the current I do plan on doing more refactoring here, but I need to spend some time thinking about how things should look. There are still some details I'm unsure of. If you have any ideas then I think for now, feel free to go ahead and implement them; we can always make additional changes after the fact if needed. If you don't have the time/energy to implement it yourself, feel free to leave some notes here and I can look into it at some point. |
Currently the flash command expects an ELF image to be flashed to the device. This makes sense in the context of a cargo project since the output there will always be an ELF image. But on the command line it would be useful to be able to directly flash an already converted image. In our case we already build those for OTA updates and it would be convenient to be able to use the same files when flashing directly.
It looks to me like it's should be doable to just detect the type of file passed to the flash command based on the magic bytes in the file. An ELF file could be converted and flashed, but when a ESP binary is found it's just flashed directly. All of that would then be transparent for the user and 'just work' regardless of the type of image used. Would this be a sensible approach, or would a more explicit (separate command or extra argument) be preferred?
This might be a solution to #684 as well.
The text was updated successfully, but these errors were encountered: