-
Notifications
You must be signed in to change notification settings - Fork 382
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
Pull request for V2 #43
Conversation
zero sized "In" requests require more handshaking, but do not add more error checking or more security.
The block transfer is now done in the address and indexfield of a setup-packet to save a lot of memory in the firmware: This requires twice the number of transmissions, but is effectively faster due to less bus congestion and resends.
- removed code for replies from SRAM. The new protocol does not need this - only use zero initialized global variables to avoid having a data section
SETUP/DATA timed out under Linux
1578 bytes, yay..
Conflicts: commandline/builds/Windows/micronucleus.exe
Starting to do some work on V2 again. @Bluebie, one thing I have been considering is to remove the option to save the osccall in the flash. The reason for this is that it gives a false sense of security in my opinion. Since the RC oscillator also has a temperature dependent component, the saved calibration may not be valid if the programming and use temperature are different. (e.g. a device programmed in the summer may fail in the winter). Do you know anything that would break when not saving osccal? It seems to me that the Digispark libraries still have their osccal.asm included. Edit: Just checked the data sheet. 30°C of temperature difference leads to 1% oscillator frequency deviation. |
All DigiSpark sketches which do not use a USB library would start at about 3% extra clock inaccuracy when powered by something other than a non-sleeping USB host computer. Also any time a DigiSpark is tested on a USB connection and then run without one later (DigiUSB as print-style debugging is pretty common) would cause unexpected and difficult to debug bugs. 3% doesn't sound like much but it's made a big difference to a lot of timing sensitive stuff. Micronucleus only added osccal saving around 1.06 and it was added for good reasons. I wouldn't personally recommend micronucleus be used on DigiSparks without it. |
Ok, then I'll leave the option in. If the configuration systems pans out as well as I hope, it is still possible to offer different versions of the hex files. Btw, I took the liberty to remove the trailing text from your post. What an odd feature of github to allow editing of other peoples posts? |
Implemented changes to the protocol from V1.x to V2.x:
|
Addition of support for 16kb devices poses a bit of a problem. Since the commandline tool is oblivious to the type of device it is programming, it has to be inferred from the available data whether a JMP or RJMP is used or has to be inserted. It is not sufficient to check for the user space size, since:
It should be noted, that 1. would be more easily solved if all vector handling was done in the client firmware since it is known during compiling of firmware whether JMP is supported or not.. However, 2. requires some complixity and error handling that would bloat the firmware. |
Changes to commandline tool
|
Added new global flag to enable unsafe optimizations: This will disable several safety features in microncleus to save around 40 more bytes Disabled features: * Stack pointer and SREG initialization in CRT * Client side reset vector patching * USB collision detection. Micronucleus will not work reliability with hubs if this is disabled. See t85_aggressive configuration for usage examples.
ENABLE_UNSAFE_OPTIMIZATIONS Added new global flag to enable unsafe optimizations. This addresses several discussions about potential additional optimization by removing parts of the code that were left in as a fail safe or to support rare special cases. (#58) Currently the only configuration using this is "t85_aggressive", which should not be used if reliable operation is a requirement, anyways. Setting this define will disable several safety features in microncleus to save around Disabled features:
See t85_aggressive configuration for usage examples. |
I am cleaning up the repository a bit. I removed ruby and update, as they are not yet compatible to V2.0. They can be readded later, once they have been updated. |
Conflicts: firmware/releases/release notes.txt upgrade/readme.txt
First release of V2.0 to master.
@Bluebie: I have pushed V2.0 to master. Please check if you are ok with the readme and so on. I removed some parts that were not updated to V2.0 yet (ruby, upgrade) @sodabrew: Can you provide an OS X binary of the commandline tool again? There were some updates and I had to remove the last binary to prevent it from being out of sync. |
@Bluebie: Noticed one more thing: Can you update the tagline of the repository to reflect that not only ATtiny85 is supported? |
Sure thing, I'll take a look as soon as I can. |
This pull request is here to have a place to discuss and document changes leading to v2 Please don't merge yet.
Todo
Firmware
Commandline
Release
This is a completely new architecture.