-
Notifications
You must be signed in to change notification settings - Fork 231
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
[sw/bootloader] add TWI boot option #1108
base: main
Are you sure you want to change the base?
Conversation
The bootloader gets to big if all options are enables. How should we handle this? Maybe disable TWI by default but add an additional test where SPI is disabled instead? (I'm gonna extend the documentation when we resolved this) |
Nice! Thank you very much!
Oh I know this problem... 🙈
I was thinking about rewriting the bootloader in plain assembly... But to be honest, I'm too lazy for that... 😅 So yes, we could disable the TWI option by default and let the user decide if this is a relevant feature. |
I actually use the C ISA extension so the bootloader is always small enough, but I guess I'll change the default and then the user can enable it if needed. I would actually suggest changing the warning as well and recommend recompiling the bootloader for each processor to enable a potentially smaller bootloader, what do you think? |
While writing to the TWI memory via the bootloader is not planned, I will probably upload a Python script to flash via an USB I2C adapter. |
That's a good solution! But I would recommend to provide the pre-built bootloader image compiled with the minimal ISA options only - so it is compatible to any ISA configuration.
Which warning? Sure, we could add a note/tip to the according section of the documentation for this. Btw, we have already enabled link-time-optimization and However, maybe it is worth a try to compile the bootloader with the absolute minimal ISA configuration which is
I think we could re-use parts of the "SPI write" code? I just scanned your code briefly, but I think you are using a fixed number of address bytes for accessing the TWI flash, right? Maybe we could also make this configurable just like we did for the SPI accesses. |
I agree, the pre-built should be compatible with any (but E currently) ISA configuration. But we could encourage the user to build the bootloader to their needs and ISA.
This one in
But actually I'm fine with it, because the first part says to allow, which actually implies if you need it...
Probably not?
I'll look into it. This would also have the advantage that the bootloader would actually work on all ISA configurations.
Probably yes? Unfortunately I don't have a use case at the moment, but I keep it in mind. Probably not in this PR though. Some other bootloader extensions have a higher priority, you'll see :)
I agree, I'll add that one! |
👍
Oh, right. I forgot about that... I think we could remove that. It does not capture all possible ISA extensions. So basically it is useless.
Interesting! I was not aware of that option. I'll look it up.
I just tested that and it saves more than 100 bytes (yeay!). -> #1118
Cool, thanks! |
Add ability to read program from TWI (also known as I2C) memory like common EEPROMs with one address byte.