Skip to content

Concatenate packet to send single USB URB transfer - #19

Merged
jquast merged 1 commit into
tehmaze:masterfrom
znog77:master
Mar 11, 2016
Merged

jquast merged 1 commit into
tehmaze:masterfrom
znog77:master

Conversation

@znog77

@znog77 znog77 commented Feb 23, 2016

Copy link
Copy Markdown
Contributor

I attempted to use xmodem to upload firmware to a microcontroller. The CDC USB device programmed into the microcontroller expects the whole data packet (header+data+CRC) to be into a single URB (USB packet) so it did not work as it was. It was easily solved by forming a single packet concatenating the three strings. Note that the buggy implementation is actually that of the microcontroller.

It should not affect non-USB transmissions.

Concatenate header, data and crc so it is sent in a single URB. Some
embedded applications using USB CDC may expect the whole packet in a single USB
single USB Bluk transfer.
@jquast

jquast commented Feb 23, 2016

Copy link
Copy Markdown
Collaborator

In the theory of "file streams" this should not really fix anything, but if it helps you, there's no reason we can't have this change. I approve

@znog77

znog77 commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

I actually had to use Wireshark and compare with what sx was doing. When the parts are sent separately the three USB packets can be seen. If all are sent in one single call, a single USB packet is sent. In my case, this makes xmodem work with Silicon Labs EFM32 (ARM) USB bootloader. It may be useful to others too.

@jquast jquast self-assigned this Mar 8, 2016
@jquast

jquast commented Mar 8, 2016

Copy link
Copy Markdown
Collaborator

I'll task myself to merge, version bump, add to changes file, and publish to pypi within a day or so.

@jquast jquast mentioned this pull request Mar 11, 2016
@jquast
jquast merged commit e5fa53e into tehmaze:master Mar 11, 2016
@jquast

jquast commented Mar 11, 2016

Copy link
Copy Markdown
Collaborator

This is ready for release, we're just waiting the package maintainer to run the pypi command or delegate access, best wishes!

@tehmaze

tehmaze commented Mar 11, 2016

Copy link
Copy Markdown
Owner

Thanks for the PR, version 0.4.3 has been released to PyPi.

@znog77

znog77 commented Mar 11, 2016

Copy link
Copy Markdown
Contributor Author

Thank you guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants