Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pull request for V2.1#66

Merged
cpldcpu merged 6 commits into
masterfrom
Testing-V2.1
Jul 26, 2015
Merged

Pull request for V2.1#66
cpldcpu merged 6 commits into
masterfrom
Testing-V2.1

Conversation

@cpldcpu

@cpldcpu cpldcpu commented Jul 26, 2015

Copy link
Copy Markdown
Member

Some stability and realiblity fixes. Details below.

@cpldcpu

cpldcpu commented Jul 26, 2015

Copy link
Copy Markdown
Member Author

The new release fixes two nasty bugs:

Devices could end up in deadlock if the bootloader was invoked without USB being connected

This was an issue reported by Olimex for their devices. Not sure if this appeared anywhere else.

I found that the zener diode and resistor used in most V-USB implementations tend to bias the D+ input to an undefined state where it is very sensitive to external noise. Activating the internall pull up did not alleviate this issue and would have caused trouble in USB operation since only weak pull downs are present at the host.

In this situation it was possible to inject noise into the D+ pin and activate the pin change interrupt. In micronucleus, this caused USB_INTR_VECTOR(); to being invoked and exit early without resetting the int flag. Solution: Reset int flag manually. (+4 bytes)

More noise could actually trigger the usb resynchronisation code, which also relies on a clean D+. Solution: Use D- for resynchronization. (+0 bytes) D- is stabilized by the pull up resistor.

Enumeration of Micronucleus on 12MHz CPUs sometimes failed on some USB3.0 ports

It appears that some USB3.0 ports tend to resend packets after a shorter delay than USB2/1.1 ports. This led to a timeout of PID IN transmissions in some cases where preparing the data took a long time on slow CPUs. Most of the CPU time is actually spent on calculating the CRC, therefore this issue could be fixed by switching to the fast CRC routine. I supplemented an optimized version by @gblargg, which is a couple of bytes smaller than the original V-USB fast CRC. Unfortunately this still adds 20bytes...

@cpldcpu

cpldcpu commented Jul 26, 2015

Copy link
Copy Markdown
Member Author

Merging, since I am not aware of further bugs...

cpldcpu added a commit that referenced this pull request Jul 26, 2015
@cpldcpu cpldcpu merged commit 3e01026 into master Jul 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant