Closed YgorSouza closed 1 year ago
I suppose setting arbitrary addresses would also allow using .hex files, which already include the address for each chunk of data, so this crate could be used in conjunction with the ihex crate. But I've never tried that and I don't know if it's that straightforward.
I really love that idea!
I guess in the meantime the easy solution would be to allow the user to set the address again.
Again I will look into it but feel free to make a PR if you want a faster release.
A previous version of the crate had the ability to override the address, which was removed here. I was wondering if some version of it could be reintroduced to support devices for which we cannot write the firmware to the address returned by the descriptor, for whatever reason.
The device I am targeting returns this memory layout:
The first 16KB are read-only, because that's where the DFU bootloader itself is located. So I have to download the upgrade to 0x08004000 instead of 0x08000000. If I try to upgrade it with the crate as is, it just gets stuck in an infinite loop.
I don't know if the most "correct" solution for this would be to just set the address manually or have the crate skip the non-writable sectors when determining the start address, or to have the device itself omit the non-writable part when sending the descriptor, but I am putting it out there in case someone wants to discuss it.
I suppose setting arbitrary addresses would also allow using .hex files, which already include the address for each chunk of data, so this crate could be used in conjunction with the ihex crate. But I've never tried that and I don't know if it's that straightforward.