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
Any possibility of reducing RTC memory in rboot? #700
Comments
Checksum is only 8 bits, so in random data you'd have a 1 in 256 chance of the checksum being correct, but add the magic so we know we are at least working with an rBoot rtc structure and you're a bit better off. A 32bit checksum would be better, and you could do away with the magic, but that wouldn't save you a lot of space and wouldn't be as logical as first checking we have an rBoot structure with the magic, then validating the contents with the checksum.
No they can't - the rom slot has a range of 0-255, so both of these need to be 8 bit. The flag fields carry more than two options, so cannot be reduced to a single bit each. True, they don't currently need 8 bits each, allowing some room for expansion you could merge the two together and have 4 bits each, but again that's only saving you a byte.
Would this make any difference? Compiles for me without any wasted space, using gcc.
I only see a realistic saving of 2 bytes, so at present I don't see a good reason to make any changes, especially as this would break compatibility with any existing users - rBoot would need to be updated as well as the api and I don't recommend anyone update the bootloader via ota, so devices would need to be recalled to serial flash them. |
Thanks for your response.. FWIW, the pragma compiler directive only tries to ensure that all non byte access are aligned as specified. It could have made a difference if bit fields were used. It's a non issue if the byte/half words/words are aligned manually, as in this case. There's still enough space in the user part of the RTC memory, so not enough justification pursue any change. rBoot is an excellent value add to Sming, thanks for making it available! |
The available RTC memory is very small, and it would help to leave as much possible for application to use. Would the following questions provide the needed considerations?
Doing the above could reduce the RTC mem usage by rboot to just two bytes instead of 9.
The text was updated successfully, but these errors were encountered: