-
Notifications
You must be signed in to change notification settings - Fork 11
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
Urboot 8.0 pre-release for testing #34
Conversation
The STK500v1 protocol could work with avrdude -c arduino, whilst urprotocol needs avrdude -c urclock. As avrdude v7.1+ with the urclock programmer is now reasonably widely distributed, the older less efficient STK500v1 protocol has been withdrawn to aid clarity and maintainability of the urboot.c code.
These generate a lot of code and are only needed in absence of avrdude -c urclock. Removing the code for patching and verifying a patched bootloader in urclock.c makes it cleaner and easier to maintain.
This feature, when set, creates bootloaders that, on a flash write, check the contents of flash first, and only when needed write data to flash. At this stage it is experimental.
When called from user space these two bytes of code ensure that the reset vector won't be bricked by the bytes in buffer rotating from the intended place.
Pleasant to see that the new version uses even less code.
For the v7.x version, and
For the v8 version, where the protect-reset is already enabled by default. It's a tight fit... but still it fits and gets even smaller if protect-reset is disabled. However I one issue, that was already partially present in the v7 version as well, gives me some head aches.
The vbl_patch() code has been now completely removed from
To enable the That said, |
It took my PC 23 hours to compile the 1m+ urboot bootloaders, and And then there is the new
@mokrafoka Ahh, good. I had not realised. I always seem to compile EEPROM in for dual boot.
Yes, patching is best done outside the bootloader except for reset protection, which is important to protect bootloaders from bricking. BTW, reset protection is by default added iff there is space left for it; that hasn't changed; bootloader protection from overwriting itself ( Note that patching the application jump costs a lot of code: The bootloader would have to check whether it the sketch is already patched; if so don't do it again (that would lose the jmp to the application). The bootloader would need to figure out where the application sits (Is it a relative jump? Is it an absolute jump?) Then copy the jmp to the correct vector; if it's a relative jmp shorten the distance to the application accordingly. These things cost a lot of code and actually are best done by a little PC-application that process the output of the compiler. You could even use AVRDUDE for that:
This assumes a 384-byte bootloader. You'd need the part with the correct bootloader on, though. And it would cost the time to burn the flash. Once could imagine a variant of the
The latter doesn't exist (yet) but would be much much better than ballooning the bootloader for every part. |
Nice improvements. I will carry out some tests over the weekend. |
I have done some testing for five boards in discussions #36 (Digispark ATtiny85, Digispark Pro ATtiny167, Mega R3 ATmega2560, Pro Mini ATmega328P, UrclockMega ATmega1284P). @MCUdude, @mcuee Feel free to add tests for your own boards that you happen to have if they are different MCUs. This does not need to be the full |
I have limited time in the following days, but I'll try on a few different MCUs. Urboot 8.0 will require Avrdude 8.0? If so, I won't be updating the bootloaders in my Arduino cores any time soon because they rely on Arduino's statically built Avrdude binaries. |
No. Urboot 8.0 bootloaders work with Avrdude 7.1 onwards, the earliest AVRDUDE version that knew urboot bootloaders. The only difference is that older Note that the |
First test with ATmega328PB -- good.
|
Hmm, our avrdude repo should have the statically linked avrdude binaries for avrdude 7.3 for both Windows and Linux (including libserialport support). I did not put up macOS binaries because I could not build libserialport in the cross-compile container. I can upload hat macOS binary as well if you want -- it will be no worse than Arduino avrdude-packing provided 7.2 binaries. We can do the same for upcoming avrdude 8.0 release. Reference: |
Hmm, I spent some time this afternoon but I could not get either ATmega32A and ATtiny13A to work. It has nothing to do with urboot but rather I have issues with the USB to TTL converter connections to the boards. I may have to try another time. |
Stefan just ordered a few boards from me, so he will have reliable hardware to test with in just a few days.
@mcuee it would be really neat if we could provide statically built binaries for these platforms. And even better if we used the patched version of libserialport that also works on the latest macOS versions. {
"name": "avrdude",
"version": "7.2-arduino.1",
"systems": [
{
"size": "1243922",
"checksum": "SHA-256:b5b88e4f52c0edb861f5ae54acbd752f9ecd562a4db4d821ab8c276ee5696dab",
"host": "arm-linux-gnueabihf",
"archiveFileName": "avrdude_7.2-arduino.1_Linux_ARMv6.tar.gz",
"url": "http://downloads.arduino.cc/tools/avrdude_7.2-arduino.1_Linux_ARMv6.tar.gz"
},
{
"size": "1348250",
"checksum": "SHA-256:a3862e6a38668c2688dc0822b16c3f824612cc606259b6813bc5778d36c92ba9",
"host": "aarch64-linux-gnu",
"archiveFileName": "avrdude_7.2-arduino.1_Linux_ARM64.tar.gz",
"url": "http://downloads.arduino.cc/tools/avrdude_7.2-arduino.1_Linux_ARM64.tar.gz"
},
{
"size": "928946",
"checksum": "SHA-256:256cbde856714a18c11b4c99f6b00eed65e4208c92425fa9cfd75a5bdfb6ab09",
"host": "x86_64-apple-darwin12",
"archiveFileName": "avrdude_7.2-arduino.1_macOS_64bit.tar.gz",
"url": "http://downloads.arduino.cc/tools/avrdude_7.2-arduino.1_macOS_64bit.tar.gz"
},
{
"size": "1256881",
"checksum": "SHA-256:25e1b568757d9a58b9663e4493ffc04b9e6d690535c9c1e6c1db7d1ecffb5eff",
"host": "x86_64-linux-gnu",
"archiveFileName": "avrdude_7.2-arduino.1_Linux_64bit.tar.gz",
"url": "http://downloads.arduino.cc/tools/avrdude_7.2-arduino.1_Linux_64bit.tar.gz"
},
{
"size": "1252284",
"checksum": "SHA-256:86a811f6ba2bebbb717a524fcff495f0ebb146abcd15d341a10d867b8e8c83fd",
"host": "i686-linux-gnu",
"archiveFileName": "avrdude_7.2-arduino.1_Linux_32bit.tar.gz",
"url": "http://downloads.arduino.cc/tools/avrdude_7.2-arduino.1_Linux_32bit.tar.gz"
},
{
"size": "1682746",
"checksum": "SHA-256:5536c9fcb41f4a36aa55b3711a0d74943a401261b15cc8aae2473c30ff292021",
"host": "i686-mingw32",
"archiveFileName": "avrdude_7.2-arduino.1_Windows_32bit.tar.gz",
"url": "http://downloads.arduino.cc/tools/avrdude_7.2-arduino.1_Windows_32bit.tar.gz"
} |
... covering m32a and t13a. And I ordered dev hardware from an aliexpress vendor for the t2313. @MCUdude @mcuee Testing any other (popular or exotic) classic MCUs you might have access to highly appreciated. @mcuee, thanks for testing the m328pb! |
I'm using the most "maxed out" autobaud vector bootloader option for all targets.
|
@MCUdude This is brilliant news! Looks like I can release u8.0 soon. Thank you so much |
U
which updates flash, ie, only changes flash when new content is different (less wear and faster)will havenow has v8.0 bootloaders(git willing)Now they need a bit of testing...
(*) The way urboot is compiled tends to fill out unused space with frills so that shorter code isn't readily visible, but it is