-
Notifications
You must be signed in to change notification settings - Fork 13
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
To support AVR DA/DB/DD/EA/DU part, similar to optiboot_dx #2
Comments
Suggestions: If the EEPROM functions are change to allow either negative offsets or to use data-space addresses instead of EEPROM addresses, the functions can be used to access fuses, userrow, and sigrow info as well as eeprom. (Dx devices always have EEPROM mapped into the RAM address space.) (this is also true on xTiny and mega0 chips.) |
Thanks, great point! Would that need to be either at top of the bootloader section or near the bottom of the bootloader section? If it is a Dx part, then AVRDUDE wouldn't know where the top of the bootloader section is (because urboot bootloaders come in different sizes), but it might know where the bootloader section starts, so could read the first page of the bootloader section to suss out configuration etc. The idea is that rather than implementing an explicit command to the bl asking for capabilities/bl config etc, AVRDUDE is to use the already existing UR_READ_PAGE _FL (or STK_READ_PAGE) to read a config table in the bootloader. However, AVRDUDE would need to know where in flash to find the table. Currently urprotocol works like this:
|
Is this the reason that |
Well, combined with the EEPROM idea in that note... If it's a Dx part, avrdude could theoretically ready the fuses to figure out how long the bootloader section is... BTW, it bothers me to have "MCU ID" numbers that a chip can not determine from its own hardware. (Yeah, I realize that this is from the original STK500v1 spec.) |
OK, got you. On Dx parts the bootloader would be able to read from a linear address space that folds everything into it: fuses, signatures, calibration bytes, EEPROM, SRAM, flash, ... Implementing one page read and page write call each would be sufficient. And, requiring the BOOTSZ fuse to be set to the bootloader size would give us to bootloader. I'll have to start reading the data sheet carefully.
Using the signature for IDing simply doesn't work. 58 signatures in
Most will be "mild" clashes, eg
These clashes are the principal justification for establishing an MCU Id. Plus (as we have15.99 to play with) I figured I could transfer more beyond the MCU Id (5 extra bits).
Atmel's way of assigning unique numbers was a failure even then. The MCU ID's are just a way for the programmer AVRDUDE and the bootloader to agree on which chip they talk about.
I tried vvv hard to drum up some sense from the signature bytes... to no avail. Even if signatures had worked (and Atmel had not messed up signatures so badly in the past), we would have been at the mercy of Microchip not messing up in the future :) |
The second byte of the signature DOES indicate flash size with the low nybble, which is n, where flashsize = 1kb * 2^n. The high nybble is either 9 or A (A on exotic parts generally - likely a flag for some feature or another. |
| rounded up Not good enough: urboot bootloaders provide a small info table with their properties at the end of the bootloader section, so the uploader can read that table (at no extra code cost as reading flash is implemented anyway). For classic parts the uploader needs to know exactly how big the flash is so it can read that table at the end of flash (= end of boot section). Signatures are not sufficient. Urboot exchanges an MCU ID with the uploader during handshake via a side channel that costs zero(!) bytes additional bootloader code to achieve this. |
Ah - yeah I suppose that would be a problem on classic AVRs |
Stretch goal will be to add the support of AVR DA/DB/DD part, similar to optiboot_dx.
Ref: optiboot_dx is too diffierent to be included in optiboot (optiboot_x is integrated into optiboot).
The text was updated successfully, but these errors were encountered: