From: Peter Henn Date: Sat, 28 May 2011 10:00:00 +0000 (+0200) Subject: USBasp 2011.05.28. X-Git-Url: http://git.linex4red.de/pub/USBasp.git/commitdiff_plain/deb181ae2c27db872c471a77e85d7190f32962c3?ds=sidebyside USBasp 2011.05.28. unmodified content from archive usbasp.2011-05-28.tar.gz --- diff --git a/Changelog.txt b/Changelog.txt index 208da9440..75e000365 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,11 @@ +usbasp.2011-05-28 (v1.4) +------------------------ +- added TPI support for ATTiny4/5/6/10 (by Slawomir Fraś) +- added support for controllers with flash >128kb (by Slawomir Fraś) +- fixed resync after program enable signal to pulse RST (based on patch by Marco S) +- updated usb driver to V-USB Release 2010-07-15 + + usbasp.2009-02-28 (v1.3) ------------------------ - added support for software control of ISP speed (based on patch by Jurgis Brigmanis) diff --git a/Readme.txt b/Readme.txt index 19d1064aa..2a6611f61 100644 --- a/Readme.txt +++ b/Readme.txt @@ -1,7 +1,7 @@ This is the README file for USBasp. USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply -consists of an ATMega48 or an ATMega8 and a couple of passive components. +consists of an ATMega88 or an ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed. @@ -18,7 +18,7 @@ LICENSE USBasp is distributed under the terms and conditions of the GNU GPL version 2 (see "firmware/usbdrv/License.txt" for details). -USBasp is built with AVR USB driver by OBJECTIVE DEVELOPMENT GmbH. See +USBasp is built with V-USB driver by OBJECTIVE DEVELOPMENT GmbH. See "firmware/usbdrv/" for further information. @@ -36,13 +36,14 @@ interface to slave exists in hardware but the firmware doesn't support it yet. USE PRECOMPILED VERSION Firmware: -Flash "bin/firmware/usbasp.atmega48.xxxx-xx-xx.hex" or +Flash "bin/firmware/usbasp.atmega88.xxxx-xx-xx.hex" or "bin/firmware/usbasp.atmega8.xxxx-xx-xx.hex" to the used controller with a working programmer (e.g. with avrdude, uisp, ...). Set jumper J2 to activate USBasp firmware update function. You have to change the fuse bits for external crystal (see "make fuses"). # TARGET=atmega8 HFUSE=0xc9 LFUSE=0xef # TARGET=atmega48 HFUSE=0xdd LFUSE=0xff +# TARGET=atmega88 HFUSE=0xdd LFUSE=0xff Windows: Start Windows and connect USBasp to the system. When Windows asks for a @@ -107,6 +108,9 @@ after "./configure" I had to edit Makefile: change "avrdude_CPPFLAGS" to "AM_CPPFLAGS" (why is this needed only on mac? bug in configure.ac?) +Notes on Linux: +To use USBasp as non-root, you have to define some device rules. See +bin/linux-nonroot for an example. FILES IN THE DISTRIBUTION @@ -118,6 +122,7 @@ circuit ......................... Circuit diagram in PDF and EAGLE format bin ............................. Precompiled programs bin/win-driver .................. Windows driver bin/firmware .................... Precompiled firmware +bin/linux-nonroot ............... Linux device rule file MORE INFORMATION @@ -127,11 +132,11 @@ following URLs: USBasp .......................... http://www.fischl.de/usbasp/ -Firmware-only AVR USB driver .... http://www.obdev.at/products/avrusb/ +Firmware-only V-USB driver ...... http://www.obdev.at/products/vusb/ avrdude ......................... http://www.nongnu.org/avrdude/ libusb .......................... http://libusb.sourceforge.net/ libusb-win32 .................... http://libusb-win32.sourceforge.net/ -2009-02-28 Thomas Fischl +2011-05-28 Thomas Fischl http://www.fischl.de diff --git a/bin/firmware/Makefile b/bin/firmware/Makefile new file mode 100644 index 000000000..d2a60b736 --- /dev/null +++ b/bin/firmware/Makefile @@ -0,0 +1,10 @@ +MCU_TARGET = atmega8 +FLASHER = avrdude -c usbasp -p $(MCU_TARGET) + +usbasp: fuses + $(FLASHER) -B 1 -U flash:w:usbasp.atmega8.2011-05-28.hex + +fuses: + $(FLASHER) -B 200 -U hfuse:w:0xC9:m -U lfuse:w:0xEF:m +shell: + $(FLASHER) -t diff --git a/bin/firmware/Makefile48 b/bin/firmware/Makefile48 new file mode 100644 index 000000000..724c0528a --- /dev/null +++ b/bin/firmware/Makefile48 @@ -0,0 +1,10 @@ +MCU_TARGET = atmega48 +FLASHER = avrdude -c usbasp -p $(MCU_TARGET) + +usbasp: fuses + $(FLASHER) -B 1 -U flash:w:usbasp.atmega48.2009-02-28.hex + +fuses: + $(FLASHER) -B 200 -U hfuse:w:0xdd:m -U lfuse:w:0xff:m +shell: + $(FLASHER) -t diff --git a/bin/firmware/Makefile88 b/bin/firmware/Makefile88 new file mode 100644 index 000000000..3caaf0c7d --- /dev/null +++ b/bin/firmware/Makefile88 @@ -0,0 +1,10 @@ +MCU_TARGET = atmega88 +FLASHER = avrdude -c usbasp -p $(MCU_TARGET) + +usbasp: fuses + $(FLASHER) -B 1 -U flash:w:usbasp.atmega88.2011-05-28.hex + +fuses: + $(FLASHER) -B 300 -U lfuse:w:0xff:m -U hfuse:w:0xdd:m +shell: + $(FLASHER) -B 200 -t diff --git a/bin/firmware/usbasp.atmega8.2009-02-28.hex b/bin/firmware/usbasp.atmega8.2009-02-28.hex deleted file mode 100644 index b06b92574..000000000 --- a/bin/firmware/usbasp.atmega8.2009-02-28.hex +++ /dev/null @@ -1,241 +0,0 @@ -:100000003BC0A6C154C053C052C051C050C04FC025 -:100010004EC04DC04CC04BC04AC049C048C047C08C -:1000200046C045C044C0040309041C0377007700A0 -:1000300077002E00660069007300630068006C00A2 -:100040002E00640065000E0355005300420061005D -:100050007300700012011001FF000008C016DC05DB -:1000600003010102000109021200010100801909C7 -:10007000040000000000000011241FBECFE5D4E002 -:10008000DEBFCDBF10E0A0E6B0E0E0EFFEE002C0D2 -:1000900005900D92A236B107D9F710E0A2E6B0E0C4 -:1000A00001C01D92A73AB107E1F7C3D41FC7A8CF7B -:1000B00085B7836085BF8BB780648BBF08951F931E -:1000C000CF93DF9360918800635067FD13C08091E8 -:1000D0008500CCE0D0E0C81BD109C457DF4F809128 -:1000E00084008D3209F462C08091620087FD84C073 -:1000F000109288008091600084FF4AC06091610086 -:100100006F3F09F445C0693070F168506093610039 -:100110008091780098E889278093780068E0809142 -:10012000620087FD8BC0209186003091870086FF9A -:100130006DC0A9E7B0E080E090E0F901E80FF91F99 -:10014000E491ED9301966817C1F76150862F90E016 -:100150006F5F0196820F931F9093870080938600B4 -:10016000162F1C5F0BC0109261008091780098E8F8 -:10017000892780937800662391F614E089E790E060 -:10018000E3D01C3019F08FEF809361001093600072 -:1001900094E186B3837031F49150D9F710928900BD -:1001A00010928300DF91CF911F910895683009F07C -:1001B0009FCF83EC809378008AE580936000109253 -:1001C00062008881807659F59A8110928100898138 -:1001D000882309F043C01092820022E081E890E079 -:1001E00090938700809386008F81882319F49E81E5 -:1001F000921708F1922F1FC0CE012CD48F3F51F1DE -:10020000882309F475CF1092610072CF962FD9011F -:10021000E9E7F0E08D9181939150E1F796CFCE011F -:100220000BD5282F8F3F01F7888187FD25C09FEFD1 -:1002300080E880936200909361005ACF89E790E054 -:10024000ABD4682F893008F453C08FEF80936100DE -:100250001EE19CCF8EE1809360004ACF853071F023 -:10026000863091F0883031F1893061F18A3031F196 -:1002700020E081E890E0B4CF9E81DACF90938900AE -:1002800020E081E890E0ACCF8B81813049F1823071 -:10029000F9F0833029F020E080E480936200A4CF5D -:1002A000992349F586E290E0909387008093860039 -:1002B00024E0F2CF21E08BE890E092CF21E081E8CA -:1002C00090E08ECF90938B0020E081E890E088CF83 -:1002D00086E690E0909387008093860022E1DCCF51 -:1002E00084E590E0909387008093860022E1D4CF4C -:1002F000182F1C5F43CF913051F0923061F686E4A5 -:1003000090E090938700809386002EE0C5CF8AE22C -:1003100090E090938700809386002CE1BDCFA82FBA -:10032000B92F80E090E041E050EA60956F5F58F4AB -:100330002D9138EF82279795879510F08427952780 -:100340003F5FC8F3F3CF0895EADF8D939D9308953F -:10035000CF93CFB7CF93C395B09BE9F7B09B09C0BC -:10036000B09B07C0B09B05C0B09B03C0B09B01C051 -:10037000A1C0DF93C0918500DD27C457DF4FB09B3C -:1003800002C0DF91EBCF2F930F931F9306B32FEF94 -:1003900000FB20F94F933F9316B34FEF012700FB6B -:1003A00021F93BE031C04E7F012F16B3216028C0F8 -:1003B000102F4D7F2260000006B329C04B7F2460C0 -:1003C000012F000016B32BC016B3477F28602AC048 -:1003D0004F7E06B320612CC04F7D16B320622FC024 -:1003E0004F7B06B3206432C0422706B349934FEFD8 -:1003F0000000102710FB20F916B31370C9F1297FF4 -:1004000091F2012700FB21F906B3237F89F23150D5 -:1004100058F1102710FB22F916B3277E79F2012735 -:1004200000FB23F92F7C81F206B3102710FB24F97F -:100430002F7971F200C016B3012700FB25F92F7345 -:1004400059F200C006B3102710FB26F9223040F203 -:1004500000C016B3012700FB27F9243028F64F7798 -:10046000206816B30000F9CF10E41ABF002717C0A8 -:100470003B503195C31BD04010E41ABF0881033CA8 -:10048000E9F00B34D9F0209183001981110F121378 -:10049000EDCF093641F10D3211F0013E39F70093ED -:1004A0008A003F914F911F910F912F91DF91CAB711 -:1004B000C6FD51CFCF91CFBFCF91189520918A0023 -:1004C000222379F310918800112311F5343012F1B1 -:1004D0003093880020938400109185003BE0311B0D -:1004E0003093850017C00091880001308CF40AE534 -:1004F0003091600034FD10C000936000C8E7D0E088 -:100500000FC02795A8F45150A9F4220F0000F9CF8D -:100510004AE503C042ED01C0432FC4E1D0E032E020 -:1005200017B31360C09A17BB08B320E413E05F93BE -:10053000012756E008BB279520F4515021F4220FE3 -:10054000F9CF012756E000003B5A08BBD0F22795AF -:1005500028F4515029F4220F0000F9CF012756E06A -:10056000279508BB20F4515021F4220FF9CF012721 -:1005700056E02991332308BB21F60C7F10918900A6 -:10058000110FC651D04008BB11F01093830010E446 -:100590001ABF016017B31C7F402F4C7F5F9100C0D2 -:1005A00000C008BB17BB48BB7CCF8091A5008DB9AC -:1005B0008091A2008EB90895282F8823A1F0883059 -:1005C00008F03FC085E793E09093A4008093A300D8 -:1005D000243001F12530A0F0263081F1263050F191 -:1005E0002730E1F0089586E993E09093A40080938A -:1005F000A30082E58093A50081E08093A200089586 -:100600002230A1F0233070F4213061F780EC809328 -:10061000A600089588E18093A600089583E0809362 -:10062000A600089580E38093A600089580E6809355 -:10063000A60008958CE08093A60008952093A6005C -:10064000089586E993E09093A4008093A30010920C -:10065000A200293041F02A3050F4283051F683E5C9 -:100660008093A500089582E58093A50008952B301E -:1006700031F02C3009F0BDCF81E08093A20081E5FC -:100680008093A500089522B79091A60082B7821B9F -:100690008917E0F3089587B38C6287BBC298C59829 -:1006A00092B72091A60082B7891B8217E0F3C29A05 -:1006B00092B782B7891B8217E0F3C2988091A3009A -:1006C0009091A4008659934009F008958091A50067 -:1006D0008DB98091A2008EB9089587B3837D87BBC1 -:1006E00088B3837D88BB1DB80895582F2091A6003C -:1006F00040E030E057FD16C0C398440FB4994F5FF7 -:10070000C59A92B782B7891B8217E0F3C59892B752 -:1007100082B7891B8217E0F33F5F383029F0550F0D -:1007200057FFEACFC39AE9CF842F08958FB9779BFB -:10073000FECF8FB108950F931F930FE1E091A300B7 -:10074000F091A4008CEA0995E091A300F091A40037 -:1007500083E50995E091A300F091A40080E009955C -:10076000182FE091A300F091A40080E009951335C3 -:1007700039F11DB8C59A92B72091A60082B7891B9E -:100780008217E0F3C59892B782B7891B8217E0F30E -:10079000E091A300F091A40083E0E639F80721F08E -:1007A000002351F00150CECF8091A5008DB98091EA -:1007B000A2008EB90023B1F781E01F910F91089537 -:1007C00080E01F910F910895EF92FF920F931F9376 -:1007D0007B018C01862F8170880F880F880FE09134 -:1007E000A300F091A40080620995D801C70129E017 -:1007F000B695A795979587952A95D1F7E091A3008F -:10080000F091A400099516950795F794E794E09167 -:10081000A300F091A4008E2D0995E091A300F09122 -:10082000A40080E009951F910F91FF90EF9008952B -:100830000F931F938C01E091A300F091A40080EA34 -:100840000995E091A300F091A400812F0995E09112 -:10085000A300F091A400802F0995E091A300F091EE -:10086000A40080E009951F910F910895FF920F93C6 -:100870001F938C01F62EE091A300F091A40080EC70 -:100880000995E091A300F091A400812F0995E091D2 -:10089000A300F091A400802F0995E091A300F091AE -:1008A000A4008F2D09958EE1B7D080E01F910F91A4 -:1008B000FF900895CF92DF92EF92FF920F931F93D4 -:1008C0006B017C01142FE091A300F091A4008CE453 -:1008D0000995D701C60149E0B695A79597958795E3 -:1008E0004A95D1F7E091A300F091A4000995D701B2 -:1008F000C601B695A79597958795E091A300F091CD -:10090000A4000995E091A300F091A40080E009956E -:100910001F3FF1F012B70EE1C701B60155DF8F3F5F -:1009200079F482B7811B8D33B8F312B70150A1F768 -:1009300081E01F910F91FF90EF90DF90CF9008958D -:1009400080E01F910F91FF90EF90DF90CF9008957E -:100950008FE062D080E01F910F91FF90EF90DF90C9 -:10096000CF900895CF92DF92EF92FF920F931F9353 -:100970006B017C01042F122F862F8170880F880F46 -:10098000880FE091A300F091A40080640995D7013D -:10099000C60169E0B695A795979587956A95D1F7B1 -:1009A000E091A300F091A4000995D701C601B69586 -:1009B000A79597958795E091A300F091A4000995DC -:1009C000E091A300F091A400802F09951123C1F0BC -:1009D0000F37F1F012B70EE1C701B601F5DE8F3720 -:1009E00079F482B7811B8D33B8F312B70150A1F7A8 -:1009F00081E01F910F91FF90EF90DF90CF900895CD -:100A000080E01F910F91FF90EF90DF90CF900895BD -:100A10008FE002D080E0F5CF382F882349F020E026 -:100A200092B782B7891B8C33E0F32F5F2317C0F393 -:100A3000089512BA18BA8BEF81BB8FEF87BB17BA34 -:100A400093E094BB8EEF85BB93BF32DB789437DBAA -:100A500036DBFDCFFF920F931F93CF93DF93F82EDA -:100A6000292F062F40916300413051F0443041F06E -:100A70001FEF812FDF91CF911F910F91FF9008956C -:100A8000002309F487C08F2D922F9C01E90110E00B -:100A900053C08091740090917500892B09F058C063 -:100AA000609170007091710080917200909173005C -:100AB00021E0488157DF80916400909165000197A3 -:100AC0009093650080936400892BD9F410926300A1 -:100AD0008091760081FF3AC08091770090E020916C -:100AE0007400309175008217930781F16091700056 -:100AF0007091710080917200909173004881DADEEC -:100B000011E08091700090917100A0917200B091FD -:100B100073000196A11DB11D809370009093710028 -:100B2000A0937200B093730021969E012F19201795 -:100B300008F09FCF40916300413009F4AACF68814B -:100B4000809170009091710091DEB5CF11E0D9CF06 -:100B500060917000709171008091720090917300AB -:100B600020E04881FFDE80917700815080937700FC -:100B7000882309F0A0CF609170007091710080917E -:100B8000720090917300488195DE8091740080938B -:100B9000770091CF10E06DCF0F931F93CF93DF932A -:100BA000082F162F40916300842F8250823038F036 -:100BB0001FEF812FDF91CF911F910F910895662331 -:100BC00099F1802F9C01E90120C0809170009091E3 -:100BD00071002EDE88838091700090917100A09149 -:100BE0007200B09173000196A11DB11D8093700039 -:100BF00090937100A0937200B093730021969E01B0 -:100C0000201B211778F4409163004230F1F6609187 -:100C10007000709171008091720090917300D4DD2A -:100C20008883D9CF183028F610926300812FDF9186 -:100C3000CF911F910F9108950F931F93CF93DF933F -:100C40008C01EC0189818130F1F0823009F4B0C06F -:100C5000833031F1843009F482C0873009F456C002 -:100C6000853009F41EC1863009F4D7C0883009F4F4 -:100C7000A5C0893009F41CC18A3009F42DC180E077 -:100C8000C8E6D0E037C09A9B3EC08091660094DCF5 -:100C900010926700A998FFDC80E0C8E6D0E02AC087 -:100CA000E091A300F091A400E8018A810995C8E6CB -:100CB000D0E0809368002091A3003091A400F80157 -:100CC0008381F9010995809369002091A3003091F7 -:100CD000A400F8018481F901099580936A002091AC -:100CE000A3003091A400F8018581F9010995809352 -:100CF0006B0084E0D0938700C0938600DF91CF9192 -:100D00001F910F91089585E057DCC2CF8091670055 -:100D1000882399F4E8019B8180E02A8130E0822BCE -:100D2000932BAA2797FDA095BA2F809370009093DC -:100D30007100A0937200B0937300F801978180E076 -:100D4000268130E0822B932B909365008093640082 -:100D500083E0809363008FEFC8E6D0E0CBCF809133 -:100D60006700882399F4E8019B8180E02A8130E0C4 -:100D7000822B932BAA2797FDA095BA2F8093700002 -:100D800090937100A0937200B0937300F801978163 -:100D900080E0268130E0822B932B90936500809336 -:100DA000640082E0809363008FEFC8E6D0E0A2CFBA -:100DB00094DCA99A80E0C8E6D0E09CCF80916700DF -:100DC000882399F4F801938180E0228130E0822B1E -:100DD000932BAA2797FDA095BA2F8093700090932C -:100DE0007100A0937200B09373001092750010927E -:100DF000740010927600E8019F8180E02E8130E03F -:100E0000822B932B909365008093640084E0809301 -:100E100063008FEFC8E6D0E06DCF80916700882334 -:100E200099F4E8019B8180E02A8130E0822B932BAA -:100E3000AA2797FDA095BA2F809370009093710018 -:100E4000A0937200B0937300F80184819581292FDB -:100E50002F7020937600492F50E0407F50704295CC -:100E60005295507F5427407F5427480F511D50936F -:100E700075004093740020FF02C040937700E801A2 -:100E80009F8180E02E8130E0822B932B9093650030 -:100E90008093640081E0809363008FEFC8E6D0E028 -:100EA00029CF49DCC8E6D0E08093680081E022CFFA -:100EB00081E080936700F80182819381A481B581EC -:100EC0008093700090937100A0937200B0937300B0 -:100ED00080E0C8E6D0E00ECFE8018A81809366000A -:100EE000C8E6D0E01092680081E004CFF894FFCF0C -:020EF0005AFFA7 -:00000001FF diff --git a/bin/firmware/usbasp.atmega8.2011-05-28.hex b/bin/firmware/usbasp.atmega8.2011-05-28.hex new file mode 100644 index 000000000..4f0db1b69 --- /dev/null +++ b/bin/firmware/usbasp.atmega8.2011-05-28.hex @@ -0,0 +1,296 @@ +:100000003BC0A6C154C053C052C051C050C04FC025 +:100010004EC04DC04CC04BC04AC049C048C047C08C +:1000200046C045C044C0040309041C0377007700A0 +:1000300077002E00660069007300630068006C00A2 +:100040002E00640065000E0355005300420061005D +:100050007300700012011001FF000008C016DC05DB +:1000600004010102000109021200010100801909C6 +:10007000040000000000000011241FBECFE5D4E002 +:10008000DEBFCDBF10E0A0E6B0E0EAE5F2E102C0DD +:1000900005900D92A236B107D9F710E0A2E6B0E0C4 +:1000A00001C01D92AA3AB107E1F766D5D4C8A8CF1E +:1000B00085B7836085BF8BB780648BBF08951F931E +:1000C000CF93DF9360918800635067FD13C08091E8 +:1000D0008500CCE0D0E0C81BD109C457DF4F809128 +:1000E00084008D3209F462C08091620087FD84C073 +:1000F000109288008091600084FF4AC06091610086 +:100100006F3F09F445C0693070F168506093610039 +:100110008091780098E889278093780068E0809142 +:10012000620087FD8BC0209186003091870086FF9A +:100130006DC0A9E7B0E080E090E0F901E80FF91F99 +:10014000E491ED9301966817C1F76150862F90E016 +:100150006F5F0196820F931F9093870080938600B4 +:10016000162F1C5F0BC0109261008091780098E8F8 +:10017000892780937800662391F614E089E790E060 +:10018000E3D01C3019F08FEF809361001093600072 +:1001900094E186B3837031F49150D9F710928900BD +:1001A00010928300DF91CF911F910895683009F07C +:1001B0009FCF83EC809378008AE580936000109253 +:1001C00062008881807659F59A8110928100898138 +:1001D000882309F043C01092820022E081E890E079 +:1001E00090938700809386008F81882319F49E81E5 +:1001F000921708F1922F1FC0CE01CFD48F3F51F13B +:10020000882309F475CF1092610072CF962FD9011F +:10021000E9E7F0E08D9181939150E1F796CFCE011F +:1002200004D6282F8F3F01F7888187FD25C09FEFD7 +:1002300080E880936200909361005ACF89E790E054 +:1002400082D5682F893008F453C08FEF8093610006 +:100250001EE19CCF8EE1809360004ACF853071F023 +:10026000863091F0883031F1893061F18A3031F196 +:1002700020E081E890E0B4CF9E81DACF90938900AE +:1002800020E081E890E0ACCF8B81813049F1823071 +:10029000F9F0833029F020E080E480936200A4CF5D +:1002A000992349F586E290E0909387008093860039 +:1002B00024E0F2CF21E08BE890E092CF21E081E8CA +:1002C00090E08ECF90938B0020E081E890E088CF83 +:1002D00086E690E0909387008093860022E1DCCF51 +:1002E00084E590E0909387008093860022E1D4CF4C +:1002F000182F1C5F43CF913051F0923061F686E4A5 +:1003000090E090938700809386002EE0C5CF8AE22C +:1003100090E090938700809386002CE1BDCFA82FBA +:10032000B92F80E090E041E050EA609530E009C0EC +:100330002D9182279795879510F084279527305E19 +:10034000C8F36F5FA8F30895EADF8D939D93089536 +:10035000CF93CFB7CF93C395B09BE9F7B09B09C0BC +:10036000B09B07C0B09B05C0B09B03C0B09B01C051 +:10037000A1C0DF93C0918500DD27C457DF4FB09B3C +:1003800002C0DF91EBCF2F930F931F9306B32FEF94 +:1003900000FB20F94F933F9316B34FEF012700FB6B +:1003A00021F93BE031C04E7F012F16B3216028C0F8 +:1003B000102F4D7F2260000006B329C04B7F2460C0 +:1003C000012F000016B32BC016B3477F28602AC048 +:1003D0004F7E06B320612CC04F7D16B320622FC024 +:1003E0004F7B06B3206432C0422706B349934FEFD8 +:1003F0000000102710FB20F916B31370C9F1297FF4 +:1004000091F2012700FB21F906B3237F89F23150D5 +:1004100058F1102710FB22F916B3277E79F2012735 +:1004200000FB23F92F7C81F206B3102710FB24F97F +:100430002F7971F200C016B3012700FB25F92F7345 +:1004400059F200C006B3102710FB26F9223040F203 +:1004500000C016B3012700FB27F9243028F64F7798 +:10046000206816B30000F9CF10E41ABF002717C0A8 +:100470003B503195C31BD04010E41ABF0881033CA8 +:10048000E9F00B34D9F0209183001981110F121378 +:10049000EDCF093641F10D3211F0013E39F70093ED +:1004A0008A003F914F911F910F912F91DF91CAB711 +:1004B000C6FD51CFCF91CFBFCF91189520918A0023 +:1004C000222379F310918800112311F5343012F1B1 +:1004D0003093880020938400109185003BE0311B0D +:1004E0003093850017C00091880001308CF40AE534 +:1004F0003091600034FD10C000936000C8E7D0E088 +:100500000FC02795A8F45150A9F4220F0000F9CF8D +:100510004AE503C042ED01C0432FC4E1D0E032E020 +:1005200017B31360C09A17BB08B320E413E05F93BE +:10053000012756E008BB279520F4515021F4220FE3 +:10054000F9CF012756E000003B5A08BBD0F22795AF +:1005500028F4515029F4220F0000F9CF012756E06A +:10056000279508BB20F4515021F4220FF9CF012721 +:1005700056E02991332308BB21F60C7F10918900A6 +:10058000110FC651D04008BB11F01093830010E446 +:100590001ABF016017B31C7F402F4C7F5F9100C0D2 +:1005A00000C008BB17BB48BB7CCF8091A5008DB9AC +:1005B0008091A2008EB90895282F8823A1F0883059 +:1005C00008F042C08EE793E09093A4008093A300CC +:1005D000243019F12530B8F0263099F1263068F131 +:1005E0002730F9F008958FE993E09093A400809369 +:1005F000A30081E08093A70082E58093A50081E0BD +:100600008093A20008952230A1F0233070F42130AD +:1006100049F780EC8093A700089588E18093A700B4 +:10062000089583E08093A700089580E38093A70056 +:10063000089580E68093A70008958CE08093A7003A +:1006400008952093A70008958FE993E09093A40064 +:100650008093A3001092A20081E08093A70029302C +:1006600041F02A3050F4283039F683E58093A50014 +:10067000089582E58093A50008952B3029F02C3051 +:1006800009F0BACF8093A20081E58093A500089578 +:1006900022B79091A70082B7821B8917E0F30895D3 +:1006A00087B38C6287BBC298C59892B72091A70088 +:1006B00082B7891B8217E0F3C29A92B782B7891B6F +:1006C0008217E0F3C2988091A3009091A4008F5903 +:1006D000934019F01092A60008958091A5008DB95D +:1006E0008091A2008EB91092A600089587B3837DF1 +:1006F00087BB88B3837D88BB1DB80895582F209190 +:10070000A70040E030E057FD16C0C398440FB499ED +:100710004F5FC59A92B782B7891B8217E0F3C598DD +:1007200092B782B7891B8217E0F33F5F383029F018 +:10073000550F57FFEACFC39AE9CF842F08958FB999 +:10074000779BFECF8FB108950F931F930FE1E09138 +:10075000A300F091A4008CEA0995E091A300F09128 +:10076000A40083E50995E091A300F091A40080E046 +:100770000995182FE091A300F091A40080E009955D +:10078000133561F11DB822B79091A70082B7821B83 +:100790008917E0F3C29A22B782B7821B8917E0F368 +:1007A000C29822B782B7821B8917E0F3E091A300B9 +:1007B000F091A40083E0EF39F80721F0002351F015 +:1007C0000150C9CF8091A5008DB98091A2008EB94A +:1007D0000023B1F781E01F910F91089580E01F91F0 +:1007E0000F9108959B01AC0181E15695479537958E +:1007F00027958A95D1F78091A6008217D9F020938A +:10080000A600E091A300F091A4008DE40995E09189 +:10081000A300F091A40080E00995E091A300F0917D +:10082000A4008091A6000995E091A300F091A40096 +:1008300080E009950895EF92FF920F931F937B013B +:100840008C01D0DF8E2D8170880F880F880FE0918A +:10085000A300F091A40080620995D801C70129E0A6 +:10086000B695A795979587952A95D1F7E091A3001E +:10087000F091A400099516950795F794E794E091F7 +:10088000A300F091A4008E2D0995E091A300F091B2 +:10089000A40080E009951F910F91FF90EF900895BB +:1008A0000F931F938C01E091A300F091A40080EAC4 +:1008B0000995E091A300F091A400812F0995E091A2 +:1008C000A300F091A400802F0995E091A300F0917E +:1008D000A40080E009951F910F910895FF920F9356 +:1008E0001F938C01F62EE091A300F091A40080EC00 +:1008F0000995E091A300F091A400812F0995E09162 +:10090000A300F091A400802F0995E091A300F0913D +:10091000A4008F2D09958EE1B9D080E01F910F9131 +:10092000FF900895CF92DF92EF92FF920F931F9363 +:100930006B017C01142F56DFE091A300F091A4001D +:100940008CE40995D701C60149E0B695A79597951E +:1009500087954A95D1F7E091A300F091A4000995FD +:10096000D701C601B695A79597958795E091A30005 +:10097000F091A4000995E091A300F091A40080E01B +:1009800009951F3FF1F012B70EE1C701B60153DF21 +:100990008F3F79F482B7811B8D33B8F312B70150C2 +:1009A000A1F781E01F910F91FF90EF90DF90CF9022 +:1009B000089580E01F910F91FF90EF90DF90CF900E +:1009C00008958FE063D080E01F910F91FF90EF902A +:1009D000DF90CF900895CF92DF92EF92FF920F9326 +:1009E0001F936B017C01042F122FFCDE8C2D817074 +:1009F000880F880F880FE091A300F091A400806415 +:100A00000995D701C60169E0B695A7959795879591 +:100A10006A95D1F7E091A300F091A4000995D70160 +:100A2000C601B695A79597958795E091A300F0919B +:100A3000A4000995E091A300F091A400802F0995EE +:100A40001123C1F00F37F1F012B70EE1C701B60163 +:100A5000F2DE8F3779F482B7811B8D33B8F312B78A +:100A60000150A1F781E01F910F91FF90EF90DF906F +:100A7000CF90089580E01F910F91FF90EF90DF904D +:100A8000CF9008958FE002D080E0F5CF382F8823F3 +:100A900049F020E092B782B7891B8C33E0F32F5FD7 +:100AA0002317C0F30895BD9ABB98C39A50E217D09C +:100AB0005A95E9F70895AC0188E605D0842F03D054 +:100AC00089E601D0852F0FD028E030E0382780FB61 +:100AD000869506D02A95D1F730FB02D000D06894D5 +:100AE000BB98C39A16F0C398BB9AE091A800F09106 +:100AF000A9003197F0F7C59AE6B3E3FBE091A800AF +:100B0000F091A9003197F0F7C598089520ECE7DF40 +:100B100046F42A95E1F780E02AE1E5DF2A95E9F736 +:100B2000DECF28E030E0DBDF869587F938272A958D +:100B3000D1F7D5DF27F9322772F3D1DFD0CFDB0130 +:100B4000742FB9DF84E2BFDFE1DF8D937A95D1F7AF +:100B50000895DB01742FAFDF83EFB5DF8DE1B3DFE5 +:100B600084E6B1DF8D91AFDF82E7ADDFCFDF807844 +:100B7000D9F77A9589F7089512BA18BA8BEF81BB25 +:100B80008FEF87BB17BA93E094BB8EEF85BB93BF03 +:100B90008FDA789494DA93DAFDCFFF920F931F9354 +:100BA000CF93DF93082F792FF62E409163004130C9 +:100BB00069F0443059F0463009F492C01FEF812F9C +:100BC000DF91CF911F910F91FF900895FF2009F4BD +:100BD000B2C0802F972F9C01E90110E053C0809193 +:100BE000740090917500892B09F058C060917000D5 +:100BF000709171008091720090917300488121E0A2 +:100C0000EADE809164009091650001979093650001 +:100C100080936400892BD9F4109263008091760050 +:100C200081FF3AC08091770090E02091740030916C +:100C300075008217930781F16091700070917100C7 +:100C4000809172009091730048816CDE11E0809178 +:100C5000700090917100A0917200B09173000196A4 +:100C6000A11DB11D8093700090937100A09372003C +:100C7000B093730021969E01201B2F1508F09FCF83 +:100C800040916300413009F4AACF809170009091A7 +:100C90007100688123DEB5CF11E0D9CF609170007B +:100CA000709171008091720090917300488120E0F2 +:100CB00092DE80917700815080937700882309F03D +:100CC000A0CF60917000709171008091720090913E +:100CD0007300488127DE809174008093770091CF64 +:100CE0008091700090917100602F4F2D32DF8091C4 +:100CF000700090917100A0917200B09173008F0DFF +:100D0000911DA11DB11D8093700090937100A0935F +:100D10007200B093730080916400909165008F1908 +:100D200091099093650080936400892B21F41092BF +:100D3000630011E044CF10E0812FDF91CF911F912C +:100D40000F91FF9008950F931F93CF93DF93082F78 +:100D5000792F162F40916300842F8250823050F0FB +:100D6000453009F446C01FEF812FDF91CF911F91CD +:100D70000F9108954530E9F1662399F1802F9C0188 +:100D8000E90120C0809170009091710089DD888315 +:100D90008091700090917100A0917200B0917300E9 +:100DA0000196A11DB11D8093700090937100A093D6 +:100DB0007200B093730021969E01201B211778F4D6 +:100DC000409163004230F1F66091700070917100C3 +:100DD00080917200909173002EDD8883D9CF1830F6 +:100DE00018F610926300812FDF91CF911F910F9120 +:100DF00008958091700090917100602F412F9FDEC7 +:100E00008091700090917100A0917200B091730078 +:100E1000810F911DA11DB11D8093700090937100F1 +:100E2000A0937200B09373009FCF0F931F93CF9343 +:100E3000DF938C01DC0111968C91813009F44EC056 +:100E4000823009F4E7C0833009F455C0843009F4D6 +:100E5000B5C0873009F486C0853009F45AC18630A0 +:100E600009F410C1883009F4DBC0893009F458C195 +:100E70008A3009F469C18B3009F49CC18C3009F4C3 +:100E8000B7C18D3009F4CBC18E3009F4CFC18F309A +:100E900009F065C1F801938180E0228130E0822B66 +:100EA000932BAA2797FDA095BA2F8093700090935B +:100EB0007100A0937200B0937300978180E0268147 +:100EC00030E0822B932B909365008093640085E043 +:100ED000809363008FEFC8E6D0E038C09A9B3FC094 +:100EE0008091660069DB10926700A998D9DB80E0E9 +:100EF000C8E6D0E02BC0E091A300F091A400D80197 +:100F000012968C910995C8E6D0E080936800E09134 +:100F1000A300F091A400D80113968C9109958093B9 +:100F20006900E091A300F091A400D80114968C917F +:100F3000099580936A00E091A300F091A400D80184 +:100F400015968C91099580936B0084E0D09387006F +:100F5000C0938600DF91CF911F910F91089585E096 +:100F60002BDBC1CF80916700882399F4F80193812E +:100F700080E0228130E0822B932BAA2797FDA09559 +:100F8000BA2F8093700090937100A0937200B09379 +:100F90007300D80117969C91179780E016962C91B4 +:100FA00030E0822B932B909365008093640083E064 +:100FB000809363008FEFC8E6D0E0C8CF80916700D0 +:100FC000882399F4F801938180E0228130E0822B1C +:100FD000932BAA2797FDA095BA2F8093700090932A +:100FE0007100A0937200B0937300D80117969C9182 +:100FF000179780E016962C9130E0822B932B9093DC +:1010000065008093640082E0809363008FEFC8E600 +:10101000D0E09CCF6BDBA99A80E0C8E6D0E096CF09 +:10102000809167008823B1F4D80113969C9113979F +:1010300080E012962C9130E0822B932BAA2797FD0B +:10104000A095BA2F8093700090937100A0937200C6 +:10105000B093730010927500109274001092760095 +:10106000F801978180E0268130E0822B932B9093CA +:1010700065008093640084E0809363008FEFC8E68E +:10108000D0E064CF80916700882399F4F8019381C0 +:1010900080E0228130E0822B932BAA2797FDA09538 +:1010A000BA2F8093700090937100A0937200B09358 +:1010B0007300D80114968C91149715969C91292F42 +:1010C0002F7020937600492F50E0407F507042955A +:1010D0005295507F5427407F5427480F511D5093FD +:1010E00075004093740020FF02C040937700F80120 +:1010F000978180E0268130E0822B932B90936500CE +:101100008093640081E0809363008FEFC8E6D0E0B5 +:101110001DCF1ADBC8E6D0E08093680081E016CFCF +:1011200081E080936700F80182819381A481B58179 +:101130008093700090937100A0937200B09373003D +:1011400080E0C8E6D0E002CFD80112968C9180935F +:101150006600C8E6D0E01092680081E0F7CE8031EA +:1011600009F040C0D80113969C91139780E0129625 +:101170002C9130E0822B932BAA2797FDA095BA2FB4 +:101180008093700090937100A0937200B0937300ED +:10119000F801978180E0268130E0822B932B909399 +:1011A00065008093640086E0809363008FEFC8E65B +:1011B000D0E0CCCEF801938180E0228130E0822B18 +:1011C000932B9093A9008093A800C29ABA9A83E0C7 +:1011D0005DDCC298A99880E159DC65DC80E0C8E656 +:1011E000D0E0B4CE8F3751F180E0C8E6D0E0AECE8B +:1011F00080EC69DC80E067DC8AE048DCC29A85E04C +:1012000045DCC29885E042DC87B3837D87BB88B329 +:10121000837D88BBA99A80E0C8E6D0E097CE76DCD3 +:10122000C8E6D0E08093680081E090CED8011296A5 +:101230008C9149DC80E0C8E6D0E088CEC8E6D0E0FA +:1012400081E0809368001092690010926A00109209 +:0A1250006B0084E07BCEF894FFCF22 +:02125A005AFF39 +:00000001FF diff --git a/bin/firmware/usbasp.atmega88.2011-05-28.hex b/bin/firmware/usbasp.atmega88.2011-05-28.hex new file mode 100644 index 000000000..e17d6cd2b --- /dev/null +++ b/bin/firmware/usbasp.atmega88.2011-05-28.hex @@ -0,0 +1,297 @@ +:1000000042C0ADC15BC05AC059C058C057C056C0ED +:1000100055C054C053C052C051C050C04FC04EC054 +:100020004DC04CC04BC04AC049C048C047C046C084 +:1000300045C044C0040309041C037700770077001F +:100040002E00660069007300630068006C002E00DB +:10005000640065000E035500530042006100730008 +:10006000700012011001FF000008C016DC05040139 +:1000700001020001090212000101008019090400B7 +:1000800000000000000011241FBECFEFD4E0DEBF4F +:10009000CDBF11E0A0E0B1E0EAE6F2E102C00590D8 +:1000A0000D92A230B107D9F711E0A2E0B1E001C092 +:1000B0001D92AA34B107E1F767D5D5C8A1CFE9E60B +:1000C000F0E0808183608083E89A08951F93CF9346 +:1000D000DF9360912801635067FD13C08091250173 +:1000E000CCE0D0E0C81BD109C45DDE4F8091240173 +:1000F0008D3209F462C08091020187FD84C01092A4 +:1001000028018091000184FF4AC0609101016F3F86 +:1001100009F445C0693070F1685060930101809125 +:10012000180198E889278093180168E080910201FE +:1001300087FD8BC0209126013091270186FF6DC07D +:10014000A9E1B1E080E090E0F901E80FF91FE49146 +:10015000ED9301966817C1F76150862F90E06F5FAD +:100160000196820F931F9093270180932601162FEB +:100170001C5F0BC0109201018091180198E889273B +:1001800080931801662391F614E089E191E0E3D0B1 +:100190001C3019F08FEF809301011093000194E15E +:1001A00083B1837031F49150D9F7109229011092E4 +:1001B0002301DF91CF911F910895683009F09FCFFF +:1001C00083EC809318018AE580930001109202016C +:1001D0008881807659F59A8110922101898188233E +:1001E00009F043C01092220122E081E291E0909355 +:1001F0002701809326018F81882319F49E8192170D +:1002000008F1922F1FC0CE01D0D48F3F51F1882327 +:1002100009F475CF1092010172CFD901962FE9E14F +:10022000F1E08D9181939150E1F796CFCE0105D603 +:10023000282F8F3F01F7888187FD25C09FEF80E839 +:1002400080930201909301015ACF89E191E083D517 +:10025000682F893008F453C08FEF809301011EE1AD +:100260009CCF8EE1809300014ACF853071F08630BB +:1002700091F0883031F1893061F18A3031F120E03C +:1002800081E291E0B4CF9E81DACF9093290120E002 +:1002900081E291E0ACCF8B81813049F18230F9F07D +:1002A000833029F020E080E480930201A4CF9923D9 +:1002B00049F584E390E0909327018093260124E0A0 +:1002C000F2CF21E08BE291E092CF21E081E291E058 +:1002D0008ECF90932B0120E081E291E088CF84E7DC +:1002E00090E0909327018093260122E1DCCF82E603 +:1002F00090E0909327018093260122E1D4CF182F1C +:100300001C5F43CF913051F0923061F684E590E06C +:1003100090932701809326012EE0C5CF88E390E0DB +:1003200090932701809326012CE1BDCFA82FB92FF0 +:1003300080E090E041E050EA609530E009C02D9106 +:1003400082279795879510F084279527305EC8F30C +:100350006F5FA8F30895EADF8D939D930895CF937F +:10036000CFB7CF93C395189BE9F7189B09C0189B8B +:1003700007C0189B05C0189B03C0189B01C0A1C0F3 +:10038000DF93C0912501DD27C45DDE4F189B02C0BD +:10039000DF91EBCF2F930F931F9303B12FEF00FB50 +:1003A00020F94F933F9313B14FEF012700FB21F941 +:1003B0003BE031C04E7F012F13B1216028C0102FC8 +:1003C0004D7F2260000003B129C04B7F2460012FC4 +:1003D000000013B12BC013B1477F28602AC04F7EA5 +:1003E00003B120612CC04F7D13B120622FC04F7B21 +:1003F00003B1206432C0422703B149934FEF00009C +:10040000102710FB20F913B11370C9F1297F91F265 +:10041000012700FB21F903B1237F89F2315058F104 +:10042000102710FB22F913B1277E79F2012700FB78 +:1004300023F92F7C81F203B1102710FB24F92F79C7 +:1004400071F200C013B1012700FB25F92F7359F297 +:1004500000C003B1102710FB26F9223040F200C083 +:1004600013B1012700FB27F9243028F64F772068C5 +:1004700013B10000F9CF11E01CBB002717C03B509F +:100480003195C31BD04011E01CBB0881033CE9F04F +:100490000B34D9F0209123011981110F1213EDCFE4 +:1004A000093641F10D3211F0013E39F700932A016E +:1004B0003F914F911F910F912F91DF91CCB3C0FDD0 +:1004C00051CFCF91CFBFCF91189520912A012223F0 +:1004D00079F310912801112311F5343012F1309382 +:1004E000280120932401109125013BE0311B30931A +:1004F000250117C00091280101308CF40AE53091E4 +:10050000000134FD10C000930001C8E1D1E00FC02C +:100510002795A8F45150A9F4220F0000F9CF4AE51D +:1005200003C042ED01C0432FC4E1D0E032E014B17A +:100530001360289A14B905B120E413E05F930127F2 +:1005400056E005B9279520F4515021F4220FF9CF38 +:10055000012756E000003B5A05B9D0F2279528F450 +:10056000515029F4220F0000F9CF012756E02795BA +:1005700005B920F4515021F4220FF9CF012756E09C +:100580002991332305B921F60C7F10912901110F10 +:10059000C651D04005B911F01093230111E01CBBE6 +:1005A000016014B11C7F402F4C7F5F9100C000C0E0 +:1005B00005B914B945B97CCF809145018CBD8091B6 +:1005C00042018DBD0895282F8823A1F0883008F0BE +:1005D00042C085E893E09093440180934301243026 +:1005E00019F12530B8F0263099F1263068F127301E +:1005F000F9F0089586EA93E09093440180934301D3 +:1006000081E08093470182E58093450181E08093FA +:10061000420108952230A1F0233070F4213049F7CF +:1006200080EC80934701089588E180934701089505 +:1006300083E080934701089580E380934701089504 +:1006400080E68093470108958CE0809347010895E8 +:1006500020934701089586EA93E0909344018093A4 +:1006600043011092420181E080934701293041F01B +:100670002A3050F4283039F683E5809345010895F7 +:1006800082E58093450108952B3029F02C3009F044 +:10069000BACF8093420181E580934501089526B544 +:1006A0009091470186B5821B8917E0F3089584B1C4 +:1006B0008C6284B92A982D9896B52091470186B509 +:1006C000891B8217E0F32A9A96B586B5891B821793 +:1006D000E0F32A988091430190914401865A934017 +:1006E00019F0109246010895809145018CBD8091CA +:1006F00042018DBD10924601089584B1837D84B975 +:1007000085B1837D85B91CBC0895582F2091470180 +:1007100040E030E057FD16C02B98440F1C994F5F06 +:100720002D9A96B586B5891B8217E0F32D9896B55C +:1007300086B5891B8217E0F33F5F383029F0550FEB +:1007400057FFEACF2B9AE9CF842F08958EBD0DB4C1 +:1007500007FEFDCF8EB508950F931F930FE1E09133 +:100760004301F09144018CEA0995E0914301F09135 +:10077000440183E50995E0914301F091440180E053 +:100780000995182FE0914301F091440180E009950B +:10079000133561F11CBC26B59091470186B5821BCB +:1007A0008917E0F32A9A26B586B5821B8917E0F3EC +:1007B0002A9826B586B5821B8917E0F3E09143019C +:1007C000F091440183E0E63AF80721F0002351F06C +:1007D0000150C9CF809145018CBD809142018DBDF2 +:1007E0000023B1F781E01F910F91089580E01F91E0 +:1007F0000F9108959B01AC0181E15695479537957E +:1008000027958A95D1F7809146018217D9F02093D8 +:100810004601E0914301F09144018DE40995E09196 +:100820004301F091440180E00995E0914301F0918A +:100830004401809146010995E0914301F091440102 +:1008400080E009950895EF92FF920F931F937B012B +:100850008C01D0DF8E2D8170880F880F880FE0917A +:100860004301F091440180620995D801C70129E054 +:10087000B695A795979587952A95D1F7E09143016D +:10088000F0914401099516950795F794E794E09146 +:100890004301F09144018E2D0995E0914301F091BF +:1008A000440180E009951F910F91FF90EF9008950A +:1008B0000F931F938C01E0914301F091440180EA72 +:1008C0000995E0914301F0914401812F0995E09150 +:1008D0004301F0914401802F0995E0914301F0918B +:1008E000440180E009951F910F910895FF920F93A5 +:1008F0001F938C01F62EE0914301F091440180ECAE +:100900000995E0914301F0914401812F0995E0910F +:100910004301F0914401802F0995E0914301F0914A +:1009200044018F2D09958EE1B9D080E01F910F9180 +:10093000FF900895CF92DF92EF92FF920F931F9353 +:100940006B017C01142F56DFE0914301F0914401CB +:100950008CE40995D701C60149E0B695A79597950E +:1009600087954A95D1F7E0914301F09144010995AB +:10097000D701C601B695A79597958795E091430154 +:10098000F09144010995E0914301F091440180E028 +:1009900009951F3FF1F016B50EE1C701B60153DF0F +:1009A0008F3F79F486B5811B8D33B8F316B50150AE +:1009B000A1F781E01F910F91FF90EF90DF90CF9012 +:1009C000089580E01F910F91FF90EF90DF90CF90FE +:1009D00008958FE063D080E01F910F91FF90EF901A +:1009E000DF90CF900895CF92DF92EF92FF920F9316 +:1009F0001F936B017C01042F122FFCDE8C2D817064 +:100A0000880F880F880FE0914301F09144018064C2 +:100A10000995D701C60169E0B695A7959795879581 +:100A20006A95D1F7E0914301F09144010995D7010E +:100A3000C601B695A79597958795E0914301F091EA +:100A400044010995E0914301F0914401802F0995FB +:100A50001123C1F00F37F1F016B50EE1C701B60151 +:100A6000F2DE8F3779F486B5811B8D33B8F316B576 +:100A70000150A1F781E01F910F91FF90EF90DF905F +:100A8000CF90089580E01F910F91FF90EF90DF903D +:100A9000CF9008958FE002D080E0F5CF382F8823E3 +:100AA00049F020E096B586B5891B8C33E0F32F5FC3 +:100AB0002317C0F30895259A23982B9A50E217D054 +:100AC0005A95E9F70895AC0188E605D0842F03D044 +:100AD00089E601D0852F0FD028E030E0382780FB51 +:100AE000869506D02A95D1F730FB02D000D06894C5 +:100AF00023982B9A16F02B98239AE0914801F091B5 +:100B000049013197F0F72D9AE3B1E3FBE0914801F9 +:100B1000F09149013197F0F72D98089520ECE7DF27 +:100B200046F42A95E1F780E02AE1E5DF2A95E9F726 +:100B3000DECF28E030E0DBDF869587F938272A957D +:100B4000D1F7D5DF27F9322772F3D1DFD0CFDB0120 +:100B5000742FB9DF84E2BFDFE1DF8D937A95D1F79F +:100B60000895DB01742FAFDF83EFB5DF8DE1B3DFD5 +:100B700084E6B1DF8D91AFDF82E7ADDFCFDF807834 +:100B8000D9F77A9589F708951BB815B88BEF8AB90C +:100B90008FEF84B914B893E097B98EEF88B995BDFB +:100BA0008EDA789493DA92DAFDCFFF920F931F9347 +:100BB000CF93DF93082F792FF62E40910301413018 +:100BC00069F0443059F0463009F492C01FEF812F8C +:100BD000DF91CF911F910F91FF900895FF2009F4AD +:100BE000B2C0802F972F9C01E90110E053C0809183 +:100BF000140190911501892B09F058C060911001E2 +:100C0000709111018091120190911301488121E0AE +:100C1000EADE80910401909105010197909305010E +:100C200080930401892BD9F410920301809116015D +:100C300081FF3AC08091170190E02091140130911A +:100C400015018217930781F16091100170911101D4 +:100C5000809112019091130148816CDE11E0809126 +:100C6000100190911101A0911201B0911301019610 +:100C7000A11DB11D8093100190931101A093120149 +:100C8000B093130121969E01201B2F1508F09FCFD2 +:100C900040910301413009F4AACF80911001909155 +:100CA0001101688123DEB5CF11E0D9CF6091100129 +:100CB000709111018091120190911301488120E0FF +:100CC00092DE80911701815080931701882309F0EB +:100CD000A0CF60911001709111018091120190914B +:100CE0001301488127DE809114018093170191CF71 +:100CF0008091100190911101602F4F2D32DF809172 +:100D0000100190911101A0911201B09113018F0D6A +:100D1000911DA11DB11D8093100190931101A0930D +:100D20001201B093130180910401909105018F1974 +:100D300091099093050180930401892B21F410926D +:100D4000030111E044CF10E0812FDF91CF911F917B +:100D50000F91FF9008950F931F93CF93DF93082F68 +:100D6000792F162F40910301842F8250823050F04A +:100D7000453009F446C01FEF812FDF91CF911F91BD +:100D80000F9108954530E9F1662399F1802F9C0178 +:100D9000E90120C0809110019091110189DD8883C3 +:100DA0008091100190911101A0911201B091130155 +:100DB0000196A11DB11D8093100190931101A09384 +:100DC0001201B093130121969E01201B211778F484 +:100DD000409103014230F1F66091100170911101D0 +:100DE00080911201909113012EDD8883D9CF1830A4 +:100DF00018F610920301812FDF91CF911F910F916F +:100E000008958091100190911101602F412F9FDE74 +:100E10008091100190911101A0911201B0911301E4 +:100E2000810F911DA11DB11D80931001909311019F +:100E3000A0931201B09313019FCF0F931F93CF93F1 +:100E4000DF938C01DC0111968C91813009F44EC046 +:100E5000823009F4E7C0833009F455C0843009F4C6 +:100E6000B5C0873009F486C0853009F45AC1863090 +:100E700009F410C1883009F4DBC0893009F458C185 +:100E80008A3009F469C18B3009F49CC18C3009F4B3 +:100E9000B7C18D3009F4CBC18E3009F4CFC18F308A +:100EA00009F065C1F801938180E0228130E0822B56 +:100EB000932BAA2797FDA095BA2F809310019093AA +:100EC0001101A0931201B0931301978180E0268154 +:100ED00030E0822B932B909305018093040185E0F1 +:100EE000809303018FEFC8E0D1E038C0329B3FC050 +:100EF0008091060168DB109207014198D8DB80E001 +:100F0000C8E0D1E02BC0E0914301F0914401D80149 +:100F100012968C910995C8E0D1E080930801E09188 +:100F20004301F0914401D80113968C910995809367 +:100F30000901E0914301F0914401D80114968C918C +:100F4000099580930A01E0914301F0914401D80191 +:100F500015968C91099580930B0184E0D09327011D +:100F6000C0932601DF91CF911F910F91089585E0E5 +:100F70002ADBC1CF80910701882399F4F80193817E +:100F800080E0228130E0822B932BAA2797FDA09549 +:100F9000BA2F8093100190931101A0931201B09386 +:100FA0001301D80117969C91179780E016962C9103 +:100FB00030E0822B932B909305018093040183E012 +:100FC000809303018FEFC8E0D1E0C8CF8091070183 +:100FD000882399F4F801938180E0228130E0822B0C +:100FE000932BAA2797FDA095BA2F80931001909379 +:100FF0001101A0931201B0931301D80117969C918F +:10100000179780E016962C9130E0822B932B9093CB +:1010100005018093040182E0809303018FEFC8E013 +:10102000D1E09CCF6ADB419A80E0C8E0D1E096CF66 +:10103000809107018823B1F4D80113969C911397EE +:1010400080E012962C9130E0822B932BAA2797FDFB +:10105000A095BA2F8093100190931101A0931201D3 +:10106000B093130110921501109214011092160101 +:10107000F801978180E0268130E0822B932B9093BA +:1010800005018093040184E0809303018FEFC8E0A1 +:10109000D1E064CF80910701882399F4F80193810E +:1010A00080E0228130E0822B932BAA2797FDA09528 +:1010B000BA2F8093100190931101A0931201B09365 +:1010C0001301D80114968C91149715969C91292F91 +:1010D0002F7020931601492F50E0407F50704295A9 +:1010E0005295507F5427407F5427480F511D5093ED +:1010F00015014093140120FF02C040931701F8012D +:10110000978180E0268130E0822B932B909305011C +:101110008093040181E0809303018FEFC8E0D1E068 +:101120001DCF1ADBC8E0D1E08093080181E016CF23 +:1011300081E080930701F80182819381A481B581C8 +:101140008093100190931101A0931201B0931301A9 +:1011500080E0C8E0D1E002CFD80112968C91809354 +:101160000601C8E0D1E01092080181E0F7CE80319D +:1011700009F040C0D80113969C91139780E0129615 +:101180002C9130E0822B932BAA2797FDA095BA2FA4 +:101190008093100190931101A0931201B093130159 +:1011A000F801978180E0268130E0822B932B909389 +:1011B00005018093040186E0809303018FEFC8E06E +:1011C000D1E0CCCEF801938180E0228130E0822B07 +:1011D000932B90934901809348012A9A229A83E0A5 +:1011E0005DDC2A98419880E159DC65DC80E0C8E04C +:1011F000D1E0B4CE8F3751F180E0C8E0D1E0AECE7F +:1012000080EC69DC80E067DC8AE048DC2A9A85E0D3 +:1012100045DC2A9885E042DC84B1837D84B985B1C0 +:10122000837D85B9419A80E0C8E0D1E097CE76DC35 +:10123000C8E0D1E08093080181E090CED8011296F9 +:101240008C9149DC80E0C8E0D1E088CEC8E0D1E0F4 +:1012500081E0809308011092090110920A01109216 +:0A1260000B0184E07BCEF894FFCF71 +:02126A005AFF29 +:00000001FF diff --git a/bin/linux-nonroot/99-USBasp.rules b/bin/linux-nonroot/99-USBasp.rules new file mode 100644 index 000000000..8d04b7e95 --- /dev/null +++ b/bin/linux-nonroot/99-USBasp.rules @@ -0,0 +1,4 @@ +# USBasp - USB programmer for Atmel AVR controllers +# Copy this file to /etc/udev/rules.d so + +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", MODE="0666" diff --git a/bin/linux-nonroot/install_rule b/bin/linux-nonroot/install_rule new file mode 100755 index 000000000..04de5fe2e --- /dev/null +++ b/bin/linux-nonroot/install_rule @@ -0,0 +1,2 @@ +#!/bin/sh -x +sudo cp 99-USBasp.rules /etc/udev/rules.d/99-USBasp.rules diff --git a/bin/win-driver/Readme.txt b/bin/win-driver/Readme.txt index 37170d791..ef4af8583 100644 --- a/bin/win-driver/Readme.txt +++ b/bin/win-driver/Readme.txt @@ -1,2 +1 @@ -With WinAVR version 20080512 or greater, please use libusb_0.1.12.1. -Use libusb_0.1.10.1 with older WinAVR versions. +With WinAVR version 20100110 or older, please use libusb_0.1.12.1. diff --git a/bin/win-driver/libusb_0.1.10.1/libusb0.dll b/bin/win-driver/libusb_0.1.10.1/libusb0.dll deleted file mode 100755 index 8f0d9f719..000000000 Binary files a/bin/win-driver/libusb_0.1.10.1/libusb0.dll and /dev/null differ diff --git a/bin/win-driver/libusb_0.1.10.1/libusb0.sys b/bin/win-driver/libusb_0.1.10.1/libusb0.sys deleted file mode 100755 index 3d369667a..000000000 Binary files a/bin/win-driver/libusb_0.1.10.1/libusb0.sys and /dev/null differ diff --git a/bin/win-driver/libusb_0.1.10.1/usbasp.inf b/bin/win-driver/libusb_0.1.10.1/usbasp.inf deleted file mode 100644 index 2dfcfb4c3..000000000 --- a/bin/win-driver/libusb_0.1.10.1/usbasp.inf +++ /dev/null @@ -1,90 +0,0 @@ -[Version] -Signature = "$Chicago$" -provider = %manufacturer% -DriverVer = 03/09/2005,0.1.10.1 -CatalogFile = usbasp.cat - -Class = LibUsbDevices -ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567} - -[ClassInstall] -AddReg=ClassInstall.AddReg - -[ClassInstall32] -AddReg=ClassInstall.AddReg - -[ClassInstall.AddReg] -HKR,,,,"LibUSB-Win32 Devices" -HKR,,Icon,,"-20" - -[Manufacturer] -%manufacturer%=Devices - -;-------------------------------------------------------------------------- -; Files -;-------------------------------------------------------------------------- - -[SourceDisksNames] -1 = "Libusb-Win32 Driver Installation Disk",, - -[SourceDisksFiles] -libusb0.sys = 1,, -libusb0.dll = 1,, - -[DestinationDirs] -LIBUSB.Files.Sys = 10,System32\Drivers -LIBUSB.Files.Dll = 10,System32 - -[LIBUSB.Files.Sys] -libusb0.sys - -[LIBUSB.Files.Dll] -libusb0.dll - -;-------------------------------------------------------------------------- -; Device driver -;-------------------------------------------------------------------------- - -[LIBUSB_DEV] -CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll -AddReg = LIBUSB_DEV.AddReg - -[LIBUSB_DEV.NT] -CopyFiles = LIBUSB.Files.Sys, LIBUSB.Files.Dll - -[LIBUSB_DEV.HW] -DelReg = LIBUSB_DEV.DelReg.HW - -[LIBUSB_DEV.NT.HW] -DelReg = LIBUSB_DEV.DelReg.HW - -[LIBUSB_DEV.NT.Services] -AddService = libusb0, 0x00000002, LIBUSB.AddService - -[LIBUSB_DEV.AddReg] -HKR,,DevLoader,,*ntkern -HKR,,NTMPDriver,,libusb0.sys - -[LIBUSB_DEV.DelReg.HW] -HKR,,"LowerFilters" - -;-------------------------------------------------------------------------- -; Services -;-------------------------------------------------------------------------- - -[LIBUSB.AddService] -DisplayName = "LibUsb-Win32 - Kernel Driver 03/09/2005, 0.1.10.1" -ServiceType = 1 -StartType = 3 -ErrorControl = 0 -ServiceBinary = %12%\libusb0.sys - -;-------------------------------------------------------------------------- -; Devices -;-------------------------------------------------------------------------- - -[Devices] -"USBasp"=LIBUSB_DEV, USB\VID_16c0&PID_05dc - -[Strings] -manufacturer = "www.fischl.de" diff --git a/bin/win-driver/libusb_1.2.4.0/amd64/libusb0.dll b/bin/win-driver/libusb_1.2.4.0/amd64/libusb0.dll new file mode 100644 index 000000000..a8eb33854 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/amd64/libusb0.dll differ diff --git a/bin/win-driver/libusb_1.2.4.0/amd64/libusb0.sys b/bin/win-driver/libusb_1.2.4.0/amd64/libusb0.sys new file mode 100644 index 000000000..50bce8d55 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/amd64/libusb0.sys differ diff --git a/bin/win-driver/libusb_1.2.4.0/ia64/libusb0.dll b/bin/win-driver/libusb_1.2.4.0/ia64/libusb0.dll new file mode 100644 index 000000000..9a284238b Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/ia64/libusb0.dll differ diff --git a/bin/win-driver/libusb_1.2.4.0/ia64/libusb0.sys b/bin/win-driver/libusb_1.2.4.0/ia64/libusb0.sys new file mode 100644 index 000000000..495d90692 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/ia64/libusb0.sys differ diff --git a/bin/win-driver/libusb_1.2.4.0/installer_x64.exe b/bin/win-driver/libusb_1.2.4.0/installer_x64.exe new file mode 100755 index 000000000..a92392905 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/installer_x64.exe differ diff --git a/bin/win-driver/libusb_1.2.4.0/installer_x86.exe b/bin/win-driver/libusb_1.2.4.0/installer_x86.exe new file mode 100755 index 000000000..90f53314d Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/installer_x86.exe differ diff --git a/bin/win-driver/libusb_1.2.4.0/libusb-win32-bin-README.txt b/bin/win-driver/libusb_1.2.4.0/libusb-win32-bin-README.txt new file mode 100644 index 000000000..e5de85dce --- /dev/null +++ b/bin/win-driver/libusb_1.2.4.0/libusb-win32-bin-README.txt @@ -0,0 +1,27 @@ +libusb-win32-bin v1.2.4.0 (04/08/2011) - [Package Information] + +ALL ARCHITECTURES: + x86\libusb0_x86.dll: x86 32-bit library. Must be renamed to libusb0.dll + On 64 bit, Installs to Windows\syswow64\libusb0.dll. + On 32 bit, Installs to Windows\system32\libusb0.dll. + + x86\inf-wizard.exe: inf-wizard application with embedded libusb-win32 + v1.2.4.0 binaries. + +X86 ONLY ARCHITECTURES: + x86\libusb0.sys: x86 32-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + +AMD64-INTEL64 ONLY ARCHITECTURES: + amd64\libusb0.sys: x64 64-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + + amd64\libusb0.dll: x64 64-bit library. + Installs to Windows\system32\libusb0.dll + +IA64 ONLY ARCHITECTURES: + ia64\libusb0.sys: IA64 64-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + + ia64\libusb0.dll: IA64 64-bit library. + Installs to Windows\system32\libusb0.dll diff --git a/bin/win-driver/libusb_1.2.4.0/license/libusb-win32/installer_license.txt b/bin/win-driver/libusb_1.2.4.0/license/libusb-win32/installer_license.txt new file mode 100644 index 000000000..64b6bc4d6 --- /dev/null +++ b/bin/win-driver/libusb_1.2.4.0/license/libusb-win32/installer_license.txt @@ -0,0 +1,850 @@ +Copyright (c) 2002-2004 Stephan Meyer, +Copyright (c) 2000-2004 Johannes Erdfelt, +Copyright (c) 2000-2004 Thomas Sailer, +Copyright (c) 2010 Travis Robinson, + +This software is distributed under the following licenses: +Driver: GNU General Public License (GPL) +Library, Test Files, Installer: GNU Lesser General Public License (LGPL) + +*********************************************************************** + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/bin/win-driver/libusb_1.2.4.0/usbasp.cat b/bin/win-driver/libusb_1.2.4.0/usbasp.cat new file mode 100644 index 000000000..adfc8ccb2 --- /dev/null +++ b/bin/win-driver/libusb_1.2.4.0/usbasp.cat @@ -0,0 +1,3 @@ +This file will contain the digital signature of the files to be installed +on the system. +This file will be provided by Microsoft upon certification of your drivers. \ No newline at end of file diff --git a/bin/win-driver/libusb_1.2.4.0/usbasp.inf b/bin/win-driver/libusb_1.2.4.0/usbasp.inf new file mode 100644 index 000000000..a8d427207 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/usbasp.inf differ diff --git a/bin/win-driver/libusb_1.2.4.0/x86/libusb0.sys b/bin/win-driver/libusb_1.2.4.0/x86/libusb0.sys new file mode 100644 index 000000000..bf2e8bfe9 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/x86/libusb0.sys differ diff --git a/bin/win-driver/libusb_1.2.4.0/x86/libusb0_x86.dll b/bin/win-driver/libusb_1.2.4.0/x86/libusb0_x86.dll new file mode 100644 index 000000000..2710e9661 Binary files /dev/null and b/bin/win-driver/libusb_1.2.4.0/x86/libusb0_x86.dll differ diff --git a/circuit/USBasp.sch b/circuit/USBasp.sch index 3b6d6aa8a..f9ff4f3db 100644 Binary files a/circuit/USBasp.sch and b/circuit/USBasp.sch differ diff --git a/circuit/USBasp_schematics.pdf b/circuit/USBasp_schematics.pdf index 01f44b502..5cd53da50 100644 Binary files a/circuit/USBasp_schematics.pdf and b/circuit/USBasp_schematics.pdf differ diff --git a/firmware/Makefile b/firmware/Makefile index e05a5fadc..9047ef38e 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -39,7 +39,7 @@ help: COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=$(TARGET) # -DDEBUG_LEVEL=2 -OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o isp.o clock.o main.o +OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o isp.o clock.o tpi.o main.o .c.o: $(COMPILE) -c $< -o $@ diff --git a/firmware/isp.c b/firmware/isp.c index 6305aacab..50e6a26a1 100644 --- a/firmware/isp.c +++ b/firmware/isp.c @@ -6,7 +6,7 @@ * over ISP interface * Licence........: GNU GPL v2 (see Readme.txt) * Creation Date..: 2005-02-23 - * Last change....: 2009-02-28 + * Last change....: 2010-01-19 */ #include @@ -19,6 +19,7 @@ uchar sck_sw_delay; uchar sck_spcr; uchar sck_spsr; +uchar isp_hiaddr; void spiHWenable() { SPCR = sck_spcr; @@ -33,6 +34,7 @@ void ispSetSCKOption(uchar option) { if (option >= USBASP_ISP_SCK_93_75) { ispTransmit = ispTransmit_hw; sck_spsr = 0; + sck_sw_delay = 1; /* force RST#/SCK pulse for 320us */ switch (option) { @@ -122,6 +124,9 @@ void ispConnect() { if (ispTransmit == ispTransmit_hw) { spiHWenable(); } + + /* Initial extended address value */ + isp_hiaddr = 0; } void ispDisconnect() { @@ -190,10 +195,11 @@ uchar ispEnterProgrammingMode() { spiHWdisable(); - /* pulse SCK */ - ISP_OUT |= (1 << ISP_SCK); /* SCK high */ + /* pulse RST */ ispDelay(); - ISP_OUT &= ~(1 << ISP_SCK); /* SCK low */ + ISP_OUT |= (1 << ISP_RST); /* RST high */ + ispDelay(); + ISP_OUT &= ~(1 << ISP_RST); /* RST low */ ispDelay(); if (ispTransmit == ispTransmit_hw) { @@ -205,7 +211,28 @@ uchar ispEnterProgrammingMode() { return 1; /* error: device dosn't answer */ } +static void ispUpdateExtended(unsigned long address) +{ + uchar curr_hiaddr; + + curr_hiaddr = (address >> 17); + + /* check if extended address byte is changed */ + if(isp_hiaddr != curr_hiaddr) + { + isp_hiaddr = curr_hiaddr; + /* Load Extended Address byte */ + ispTransmit(0x4D); + ispTransmit(0x00); + ispTransmit(isp_hiaddr); + ispTransmit(0x00); + } +} + uchar ispReadFlash(unsigned long address) { + + ispUpdateExtended(address); + ispTransmit(0x20 | ((address & 1) << 3)); ispTransmit(address >> 9); ispTransmit(address >> 1); @@ -220,6 +247,8 @@ uchar ispWriteFlash(unsigned long address, uchar data, uchar pollmode) { } */ + ispUpdateExtended(address); + ispTransmit(0x40 | ((address & 1) << 3)); ispTransmit(address >> 9); ispTransmit(address >> 1); @@ -253,6 +282,9 @@ uchar ispWriteFlash(unsigned long address, uchar data, uchar pollmode) { } uchar ispFlushPage(unsigned long address, uchar pollvalue) { + + ispUpdateExtended(address); + ispTransmit(0x4C); ispTransmit(address >> 9); ispTransmit(address >> 1); diff --git a/firmware/isp.h b/firmware/isp.h index 0acbb3d65..2300a58c8 100644 --- a/firmware/isp.h +++ b/firmware/isp.h @@ -59,4 +59,7 @@ uchar (*ispTransmit)(uchar); /* set SCK speed. call before ispConnect! */ void ispSetSCKOption(uchar sckoption); +/* load extended address byte */ +void ispLoadExtendedAddressByte(unsigned long address); + #endif /* __isp_h_included__ */ diff --git a/firmware/main.c b/firmware/main.c index ca65df24f..a5d679fba 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -22,6 +22,8 @@ #include "usbdrv.h" #include "isp.h" #include "clock.h" +#include "tpi.h" +#include "tpi_defs.h" static uchar replyBuffer[8]; @@ -126,6 +128,68 @@ uchar usbFunctionSetup(uchar data[8]) { prog_sck = data[2]; replyBuffer[0] = 0; len = 1; + + } else if (data[1] == USBASP_FUNC_TPI_CONNECT) { + tpi_dly_cnt = data[2] | (data[3] << 8); + + /* RST high */ + ISP_OUT |= (1 << ISP_RST); + ISP_DDR |= (1 << ISP_RST); + + clockWait(3); + + /* RST low */ + ISP_OUT &= ~(1 << ISP_RST); + ledRedOn(); + + clockWait(16); + tpi_init(); + + } else if (data[1] == USBASP_FUNC_TPI_DISCONNECT) { + + tpi_send_byte(TPI_OP_SSTCS(TPISR)); + tpi_send_byte(0); + + clockWait(10); + + /* pulse RST */ + ISP_OUT |= (1 << ISP_RST); + clockWait(5); + ISP_OUT &= ~(1 << ISP_RST); + clockWait(5); + + /* set all ISP pins inputs */ + ISP_DDR &= ~((1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI)); + /* switch pullups off */ + ISP_OUT &= ~((1 << ISP_RST) | (1 << ISP_SCK) | (1 << ISP_MOSI)); + + ledRedOff(); + + } else if (data[1] == USBASP_FUNC_TPI_RAWREAD) { + replyBuffer[0] = tpi_recv_byte(); + len = 1; + + } else if (data[1] == USBASP_FUNC_TPI_RAWWRITE) { + tpi_send_byte(data[2]); + + } else if (data[1] == USBASP_FUNC_TPI_READBLOCK) { + prog_address = (data[3] << 8) | data[2]; + prog_nbytes = (data[7] << 8) | data[6]; + prog_state = PROG_STATE_TPI_READ; + len = 0xff; /* multiple in */ + + } else if (data[1] == USBASP_FUNC_TPI_WRITEBLOCK) { + prog_address = (data[3] << 8) | data[2]; + prog_nbytes = (data[7] << 8) | data[6]; + prog_state = PROG_STATE_TPI_WRITE; + len = 0xff; /* multiple out */ + + } else if (data[1] == USBASP_FUNC_GETCAPABILITIES) { + replyBuffer[0] = USBASP_CAP_0_TPI; + replyBuffer[1] = 0; + replyBuffer[2] = 0; + replyBuffer[3] = 0; + len = 4; } usbMsgPtr = replyBuffer; @@ -139,11 +203,19 @@ uchar usbFunctionRead(uchar *data, uchar len) { /* check if programmer is in correct read state */ if ((prog_state != PROG_STATE_READFLASH) && (prog_state - != PROG_STATE_READEEPROM)) { + != PROG_STATE_READEEPROM) && (prog_state != PROG_STATE_TPI_READ)) { return 0xff; } - /* fill packet */ + /* fill packet TPI mode */ + if(prog_state == PROG_STATE_TPI_READ) + { + tpi_read_block(prog_address, data, len); + prog_address += len; + return len; + } + + /* fill packet ISP mode */ for (i = 0; i < len; i++) { if (prog_state == PROG_STATE_READFLASH) { data[i] = ispReadFlash(prog_address); @@ -168,10 +240,23 @@ uchar usbFunctionWrite(uchar *data, uchar len) { /* check if programmer is in correct write state */ if ((prog_state != PROG_STATE_WRITEFLASH) && (prog_state - != PROG_STATE_WRITEEEPROM)) { + != PROG_STATE_WRITEEEPROM) && (prog_state != PROG_STATE_TPI_WRITE)) { return 0xff; } + if (prog_state == PROG_STATE_TPI_WRITE) + { + tpi_write_block(prog_address, data, len); + prog_address += len; + prog_nbytes -= len; + if(prog_nbytes <= 0) + { + prog_state = PROG_STATE_IDLE; + return 1; + } + return 0; + } + for (i = 0; i < len; i++) { if (prog_state == PROG_STATE_WRITEFLASH) { diff --git a/firmware/tpi.S b/firmware/tpi.S new file mode 100644 index 000000000..e597e7452 --- /dev/null +++ b/firmware/tpi.S @@ -0,0 +1,258 @@ +/** + * \brief Size-optimized code for TPI + * \file tpi.s + * \author S³awomir Fraœ + */ +#include +#include "tpi_defs.h" + + +#define TPI_CLK_PORT PORTB +#define TPI_CLK_DDR DDRB +#define TPI_CLK_BIT 5 +#define TPI_DATAOUT_PORT PORTB +#define TPI_DATAOUT_DDR DDRB +#define TPI_DATAOUT_BIT 3 +#ifdef TPI_WITH_OPTO +# define TPI_DATAIN_PIN PINB +# define TPI_DATAIN_DDR DDRB +# define TPI_DATAIN_BIT 4 +#else +# define TPI_DATAIN_PIN PINB +# define TPI_DATAIN_BIT 3 +#endif + +.comm tpi_dly_cnt, 2 + + +/** + * TPI init + */ +.global tpi_init +tpi_init: + /* CLK <= out */ + sbi _SFR_IO_ADDR(TPI_CLK_DDR), TPI_CLK_BIT +#ifdef TPI_WITH_OPTO + /* DATAIN <= pull-up */ + cbi _SFR_IO_ADDR(TPI_DATAIN_DDR), TPI_DATAIN_BIT + sbi _SFR_IO_ADDR(TPI_DATAIN_PORT), TPI_DATAIN_BIT + /* DATAOUT <= high */ + sbi _SFR_IO_ADDR(TPI_DATAOUT_DDR), TPI_DATAOUT_BIT + sbi _SFR_IO_ADDR(TPI_DATAOUT_PORT), TPI_DATAOUT_BIT +#else + /* DATA <= pull-up */ + cbi _SFR_IO_ADDR(TPI_DATAOUT_DDR), TPI_DATAOUT_BIT + sbi _SFR_IO_ADDR(TPI_DATAOUT_PORT), TPI_DATAOUT_BIT +#endif + + /* 32 bits */ + ldi r21, 32 +1: + rcall tpi_bit_h + dec r21 + brne 1b + + ret + + +/** + * Update PR + * in: r25:r24 <= PR + * lost: r18-r21,r24,r30-r31 + */ +tpi_pr_update: + movw r20, r24 + ldi r24, TPI_OP_SSTPR(0) + rcall tpi_send_byte + mov r24, r20 + rcall tpi_send_byte + ldi r24, TPI_OP_SSTPR(1) + rcall tpi_send_byte + mov r24, r21 +// rjmp tpi_send_byte + + +/** + * Send one byte + * in: r24 <= byte + * lost: r18-r19,r30-r31 + */ +.global tpi_send_byte +tpi_send_byte: + /* start bit */ + rcall tpi_bit_l + /* 8 data bits */ + ldi r18, 8 + ldi r19, 0 +1: + // parity + eor r19, r24 + // get bit, shift + bst r24, 0 + lsr r24 + // send + rcall tpi_bit + dec r18 + brne 1b + /* parity bit */ + bst r19, 0 + rcall tpi_bit + /* 2 stop bits */ + rcall tpi_bit_h +// rjmp tpi_bit_h + + +/** + * Exchange of one bit + * in: T <= bit_in + * out: T => bit_out + * lost: r30-r31 + */ +tpi_bit_h: + set +tpi_bit: + /* TPIDATA = T */ +#ifdef TPI_WITH_OPTO + // DATAOUT = high (opto should allow TPIDATA to be pulled low by external device) + // if(T == 0) + // DATAOUT = low + sbi _SFR_IO_ADDR(TPI_DATAOUT_PORT), TPI_DATAOUT_BIT + brts 1f +tpi_bit_l: + cbi _SFR_IO_ADDR(TPI_DATAOUT_PORT), TPI_DATAOUT_BIT +1: +#else + // DATAOUT = pull-up + // if(T == 0) + // DATAOUT = low + cbi _SFR_IO_ADDR(TPI_DATAOUT_DDR), TPI_DATAOUT_BIT + sbi _SFR_IO_ADDR(TPI_DATAOUT_PORT), TPI_DATAOUT_BIT + brts 1f +tpi_bit_l: + cbi _SFR_IO_ADDR(TPI_DATAOUT_PORT), TPI_DATAOUT_BIT + sbi _SFR_IO_ADDR(TPI_DATAOUT_DDR), TPI_DATAOUT_BIT +1: +#endif + /* delay(); */ + lds r30, tpi_dly_cnt + lds r31, tpi_dly_cnt+1 +1: + sbiw r30, 1 + brsh 1b + /* TPICLK = 1 */ + sbi _SFR_IO_ADDR(TPI_CLK_PORT), TPI_CLK_BIT + /* T = TPIDATA */ + in r30, _SFR_IO_ADDR(TPI_DATAIN_PIN) + bst r30, TPI_DATAIN_BIT + /* delay(); */ + lds r30, tpi_dly_cnt + lds r31, tpi_dly_cnt+1 +1: + sbiw r30, 1 + brsh 1b + + /* TPICLK = 0 */ + cbi _SFR_IO_ADDR(TPI_CLK_PORT), TPI_CLK_BIT + ret + + +/** + * Receive one byte + * out: r24 => byte + * lost: r18-r19,r30-r31 + */ +.global tpi_recv_byte +tpi_recv_byte: + /* waitfor(start_bit, 192); */ + ldi r18, 192 +1: + rcall tpi_bit_h + brtc .tpi_recv_found_start + dec r18 + brne 1b + /* no start bit: set return value */ +.tpi_break_ret0: + ldi r24, 0 + /* send 2 breaks (24++ bits) */ + ldi r18, 26 +1: + rcall tpi_bit_l + dec r18 + brne 1b + /* send hi */ + rjmp tpi_bit_h + +// ---- +.tpi_recv_found_start: + /* recv 8bits(+calc.parity) */ + ldi r18, 8 + ldi r19, 0 +1: + rcall tpi_bit_h + lsr r24 + bld r24, 7 + eor r19, r24 + dec r18 + brne 1b + /* recv parity */ + rcall tpi_bit_h + bld r18, 7 + eor r19, r18 + brmi .tpi_break_ret0 + /* recv stop bits */ + rcall tpi_bit_h + rjmp tpi_bit_h + + +/** + * Read Block + */ +.global tpi_read_block +tpi_read_block: + // X <= dptr + movw XL, r22 + // r23 <= len + mov r23, r20 + /* set PR */ + rcall tpi_pr_update + /* read data */ +.tpi_read_loop: + ldi r24, TPI_OP_SLD_INC + rcall tpi_send_byte + rcall tpi_recv_byte + st X+, r24 + dec r23 + brne .tpi_read_loop + ret + + +/** + * Write block + */ +.global tpi_write_block +tpi_write_block: + // X <= sptr + movw XL, r22 + // r23 <= len + mov r23, r20 + /* set PR */ + rcall tpi_pr_update + /* write data */ +.tpi_write_loop: + ldi r24, TPI_OP_SOUT(NVMCMD) + rcall tpi_send_byte + ldi r24, NVMCMD_WORD_WRITE + rcall tpi_send_byte + ldi r24, TPI_OP_SST_INC + rcall tpi_send_byte + ld r24, X+ + rcall tpi_send_byte +.tpi_nvmbsy_wait: + ldi r24, TPI_OP_SIN(NVMCSR) + rcall tpi_send_byte + rcall tpi_recv_byte + andi r24, NVMCSR_BSY + brne .tpi_nvmbsy_wait + dec r23 + brne .tpi_write_loop + ret diff --git a/firmware/tpi.h b/firmware/tpi.h new file mode 100644 index 000000000..4bc766617 --- /dev/null +++ b/firmware/tpi.h @@ -0,0 +1,47 @@ +/** + * \brief Header for tpi + * \file tpi.h + * \author S³awomir Fraœ + */ +#ifndef __TPI_H__ +#define __TPI_H__ +#include + + +/* Globals */ +/** Number of iterations in tpi_delay loop */ +extern uint16_t tpi_dly_cnt; + + +/* Functions */ +/** + * TPI init + */ +void tpi_init(void); +/** + * Send raw byte by TPI + * \param b Byte to send + */ +void tpi_send_byte(uint8_t b); +/** + * Receive one raw byte from TPI + * \return Received byte + */ +uint8_t tpi_recv_byte(void); +/** + * Read block + * \param addr Address of block + * \param dptr Pointer to dest memory block + * \param len Length of read + */ +void tpi_read_block(uint16_t addr, uint8_t* dptr, uint8_t len); +/** + * Write block + * \param addr Address to program + * \param sptr Pointer to source block + * \param len Length of write + */ +void tpi_write_block(uint16_t addr, const uint8_t* sptr, uint8_t len); + + +#endif /*__TPI_H__*/ diff --git a/firmware/tpi_defs.h b/firmware/tpi_defs.h new file mode 100644 index 000000000..021aa6db0 --- /dev/null +++ b/firmware/tpi_defs.h @@ -0,0 +1,59 @@ +/** + * \brief Internal defs for tpi + * \file tpi_defs.h + * \author S³awomir Fraœ + */ +#ifndef __TPI_DEFS_H__ +#define __TPI_DEFS_H__ + +/* TPI instructions */ +#define TPI_OP_SLD 0x20 +#define TPI_OP_SLD_INC 0x24 +#define TPI_OP_SST 0x60 +#define TPI_OP_SST_INC 0x64 +#define TPI_OP_SSTPR(a) (0x68 | (a)) +#define TPI_OP_SIN(a) (0x10 | (((a)<<1)&0x60) | ((a)&0x0F) ) +#define TPI_OP_SOUT(a) (0x90 | (((a)<<1)&0x60) | ((a)&0x0F) ) +#define TPI_OP_SLDCS(a) (0x80 | ((a)&0x0F) ) +#define TPI_OP_SSTCS(a) (0xC0 | ((a)&0x0F) ) +#define TPI_OP_SKEY 0xE0 + +/* TPI control/status registers */ +#define TPIIR 0xF +#define TPIPCR 0x2 +#define TPISR 0x0 + +// TPIPCR bits +#define TPIPCR_GT_2 0x04 +#define TPIPCR_GT_1 0x02 +#define TPIPCR_GT_0 0x01 +#define TPIPCR_GT_128b 0x00 +#define TPIPCR_GT_64b 0x01 +#define TPIPCR_GT_32b 0x02 +#define TPIPCR_GT_16b 0x03 +#define TPIPCR_GT_8b 0x04 +#define TPIPCR_GT_4b 0x05 +#define TPIPCR_GT_2b 0x06 +#define TPIPCR_GT_0b 0x07 + +// TPISR bits +#define TPISR_NVMEN 0x02 + +/* NVM registers */ +#define NVMCSR 0x32 +#define NVMCMD 0x33 + +// NVMCSR bits +#define NVMCSR_BSY 0x80 + +// NVMCMD values +#define NVMCMD_NOP 0x00 +#define NVMCMD_CHIP_ERASE 0x10 +#define NVMCMD_SECTION_ERASE 0x14 +#define NVMCMD_WORD_WRITE 0x1D + + + + + +#endif /*__TPI_DEFS_H__*/ diff --git a/firmware/usbasp.h b/firmware/usbasp.h index 6953e8aa4..b60bd04e2 100644 --- a/firmware/usbasp.h +++ b/firmware/usbasp.h @@ -22,6 +22,16 @@ #define USBASP_FUNC_WRITEEEPROM 8 #define USBASP_FUNC_SETLONGADDRESS 9 #define USBASP_FUNC_SETISPSCK 10 +#define USBASP_FUNC_TPI_CONNECT 11 +#define USBASP_FUNC_TPI_DISCONNECT 12 +#define USBASP_FUNC_TPI_RAWREAD 13 +#define USBASP_FUNC_TPI_RAWWRITE 14 +#define USBASP_FUNC_TPI_READBLOCK 15 +#define USBASP_FUNC_TPI_WRITEBLOCK 16 +#define USBASP_FUNC_GETCAPABILITIES 127 + +/* USBASP capabilities */ +#define USBASP_CAP_0_TPI 0x01 /* programming state */ #define PROG_STATE_IDLE 0 @@ -29,6 +39,8 @@ #define PROG_STATE_READFLASH 2 #define PROG_STATE_READEEPROM 3 #define PROG_STATE_WRITEEEPROM 4 +#define PROG_STATE_TPI_READ 5 +#define PROG_STATE_TPI_WRITE 6 /* Block mode flags */ #define PROG_BLOCKFLAG_FIRST 1 diff --git a/firmware/usbconfig.h b/firmware/usbconfig.h index e8d0ed9ee..203239eaa 100644 --- a/firmware/usbconfig.h +++ b/firmware/usbconfig.h @@ -35,7 +35,7 @@ the newest features and options. * This may be any bit in the port. Please note that D+ must also be connected * to interrupt pin INT0! */ -/* #define USB_CFG_CLOCK_KHZ (F_CPU/1000) */ +#define USB_CFG_CLOCK_KHZ 12000 /* Clock rate of the AVR in MHz. Legal values are 12000, 16000 or 16500. * The 16.5 MHz version of the code requires no crystal, it tolerates +/- 1% * deviation from the nominal frequency. All other rates require a precision @@ -124,7 +124,7 @@ the newest features and options. * you use obdev's free shared VID/PID pair. Be sure to read the rules in * USBID-License.txt! */ -#define USB_CFG_DEVICE_VERSION 0x03, 0x01 +#define USB_CFG_DEVICE_VERSION 0x04, 0x01 /* Version number of the device: Minor number first, then major number. */ #define USB_CFG_VENDOR_NAME 'w', 'w', 'w', '.', 'f', 'i', 's', 'c', 'h', 'l', '.', 'd', 'e' diff --git a/firmware/usbdrv/Changelog.txt b/firmware/usbdrv/Changelog.txt index cdb6ed300..5c6354ab1 100644 --- a/firmware/usbdrv/Changelog.txt +++ b/firmware/usbdrv/Changelog.txt @@ -261,3 +261,48 @@ Scroll down to the bottom to see the most recent changes. code distributed under GPLv3. * Release 2008-11-26 + + - Removed libusb-win32 dependency for hid-data example in Makefile.windows. + It was never required and confused many people. + - Added extern uchar usbRxToken to usbdrv.h. + - Integrated a module with CRC checks at 18 MHz by Lukas Schrittwieser. + +* Release 2009-03-23 + + - Hid-mouse example used settings from hid-data example, fixed that. + - Renamed project to V-USB due to a trademark issue with Atmel(r). + - Changed CommercialLicense.txt and USBID-License.txt to make the + background of USB ID registration clearer. + +* Release 2009-04-15 + + - Changed CommercialLicense.txt to reflect the new range of PIDs from + Jason Kotzin. + - Removed USBID-License.txt in favor of USB-IDs-for-free.txt and + USB-ID-FAQ.txt + - Fixed a bug in the 12.8 MHz module: End Of Packet decection was made in + the center between bit 0 and 1 of each byte. This is where the data lines + are expected to change and the sampled data may therefore be nonsense. + We therefore check EOP ONLY if bits 0 AND 1 have both been read as 0 on D-. + - Fixed a bitstuffing problem in the 16 MHz module: If bit 6 was stuffed, + the unstuffing code in the receiver routine was 1 cycle too long. If + multiple bytes had the unstuffing in bit 6, the error summed up until the + receiver was out of sync. + - Included option for faster CRC routine. + Thanks to Slawomir Fras (BoskiDialer) for this code! + - Updated bits in Configuration Descriptor's bmAttributes according to + USB 1.1 (in particular bit 7, it is a must-be-set bit now). + +* Release 2009-08-22 + + - Moved first DBG1() after odDebugInit() in all examples. + - Use vector INT0_vect instead of SIG_INTERRUPT0 if defined. This makes + V-USB compatible with the new "p" suffix devices (e.g. ATMega328p). + - USB_CFG_CLOCK_KHZ setting is now required in usbconfig.h (no default any + more). + - New option USB_CFG_DRIVER_FLASH_PAGE allows boot loaders on devices with + more than 64 kB flash. + - Built-in configuration descriptor allows custom definition for second + endpoint now. + +* Release 2010-07-15 diff --git a/firmware/usbdrv/CommercialLicense.txt b/firmware/usbdrv/CommercialLicense.txt index 9fd040fda..65bdb4e5f 100644 --- a/firmware/usbdrv/CommercialLicense.txt +++ b/firmware/usbdrv/CommercialLicense.txt @@ -1,5 +1,5 @@ -AVR-USB Driver Software License Agreement -Version 2008-10-07 +V-USB Driver Software License Agreement +Version 2009-08-03 THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING @@ -13,8 +13,8 @@ Grosse Schiffgasse 1A/7, 1020 Wien, AUSTRIA. 1.2 "You" shall mean the Licensee. -1.3 "AVR-USB" shall mean all files included in the package distributed under -the name "avrusb" by OBJECTIVE DEVELOPMENT (http://www.obdev.at/avrusb/) +1.3 "V-USB" shall mean all files included in the package distributed under +the name "vusb" by OBJECTIVE DEVELOPMENT (http://www.obdev.at/vusb/) unless otherwise noted. This includes the firmware-only USB device implementation for Atmel AVR microcontrollers, some simple device examples and host side software examples and libraries. @@ -23,21 +23,31 @@ and host side software examples and libraries. 2 LICENSE GRANTS 2.1 Source Code. OBJECTIVE DEVELOPMENT shall furnish you with the source -code of AVR-USB. +code of V-USB. 2.2 Distribution and Use. OBJECTIVE DEVELOPMENT grants you the -non-exclusive right to use, copy and distribute AVR-USB with your hardware +non-exclusive right to use, copy and distribute V-USB with your hardware product(s), restricted by the limitations in section 3 below. 2.3 Modifications. OBJECTIVE DEVELOPMENT grants you the right to modify -the source code and your copy of AVR-USB according to your needs. - -2.4 USB IDs. OBJECTIVE DEVELOPMENT grants you the exclusive rights to use -USB Product ID(s) sent to you in e-mail after receiving your payment in -conjunction with USB Vendor ID 5824. OBJECTIVE DEVELOPMENT has acquired an -exclusive license for this pair of USB identifiers from Wouter van Ooijen -(www.voti.nl), who has licensed the VID from the USB Implementers Forum, -Inc. (www.usb.org). +the source code and your copy of V-USB according to your needs. + +2.4 USB IDs. OBJECTIVE DEVELOPMENT furnishes you with one or two USB +Product ID(s), sent to you in e-mail. These Product IDs are reserved +exclusively for you. OBJECTIVE DEVELOPMENT has obtained USB Product ID +ranges under the Vendor ID 5824 from Wouter van Ooijen (Van Ooijen +Technische Informatica, www.voti.nl) and under the Vendor ID 8352 from +Jason Kotzin (Clay Logic, www.claylogic.com). Both owners of the Vendor IDs +have obtained these IDs from the USB Implementers Forum, Inc. +(www.usb.org). OBJECTIVE DEVELOPMENT disclaims all liability which might +arise from the assignment of USB IDs. + +2.5 USB Certification. Although not part of this agreement, we want to make +it clear that you cannot become USB certified when you use V-USB or a USB +Product ID assigned by OBJECTIVE DEVELOPMENT. AVR microcontrollers don't +meet the electrical specifications required by the USB specification and +the USB Implementers Forum certifies only members who bought a Vendor ID of +their own. 3 LICENSE RESTRICTIONS @@ -46,21 +56,21 @@ Inc. (www.usb.org). applicable. Which one is determined by the amount you pay to OBJECTIVE DEVELOPMENT, see section 4 ("Payment") below. -Hobby License: You may use AVR-USB according to section 2 above in no more +Hobby License: You may use V-USB according to section 2 above in no more than 5 hardware units. These units must not be sold for profit. -Entry Level License: You may use AVR-USB according to section 2 above in no +Entry Level License: You may use V-USB according to section 2 above in no more than 150 hardware units. -Professional License: You may use AVR-USB according to section 2 above in +Professional License: You may use V-USB according to section 2 above in any number of hardware units, except for large scale production ("unlimited fair use"). Quantities below 10,000 units are not considered large scale production. If your reach quantities which are obviously large scale production, you must pay a license fee of 0.10 EUR per unit for all units above 10,000. -3.2 Rental. You may not rent, lease, or lend AVR-USB or otherwise encumber -any copy of AVR-USB, or any of the rights granted herein. +3.2 Rental. You may not rent, lease, or lend V-USB or otherwise encumber +any copy of V-USB, or any of the rights granted herein. 3.3 Transfer. You may not transfer your rights under this Agreement to another party without OBJECTIVE DEVELOPMENT's prior written consent. If @@ -78,7 +88,7 @@ non-exclusive. by third parties. In particular, you are not allowed to use the USB logo or other trademarks owned by the USB Implementers Forum, Inc. without their consent. Since such consent depends on USB certification, it should be -noted that AVR-USB will not pass certification because it does not +noted that V-USB will not pass certification because it does not implement checksum verification and the microcontroller ports do not meet the electrical specifications. @@ -88,15 +98,15 @@ the electrical specifications. The payment amount depends on the variation of this agreement (according to section 3.1) into which you want to enter. Concrete prices are listed on OBJECTIVE DEVELOPMENT's web site, usually at -http://www.obdev.at/avrusb/license.html. You agree to pay the amount listed +http://www.obdev.at/vusb/license.html. You agree to pay the amount listed there to OBJECTIVE DEVELOPMENT or OBJECTIVE DEVELOPMENT's payment processor or reseller. 5 COPYRIGHT AND OWNERSHIP -AVR-USB is protected by copyright laws and international copyright -treaties, as well as other intellectual property laws and treaties. AVR-USB +V-USB is protected by copyright laws and international copyright +treaties, as well as other intellectual property laws and treaties. V-USB is licensed, not sold. @@ -112,12 +122,12 @@ and limitation of liability shall survive termination of this agreement. 7 DISCLAIMER OF WARRANTY AND LIABILITY -LIMITED WARRANTY. AVR-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +LIMITED WARRANTY. V-USB IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, OBJECTIVE DEVELOPMENT AND ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND -NON-INFRINGEMENT, WITH REGARD TO AVR-USB, AND THE PROVISION OF OR FAILURE +NON-INFRINGEMENT, WITH REGARD TO V-USB, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. THIS LIMITED WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS. YOU MAY HAVE OTHERS, WHICH VARY FROM STATE/JURISDICTION TO STATE/JURISDICTION. @@ -127,11 +137,11 @@ IN NO EVENT SHALL OBJECTIVE DEVELOPMENT OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY -LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE AVR-USB OR THE +LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE V-USB OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF OBJECTIVE DEVELOPMENT HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY CASE, OBJECTIVE DEVELOPMENT'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS -AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR AVR-USB. +AGREEMENT SHALL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY YOU FOR V-USB. 8 MISCELLANEOUS TERMS diff --git a/firmware/usbdrv/License.txt b/firmware/usbdrv/License.txt index e9b2752a3..4c3fb33d7 100644 --- a/firmware/usbdrv/License.txt +++ b/firmware/usbdrv/License.txt @@ -1,18 +1,18 @@ -OBJECTIVE DEVELOPMENT GmbH's AVR-USB driver software is distributed under the +OBJECTIVE DEVELOPMENT GmbH's V-USB driver software is distributed under the terms and conditions of the GNU GPL version 2 or the GNU GPL version 3. It is your choice whether you apply the terms of version 2 or version 3. The full text of GPLv2 is included below. In addition to the requirements in the GPL, we STRONGLY ENCOURAGE you to do the following: (1) Publish your entire project on a web site and drop us a note with the URL. -Use the form at http://www.obdev.at/avrusb/feedback.html for your submission. +Use the form at http://www.obdev.at/vusb/feedback.html for your submission. (2) Adhere to minimum publication standards. Please include AT LEAST: - a circuit diagram in PDF, PNG or GIF format - full source code for the host software - a Readme.txt file in ASCII format which describes the purpose of the project and what can be found in which directories and which files - - a reference to http://www.obdev.at/avrusb/ + - a reference to http://www.obdev.at/vusb/ (3) If you improve the driver firmware itself, please give us a free license to your modifications for our commercial license offerings. @@ -76,7 +76,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -131,7 +131,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -189,7 +189,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -246,7 +246,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -299,7 +299,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest diff --git a/firmware/usbdrv/Readme.txt b/firmware/usbdrv/Readme.txt index 024af5885..f35abaee5 100644 --- a/firmware/usbdrv/Readme.txt +++ b/firmware/usbdrv/Readme.txt @@ -1,6 +1,6 @@ This is the Readme file to Objective Development's firmware-only USB driver for Atmel AVR microcontrollers. For more information please visit -http://www.obdev.at/avrusb/ +http://www.obdev.at/vusb/ This directory contains the USB firmware only. Copy it as-is to your own project and add all .c and .S files to your project (these files are marked @@ -39,8 +39,8 @@ The driver consists of the following files: with IAR's tools. License.txt ............ Open Source license for this driver. CommercialLicense.txt .. Optional commercial license for this driver. - USBID-License.txt ...... Terms and conditions for using particular USB ID - values for particular purposes. + USB-ID-FAQ.txt ......... General infos about USB Product- and Vendor-IDs. + USB-IDs-for-free.txt ... List and terms of use for free shared PIDs. (*) ... These files should be linked to your project. @@ -48,11 +48,11 @@ The driver consists of the following files: CPU CORE CLOCK FREQUENCY ======================== We supply assembler modules for clock frequencies of 12 MHz, 12.8 MHz, 15 MHz, -16 MHz, 16.5 MHz and 20 MHz. Other clock rates are not supported. The actual -clock rate must be configured in usbdrv.h unless you use the default 12 MHz. +16 MHz, 16.5 MHz 18 MHz and 20 MHz. Other clock rates are not supported. The +actual clock rate must be configured in usbconfig.h. 12 MHz Clock -This is the traditional clock rate of AVR-USB because it's the lowest clock +This is the traditional clock rate of V-USB because it's the lowest clock rate where the timing constraints of the USB spec can be met. 15 MHz Clock @@ -77,9 +77,19 @@ oscillator can reach 16.5 MHz with the RC oscillator. This includes the very popular ATTiny25, ATTiny45, ATTiny85 series as well as the ATTiny26. Almost all AVRs can reach 12.8 MHz, although this is outside the specified range. -See the EasyLogger example at http://www.obdev.at/avrusb/easylogger.html for +See the EasyLogger example at http://www.obdev.at/vusb/easylogger.html for code which calibrates the RC oscillator based on the USB frame clock. +18 MHz Clock +This module is closer to the USB specification because it performs an on the +fly CRC check for incoming packets. Packets with invalid checksum are +discarded as required by the spec. If you also implement checks for data +PID toggling on application level (see option USB_CFG_CHECK_DATA_TOGGLING +in usbconfig.h for more info), this ensures data integrity. Due to the CRC +tables and alignment requirements, this code is bigger than modules for other +clock rates. To activate this module, you must define USB_CFG_CHECK_CRC to 1 +and USB_CFG_CLOCK_KHZ to 18000 in usbconfig.h. + 20 MHz Clock This module is for people who won't do it with less than the maximum. Since 20 MHz is not divisible by the USB low speed bit clock of 1.5 MHz, the code @@ -94,26 +104,41 @@ can assign PIDs at will. Since an entry level cost of 1,500 USD is too high for most small companies and hobbyists, we provide some VID/PID pairs for free. See the file -USBID-License.txt for details. +USB-IDs-for-free.txt for details. Objective Development also has some license offerings which include product -IDs. See http://www.obdev.at/avrusb/ for details. +IDs. See http://www.obdev.at/vusb/ for details. DEVELOPMENT SYSTEM ================== This driver has been developed and optimized for the GNU compiler version 3 -(gcc 3). It does work well with gcc 4, but with bigger code size. We recommend -that you use the GNU compiler suite because it is freely available. AVR-USB -has also been ported to the IAR compiler and assembler. It has been tested -with IAR 4.10B/W32 and 4.12A/W32 on an ATmega8 with the "small" and "tiny" -memory model. Not every release is tested with IAR CC and the driver may -therefore fail to compile with IAR. Please note that gcc is more efficient for -usbdrv.c because this module has been deliberately optimized for gcc. +and 4. We recommend that you use the GNU compiler suite because it is freely +available. V-USB has also been ported to the IAR compiler and assembler. It +has been tested with IAR 4.10B/W32 and 4.12A/W32 on an ATmega8 with the +"small" and "tiny" memory model. Not every release is tested with IAR CC and +the driver may therefore fail to compile with IAR. Please note that gcc is +more efficient for usbdrv.c because this module has been deliberately +optimized for gcc. + +Gcc version 3 produces smaller code than version 4 due to new optimizing +capabilities which don't always improve things on 8 bit CPUs. The code size +generated by gcc 4 can be reduced with the compiler options +-fno-move-loop-invariants, -fno-tree-scev-cprop and +-fno-inline-small-functions in addition to -Os. On devices with more than +8k of flash memory, we also recommend the linker option --relax (written as +-Wl,--relax for gcc) to convert absolute calls into relative where possible. + +For more information about optimizing options see: + + http://www.tty1.net/blog/2008-04-29-avr-gcc-optimisations_en.html + +These optimizations are good for gcc 4.x. Version 3.x of gcc does not support +most of these options and produces good code anyway. -USING AVR-USB FOR FREE -====================== +USING V-USB FOR FREE +==================== The AVR firmware driver is published under the GNU General Public License Version 2 (GPL2) and the GNU General Public License Version 3 (GPL3). It is your choice whether you apply the terms of version 2 or version 3. @@ -122,25 +147,25 @@ If you decide for the free GPL2 or GPL3, we STRONGLY ENCOURAGE you to do the following things IN ADDITION to the obligations from the GPL: (1) Publish your entire project on a web site and drop us a note with the URL. -Use the form at http://www.obdev.at/avrusb/feedback.html for your submission. +Use the form at http://www.obdev.at/vusb/feedback.html for your submission. If you don't have a web site, you can publish the project in obdev's documentation wiki at -http://www.obdev.at/goto.php?t=avrusb-wiki&p=hosted-projects. +http://www.obdev.at/goto.php?t=vusb-wiki&p=hosted-projects. (2) Adhere to minimum publication standards. Please include AT LEAST: - a circuit diagram in PDF, PNG or GIF format - full source code for the host software - a Readme.txt file in ASCII format which describes the purpose of the project and what can be found in which directories and which files - - a reference to http://www.obdev.at/avrusb/ + - a reference to http://www.obdev.at/vusb/ (3) If you improve the driver firmware itself, please give us a free license to your modifications for our commercial license offerings. -COMMERCIAL LICENSES FOR AVR-USB -=============================== +COMMERCIAL LICENSES FOR V-USB +============================= If you don't want to publish your source code under the terms of the GPL, -you can simply pay money for AVR-USB. As an additional benefit you get -USB PIDs for free, licensed exclusively to you. See the file +you can simply pay money for V-USB. As an additional benefit you get +USB PIDs for free, reserved exclusively to you. See the file "CommercialLicense.txt" for details. diff --git a/firmware/usbdrv/USB-ID-FAQ.txt b/firmware/usbdrv/USB-ID-FAQ.txt new file mode 100644 index 000000000..d1de8fb61 --- /dev/null +++ b/firmware/usbdrv/USB-ID-FAQ.txt @@ -0,0 +1,149 @@ +Version 2009-08-22 + +========================== +WHY DO WE NEED THESE IDs? +========================== + +USB is more than a low level protocol for data transport. It also defines a +common set of requests which must be understood by all devices. And as part +of these common requests, the specification defines data structures, the +USB Descriptors, which are used to describe the properties of the device. + +From the perspective of an operating system, it is therefore possible to find +out basic properties of a device (such as e.g. the manufacturer and the name +of the device) without a device-specific driver. This is essential because +the operating system can choose a driver to load based on this information +(Plug-And-Play). + +Among the most important properties in the Device Descriptor are the USB +Vendor- and Product-ID. Both are 16 bit integers. The most simple form of +driver matching is based on these IDs. The driver announces the Vendor- and +Product-IDs of the devices it can handle and the operating system loads the +appropriate driver when the device is connected. + +It is obvious that this technique only works if the pair Vendor- plus +Product-ID is unique: Only devices which require the same driver can have the +same pair of IDs. + + +===================================================== +HOW DOES THE USB STANDARD ENSURE THAT IDs ARE UNIQUE? +===================================================== + +Since it is so important that USB IDs are unique, the USB Implementers Forum, +Inc. (usb.org) needs a way to enforce this legally. It is not forbidden by +law to build a device and assign it any random numbers as IDs. Usb.org +therefore needs an agreement to regulate the use of USB IDs. The agreement +binds only parties who agreed to it, of course. Everybody else is free to use +any numbers for their IDs. + +So how can usb.org ensure that every manufacturer of USB devices enters into +an agreement with them? They do it via trademark licensing. Usb.org has +registered the trademark "USB", all associated logos and related terms. If +you want to put an USB logo on your product or claim that it is USB +compliant, you must license these trademarks from usb.org. And this is where +you enter into an agreement. See the "USB-IF Trademark License Agreement and +Usage Guidelines for the USB-IF Logo" at +http://www.usb.org/developers/logo_license/. + +Licensing the USB trademarks requires that you buy a USB Vendor-ID from +usb.org (one-time fee of ca. 2,000 USD), that you become a member of usb.org +(yearly fee of ca. 4,000 USD) and that you meet all the technical +specifications from the USB spec. + +This means that most hobbyists and small companies will never be able to +become USB compliant, just because membership is so expensive. And you can't +be compliant with a driver based on V-USB anyway, because the AVR's port pins +don't meet the electrical specifications for USB. So, in principle, all +hobbyists and small companies are free to choose any random numbers for their +IDs. They have nothing to lose... + +There is one exception worth noting, though: If you use a sub-component which +implements USB, the vendor of the sub-components may guarantee USB +compliance. This might apply to some or all of FTDI's solutions. + + +======================================================================= +WHY SHOULD YOU OBTAIN USB IDs EVEN IF YOU DON'T LICENSE USB TRADEMARKS? +======================================================================= + +You have learned in the previous section that you are free to choose any +numbers for your IDs anyway. So why not do exactly this? There is still the +technical issue. If you choose IDs which are already in use by somebody else, +operating systems will load the wrong drivers and your device won't work. +Even if you choose IDs which are not currently in use, they may be in use in +the next version of the operating system or even after an automatic update. + +So what you need is a pair of Vendor- and Product-IDs for which you have the +guarantee that no USB compliant product uses them. This implies that no +operating system will ever ship with drivers responsible for these IDs. + + +============================================== +HOW DOES OBJECTIVE DEVELOPMENT HANDLE USB IDs? +============================================== + +Objective Development gives away pairs of USB-IDs with their V-USB licenses. +In order to ensure that these IDs are unique, Objective Development has an +agreement with the company/person who has bought the USB Vendor-ID from +usb.org. This agreement ensures that a range of USB Product-IDs is reserved +for assignment by Objective Development and that the owner of the Vendor-ID +won't give it to anybody else. + +This means that you have to trust three parties to ensure uniqueness of +your IDs: + + - Objective Development, that they don't give the same PID to more than + one person. + - The owner of the Vendor-ID that they don't assign PIDs from the range + assigned to Objective Development to anybody else. + - Usb.org that they don't assign the same Vendor-ID a second time. + + +================================== +WHO IS THE OWNER OF THE VENDOR-ID? +================================== + +Objective Development has obtained ranges of USB Product-IDs under two +Vendor-IDs: Under Vendor-ID 5824 from Wouter van Ooijen (Van Ooijen +Technische Informatica, www.voti.nl) and under Vendor-ID 8352 from Jason +Kotzin (Clay Logic, www.claylogic.com). Both VID owners have received their +Vendor-ID directly from usb.org. + + +========================================================================= +CAN I USE USB-IDs FROM OBJECTIVE DEVELOPMENT WITH OTHER DRIVERS/HARDWARE? +========================================================================= + +The short answer is: Yes. All you get is a guarantee that the IDs are never +assigned to anybody else. What more do you need? + + +============================ +WHAT ABOUT SHARED ID PAIRS? +============================ + +Objective Development has reserved some PID/VID pairs for shared use. You +have no guarantee of uniqueness for them, except that no USB compliant device +uses them. In order to avoid technical problems, we must ensure that all +devices with the same pair of IDs use the same driver on kernel level. For +details, see the file USB-IDs-for-free.txt. + + +====================================================== +I HAVE HEARD THAT SUB-LICENSING OF USB-IDs IS ILLEGAL? +====================================================== + +A 16 bit integer number cannot be protected by copyright laws. It is not +sufficiently complex. And since none of the parties involved entered into the +USB-IF Trademark License Agreement, we are not bound by this agreement. So +there is no reason why it should be illegal to sub-license USB-IDs. + + +============================================= +WHO IS LIABLE IF THERE ARE INCOMPATIBILITIES? +============================================= + +Objective Development disclaims all liabilities which might arise from the +assignment of IDs. If you guarantee product features to your customers +without proper disclaimer, YOU are liable for that. diff --git a/firmware/usbdrv/USB-IDs-for-free.txt b/firmware/usbdrv/USB-IDs-for-free.txt new file mode 100644 index 000000000..2f4d59ad1 --- /dev/null +++ b/firmware/usbdrv/USB-IDs-for-free.txt @@ -0,0 +1,148 @@ +Version 2009-08-22 + +=========================== +FREE USB-IDs FOR SHARED USE +=========================== + +Objective Development has reserved a set of USB Product-IDs for use according +to the guidelines outlined below. For more information about the concept of +USB IDs please see the file USB-ID-FAQ.txt. Objective Development guarantees +that the IDs listed below are not used by any USB compliant devices. + + +==================== +MECHANISM OF SHARING +==================== + +From a technical point of view, two different devices can share the same USB +Vendor- and Product-ID if they require the same driver on operating system +level. We make use of this fact by assigning separate IDs for various device +classes. On application layer, devices must be distinguished by their textual +name or serial number. We offer separate sets of IDs for discrimination by +textual name and for serial number. + +Examples for shared use of USB IDs are included with V-USB in the "examples" +subdirectory. + + +====================================== +IDs FOR DISCRIMINATION BY TEXTUAL NAME +====================================== + +If you use one of the IDs listed below, your device and host-side software +must conform to these rules: + +(1) The USB device MUST provide a textual representation of the manufacturer +and product identification. The manufacturer identification MUST be available +at least in USB language 0x0409 (English/US). + +(2) The textual manufacturer identification MUST contain either an Internet +domain name (e.g. "mycompany.com") registered and owned by you, or an e-mail +address under your control (e.g. "myname@gmx.net"). You can embed the domain +name or e-mail address in any string you like, e.g. "Objective Development +http://www.obdev.at/vusb/". + +(3) You are responsible for retaining ownership of the domain or e-mail +address for as long as any of your products are in use. + +(4) You may choose any string for the textual product identification, as long +as this string is unique within the scope of your textual manufacturer +identification. + +(5) Application side device look-up MUST be based on the textual manufacturer +and product identification in addition to VID/PID matching. The driver +matching MUST be a comparison of the entire strings, NOT a sub-string match. + +(6) For devices which implement a particular USB device class (e.g. HID), the +operating system's default class driver MUST be used. If an operating system +driver for Vendor Class devices is needed, this driver must be libusb or +libusb-win32 (see http://libusb.org/ and +http://libusb-win32.sourceforge.net/). + +Table if IDs for discrimination by textual name: + +PID dec (hex) | VID dec (hex) | Description of use +==============+===============+============================================ +1500 (0x05dc) | 5824 (0x16c0) | For Vendor Class devices with libusb +--------------+---------------+-------------------------------------------- +1503 (0x05df) | 5824 (0x16c0) | For generic HID class devices (which are + | | NOT mice, keyboards or joysticks) +--------------+---------------+-------------------------------------------- +1505 (0x05e1) | 5824 (0x16c0) | For CDC-ACM class devices (modems) +--------------+---------------+-------------------------------------------- +1508 (0x05e4) | 5824 (0x16c0) | For MIDI class devices +--------------+---------------+-------------------------------------------- + +Note that Windows caches the textual product- and vendor-description for +mice, keyboards and joysticks. Name-bsed discrimination is therefore not +recommended for these device classes. + + +======================================= +IDs FOR DISCRIMINATION BY SERIAL NUMBER +======================================= + +If you use one of the IDs listed below, your device and host-side software +must conform to these rules: + +(1) The USB device MUST provide a textual representation of the serial +number. The serial number string MUST be available at least in USB language +0x0409 (English/US). + +(2) The serial number MUST start with either an Internet domain name (e.g. +"mycompany.com") registered and owned by you, or an e-mail address under your +control (e.g. "myname@gmx.net"), both terminated with a colon (":") character. +You MAY append any string you like for further discrimination of your devices. + +(3) You are responsible for retaining ownership of the domain or e-mail +address for as long as any of your products are in use. + +(5) Application side device look-up MUST be based on the serial number string +in addition to VID/PID matching. The matching must start at the first +character of the serial number string and include the colon character +terminating your domain or e-mail address. It MAY stop anywhere after that. + +(6) For devices which implement a particular USB device class (e.g. HID), the +operating system's default class driver MUST be used. If an operating system +driver for Vendor Class devices is needed, this driver must be libusb or +libusb-win32 (see http://libusb.org/ and +http://libusb-win32.sourceforge.net/). + +Table if IDs for discrimination by serial number string: + +PID dec (hex) | VID dec (hex) | Description of use +===============+===============+=========================================== +10200 (0x27d8) | 5824 (0x16c0) | For Vendor Class devices with libusb +---------------+---------------+------------------------------------------- +10201 (0x27d9) | 5824 (0x16c0) | For generic HID class devices (which are + | | NOT mice, keyboards or joysticks) +---------------+---------------+------------------------------------------- +10202 (0x27da) | 5824 (0x16c0) | For USB Mice +---------------+---------------+------------------------------------------- +10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards +---------------+---------------+------------------------------------------- +10204 (0x27db) | 5824 (0x16c0) | For USB Joysticks +---------------+---------------+------------------------------------------- +10205 (0x27dc) | 5824 (0x16c0) | For CDC-ACM class devices (modems) +---------------+---------------+------------------------------------------- +10206 (0x27dd) | 5824 (0x16c0) | For MIDI class devices +---------------+---------------+------------------------------------------- + + +================= +ORIGIN OF USB-IDs +================= + +OBJECTIVE DEVELOPMENT Software GmbH has obtained all VID/PID pairs listed +here from Wouter van Ooijen (see www.voti.nl) for exclusive disposition. +Wouter van Ooijen has obtained the VID from the USB Implementers Forum, Inc. +(see www.usb.org). The VID is registered for the company name "Van Ooijen +Technische Informatica". + + +========== +DISCLAIMER +========== + +OBJECTIVE DEVELOPMENT Software GmbH disclaims all liability for any +problems which are caused by the shared use of these VID/PID pairs. diff --git a/firmware/usbdrv/USBID-License.txt b/firmware/usbdrv/USBID-License.txt deleted file mode 100644 index 984c9eef1..000000000 --- a/firmware/usbdrv/USBID-License.txt +++ /dev/null @@ -1,146 +0,0 @@ -Royalty-Free Non-Exclusive License USB Product-ID -================================================= - -Version 2008-04-07 - -OBJECTIVE DEVELOPMENT Software GmbH hereby grants you the non-exclusive -right to use three USB.org vendor-ID (VID) / product-ID (PID) pairs with -products based on Objective Development's firmware-only USB driver for -Atmel AVR microcontrollers: - - * VID = 5824 (=0x16c0) / PID = 1500 (=0x5dc) for devices implementing no - USB device class (vendor-class devices with USB class = 0xff). Devices - using this pair will be referred to as "VENDOR CLASS" devices. - - * VID = 5824 (=0x16c0) / PID = 1503 (=0x5df) for HID class devices - (excluding mice and keyboards). Devices using this pair will be referred - to as "HID CLASS" devices. - - * VID = 5824 (=0x16c0) / PID = 1505 (=0x5e1) for CDC class modem devices - Devices using this pair will be referred to as "CDC-ACM CLASS" devices. - - * VID = 5824 (=0x16c0) / PID = 1508 (=0x5e4) for MIDI class devices - Devices using this pair will be referred to as "MIDI CLASS" devices. - -Since the granted right is non-exclusive, the same VID/PID pairs may be -used by many companies and individuals for different products. To avoid -conflicts, your device and host driver software MUST adhere to the rules -outlined below. - -OBJECTIVE DEVELOPMENT Software GmbH has licensed these VID/PID pairs from -Wouter van Ooijen (see www.voti.nl), who has licensed the VID from the USB -Implementers Forum, Inc. (see www.usb.org). The VID is registered for the -company name "Van Ooijen Technische Informatica". - - -RULES AND RESTRICTIONS -====================== - -(1) The USB device MUST provide a textual representation of the -manufacturer and product identification. The manufacturer identification -MUST be available at least in USB language 0x0409 (English/US). - -(2) The textual manufacturer identification MUST contain either an Internet -domain name (e.g. "mycompany.com") registered and owned by you, or an -e-mail address under your control (e.g. "myname@gmx.net"). You can embed -the domain name or e-mail address in any string you like, e.g. "Objective -Development http://www.obdev.at/avrusb/". - -(3) You are responsible for retaining ownership of the domain or e-mail -address for as long as any of your products are in use. - -(4) You may choose any string for the textual product identification, as -long as this string is unique within the scope of your textual manufacturer -identification. - -(5) Matching of device-specific drivers MUST be based on the textual -manufacturer and product identification in addition to the usual VID/PID -matching. This means that operating system features which are based on -VID/PID matching only (e.g. Windows kernel level drivers, automatic actions -when the device is plugged in etc) MUST NOT be used. The driver matching -MUST be a comparison of the entire strings, NOT a sub-string match. For -CDC-ACM CLASS and MIDI CLASS devices, a generic class driver should be used -and the matching is based on the USB device class. - -(6) The extent to which VID/PID matching is allowed for non device-specific -drivers or features depends on the operating system and particular VID/PID -pair used: - - * Mac OS X, Linux, FreeBSD and other Unixes: No VID/PID matching is - required and hence no VID/PID-only matching is allowed at all. - - * Windows: The operating system performs VID/PID matching for the kernel - level driver. You are REQUIRED to use libusb-win32 (see - http://libusb-win32.sourceforge.net/) as the kernel level driver for - VENDOR CLASS devices. HID CLASS devices all use the generic HID class - driver shipped with Windows, except mice and keyboards. You therefore - MUST NOT use any of the shared VID/PID pairs for mice or keyboards. - CDC-ACM CLASS devices require a ".inf" file which matches on the VID/PID - pair. This ".inf" file MUST load the "usbser" driver to configure the - device as modem (COM-port). - -(7) OBJECTIVE DEVELOPMENT Software GmbH disclaims all liability for any -problems which are caused by the shared use of these VID/PID pairs. You -have been warned that the sharing of VID/PID pairs may cause problems. If -you want to avoid them, get your own VID/PID pair for exclusive use. - - -HOW TO IMPLEMENT THESE RULES -============================ - -The following rules are for VENDOR CLASS and HID CLASS devices. CDC-ACM -CLASS and MIDI CLASS devices use the operating system's class driver and -don't need a custom driver. - -The host driver MUST iterate over all devices with the given VID/PID -numbers in their device descriptors and query the string representation for -the manufacturer name in USB language 0x0409 (English/US). It MUST compare -the ENTIRE string with your textual manufacturer identification chosen in -(2) above. A substring search for your domain or e-mail address is NOT -acceptable. The driver MUST NOT touch the device (other than querying the -descriptors) unless the strings match. - -For all USB devices with matching VID/PID and textual manufacturer -identification, the host driver must query the textual product -identification and string-compare it with the name of the product it can -control. It may only initialize the device if the product matches exactly. - -Objective Development provides examples for these matching rules with the -"PowerSwitch" project (using libusb) and with the "Automator" project -(using Windows calls on Windows and libusb on Unix). - - -Technical Notes: -================ - -Sharing the same VID/PID pair among devices is possible as long as ALL -drivers which match the VID/PID also perform matching on the textual -identification strings. This is easy on all operating systems except -Windows, since Windows establishes a static connection between the VID/PID -pair and a kernel level driver. All devices with the same VID/PID pair must -therefore use THE SAME kernel level driver. - -We therefore demand that you use libusb-win32 for VENDOR CLASS devices. -This is a generic kernel level driver which allows all types of USB access -for user space applications. This is only a partial solution of the -problem, though, because different device drivers may come with different -versions of libusb-win32 and they may not work with the libusb version of -the respective other driver. You are therefore encouraged to test your -driver against a broad range of libusb-win32 versions. Do not use new -features in new versions, or check for their existence before you use them. -When a new libusb-win32 becomes available, make sure that your driver is -compatible with it. - -For HID CLASS devices it is necessary that all those devices bind to the -same kernel driver: Microsoft's generic USB HID driver. This is true for -all HID devices except those with a specialized driver. Currently, the only -HIDs with specialized drivers are mice and keyboards. You therefore MUST -NOT use a shared VID/PID with mouse and keyboard devices. - -Sharing the same VID/PID among different products is unusual and probably -violates the USB specification. If you do it, you do it at your own risk. - -To avoid possible incompatibilities, we highly recommend that you get your -own VID/PID pair if you intend to sell your product. Objective -Development's commercial licenses for AVR-USB include a PID for -unrestricted exclusive use. diff --git a/firmware/usbdrv/asmcommon.inc b/firmware/usbdrv/asmcommon.inc index 1af53b8ba..07d692be3 100644 --- a/firmware/usbdrv/asmcommon.inc +++ b/firmware/usbdrv/asmcommon.inc @@ -1,5 +1,5 @@ /* Name: asmcommon.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2007-11-05 * Tabsize: 4 @@ -103,6 +103,9 @@ sofError: reti handleData: +#if USB_CFG_CHECK_CRC + CRC_CLEANUP_AND_CHECK ; jumps to ignorePacket if CRC error +#endif lds shift, usbCurrentTok;[18] tst shift ;[20] breq doReturn ;[21] diff --git a/firmware/usbdrv/usbconfig-prototype.h b/firmware/usbdrv/usbconfig-prototype.h index 6c9e37a82..847710e2a 100644 --- a/firmware/usbdrv/usbconfig-prototype.h +++ b/firmware/usbdrv/usbconfig-prototype.h @@ -1,11 +1,11 @@ /* Name: usbconfig.h - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2005-04-01 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 692 2008-11-07 15:07:40Z cs $ + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ #ifndef __usbconfig_h_included__ @@ -14,7 +14,7 @@ /* General Description: This file is an example configuration (with inline documentation) for the USB -driver. It configures AVR-USB for USB D+ connected to Port D bit 2 (which is +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may wire the lines to any other port, as long as D+ is also wired to INT0 (or any other hardware interrupt, as long as it is the highest level interrupt, see @@ -44,11 +44,19 @@ section at the end of this file). * markers every millisecond.] */ #define USB_CFG_CLOCK_KHZ (F_CPU/1000) -/* Clock rate of the AVR in MHz. Legal values are 12000, 12800, 15000, 16000, - * 16500 and 20000. The 12.8 MHz and 16.5 MHz versions of the code require no - * crystal, they tolerate +/- 1% deviation from the nominal frequency. All - * other rates require a precision of 2000 ppm and thus a crystal! - * Default if not specified: 12 MHz +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. */ /* ----------------------- Optional Hardware Config ------------------------ */ @@ -138,6 +146,11 @@ section at the end of this file). * of the macros usbDisableAllRequests() and usbEnableAllRequests() in * usbdrv.h. */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ #define USB_CFG_LONG_TRANSFERS 0 /* Define this to 1 if you want to send/receive blocks of more than 254 bytes * in a single control-in or control-out transfer. Note that the capability @@ -195,24 +208,36 @@ section at the end of this file). /* define this macro to 1 if you want the function usbMeasureFrameLength() * compiled in. This function can be used to calibrate the AVR's RC oscillator. */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ /* -------------------------- Device Description --------------------------- */ -#define USB_CFG_VENDOR_ID 0xc0, 0x16 +#define USB_CFG_VENDOR_ID 0xc0, 0x16 /* = 0x16c0 = 5824 = voti.nl */ /* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you use one of obdev's free shared - * VID/PID pairs. Be sure to read USBID-License.txt for rules! - * + This template uses obdev's shared VID/PID pair: 0x16c0/0x5dc. - * + Use this VID/PID pair ONLY if you understand the implications! - */ -#define USB_CFG_DEVICE_ID 0xdc, 0x05 + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID 0xdc, 0x05 /* = 0x05dc = 1500 */ /* This is the ID of the product, low byte first. It is interpreted in the * scope of the vendor ID. If you have registered your own VID with usb.org * or if you have licensed a PID from somebody else, define it here. Otherwise - * you use obdev's free shared VID/PID pair. Be sure to read the rules in - * USBID-License.txt! - * + This template uses obdev's shared VID/PID pair: 0x16c0/0x5dc. - * + Use this VID/PID pair ONLY if you understand the implications! + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! */ #define USB_CFG_DEVICE_VERSION 0x00, 0x01 /* Version number of the device: Minor number first, then major number. @@ -224,14 +249,14 @@ section at the end of this file). * are interpreted as Unicode (UTF-16) entities. * If you don't want a vendor name string, undefine these macros. * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USBID-License.txt for + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for * details. */ #define USB_CFG_DEVICE_NAME 'T', 'e', 'm', 'p', 'l', 'a', 't', 'e' #define USB_CFG_DEVICE_NAME_LEN 8 /* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USBID-License.txt before you assign a name if you - * use a shared VID/PID. + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. */ /*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ /*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ @@ -346,6 +371,6 @@ section at the end of this file). /* #define USB_INTR_ENABLE_BIT INT0 */ /* #define USB_INTR_PENDING GIFR */ /* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR SIG_INTERRUPT0 */ +/* #define USB_INTR_VECTOR INT0_vect */ #endif /* __usbconfig_h_included__ */ diff --git a/firmware/usbdrv/usbdrv.c b/firmware/usbdrv/usbdrv.c index 02ffed64f..21ed554f8 100644 --- a/firmware/usbdrv/usbdrv.c +++ b/firmware/usbdrv/usbdrv.c @@ -1,11 +1,11 @@ /* Name: usbdrv.c - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.c 692 2008-11-07 15:07:40Z cs $ + * This Revision: $Id: usbdrv.c 791 2010-07-15 15:56:13Z cs $ */ #include "usbportability.h" @@ -149,9 +149,9 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor 1, /* index of this configuration */ 0, /* configuration name string index */ #if USB_CFG_IS_SELF_POWERED - USBATTR_SELFPOWER, /* attributes */ + (1 << 7) | USBATTR_SELFPOWER, /* attributes */ #else - (char)USBATTR_BUSPOWER, /* attributes */ + (1 << 7), /* attributes */ #endif USB_CFG_MAX_BUS_POWER/2, /* max USB current in 2mA units */ /* interface descriptor follows inline: */ @@ -184,7 +184,7 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor #if USB_CFG_HAVE_INTRIN_ENDPOINT3 /* endpoint descriptor for endpoint 3 */ 7, /* sizeof(usbDescrEndpoint) */ USBDESCR_ENDPOINT, /* descriptor type = endpoint */ - (char)0x83, /* IN endpoint number 1 */ + (char)(0x80 | USB_CFG_EP3_NUMBER), /* IN endpoint number 3 */ 0x03, /* attrib: Interrupt endpoint */ 8, 0, /* maximum packet size */ USB_CFG_INTR_POLL_INTERVAL, /* in ms */ @@ -428,7 +428,7 @@ usbRequest_t *rq = (void *)data; * 0xe1 11100001 (USBPID_OUT: data phase of setup transfer) * 0...0x0f for OUT on endpoint X */ - DBG2(0x10 + (usbRxToken & 0xf), data, len); /* SETUP=1d, SETUP-DATA=11, OUTx=1x */ + DBG2(0x10 + (usbRxToken & 0xf), data, len + 2); /* SETUP=1d, SETUP-DATA=11, OUTx=1x */ USB_RX_USER_HOOK(data, len) #if USB_CFG_IMPLEMENT_FN_WRITEOUT if(usbRxToken < 0x10){ /* OUT to endpoint != 0: endpoint number in usbRxToken */ diff --git a/firmware/usbdrv/usbdrv.h b/firmware/usbdrv/usbdrv.h index 0ae387169..3a78f307b 100644 --- a/firmware/usbdrv/usbdrv.h +++ b/firmware/usbdrv/usbdrv.h @@ -1,11 +1,11 @@ /* Name: usbdrv.h - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.h 697 2008-11-26 17:24:43Z cs $ + * This Revision: $Id: usbdrv.h 793 2010-07-15 15:58:11Z cs $ */ #ifndef __usbdrv_h_included__ @@ -105,9 +105,9 @@ interrupt routine. Interrupt latency: The application must ensure that the USB interrupt is not disabled for more than 25 cycles (this is for 12 MHz, faster clocks allow longer latency). -This implies that all interrupt routines must either be declared as "INTERRUPT" -instead of "SIGNAL" (see "avr/signal.h") or that they are written in assembler -with "sei" as the first instruction. +This implies that all interrupt routines must either have the "ISR_NOBLOCK" +attribute set (see "avr/interrupt.h") or be written in assembler with "sei" +as the first instruction. Maximum interrupt duration / CPU cycle consumption: The driver handles all USB communication during the interrupt service @@ -122,7 +122,7 @@ USB messages, even if they address another (low-speed) device on the same bus. /* --------------------------- Module Interface ---------------------------- */ /* ------------------------------------------------------------------------- */ -#define USBDRV_VERSION 20081126 +#define USBDRV_VERSION 20100715 /* This define uniquely identifies a driver version. It is a decimal number * constructed from the driver's release date in the form YYYYMMDD. If the * driver's behavior or interface changes, you can use this constant to @@ -167,7 +167,9 @@ struct usbRequest; /* forward declaration */ USB_PUBLIC void usbInit(void); /* This function must be called before interrupts are enabled and the main - * loop is entered. + * loop is entered. We exepct that the PORT and DDR bits for D+ and D- have + * not been changed from their default status (which is 0). If you have changed + * them, set both back to 0 (configure them as input with no internal pull-up). */ USB_PUBLIC void usbPoll(void); /* This function must be called at regular intervals from the main loop. @@ -273,6 +275,8 @@ USB_PUBLIC uchar usbFunctionRead(uchar *data, uchar len); * to 1 in usbconfig.h and return 0xff in usbFunctionSetup().. */ #endif /* USB_CFG_IMPLEMENT_FN_READ */ + +extern uchar usbRxToken; /* may be used in usbFunctionWriteOut() below */ #if USB_CFG_IMPLEMENT_FN_WRITEOUT USB_PUBLIC void usbFunctionWriteOut(uchar *data, uchar len); /* This function is called by the driver when data is received on an interrupt- @@ -509,22 +513,22 @@ int usbDescriptorStringSerialNumber[]; #if !defined __ASSEMBLER__ && (!defined USB_CFG_VENDOR_ID || !defined USB_CFG_DEVICE_ID) #warning "You should define USB_CFG_VENDOR_ID and USB_CFG_DEVICE_ID in usbconfig.h" /* If the user has not defined IDs, we default to obdev's free IDs. - * See USBID-License.txt for details. + * See USB-IDs-for-free.txt for details. */ #endif /* make sure we have a VID and PID defined, byte order is lowbyte, highbyte */ #ifndef USB_CFG_VENDOR_ID -# define USB_CFG_VENDOR_ID 0xc0, 0x16 /* 5824 in dec, stands for VOTI */ +# define USB_CFG_VENDOR_ID 0xc0, 0x16 /* = 0x16c0 = 5824 = voti.nl */ #endif #ifndef USB_CFG_DEVICE_ID # if USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH -# define USB_CFG_DEVICE_ID 0xdf, 0x05 /* 1503 in dec, shared PID for HIDs */ +# define USB_CFG_DEVICE_ID 0xdf, 0x05 /* = 0x5df = 1503, shared PID for HIDs */ # elif USB_CFG_INTERFACE_CLASS == 2 -# define USB_CFG_DEVICE_ID 0xe1, 0x05 /* 1505 in dec, shared PID for CDC Modems */ +# define USB_CFG_DEVICE_ID 0xe1, 0x05 /* = 0x5e1 = 1505, shared PID for CDC Modems */ # else -# define USB_CFG_DEVICE_ID 0xdc, 0x05 /* 1500 in dec, obdev's free PID */ +# define USB_CFG_DEVICE_ID 0xdc, 0x05 /* = 0x5dc = 1500, obdev's free PID */ # endif #endif @@ -714,7 +718,7 @@ typedef struct usbRequest{ #define USBDESCR_HID_REPORT 0x22 #define USBDESCR_HID_PHYS 0x23 -#define USBATTR_BUSPOWER 0x80 +//#define USBATTR_BUSPOWER 0x80 // USB 1.1 does not define this value any more #define USBATTR_SELFPOWER 0x40 #define USBATTR_REMOTEWAKE 0x20 diff --git a/firmware/usbdrv/usbdrvasm.S b/firmware/usbdrv/usbdrvasm.S index c3fc0bbcd..2e8097da9 100644 --- a/firmware/usbdrv/usbdrvasm.S +++ b/firmware/usbdrv/usbdrvasm.S @@ -1,11 +1,11 @@ /* Name: usbdrvasm.S - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2007-06-13 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm.S 692 2008-11-07 15:07:40Z cs $ + * Revision: $Id: usbdrvasm.S 785 2010-05-30 17:57:07Z cs $ */ /* @@ -26,7 +26,8 @@ the file appropriate for the given clock rate. #define cnt r19 #define x3 r20 #define x4 r21 -#define bitcnt r22 +#define x5 r22 +#define bitcnt x5 #define phase x4 #define leap x4 @@ -56,7 +57,11 @@ the file appropriate for the given clock rate. #else /* __IAR_SYSTEMS_ASM__ */ # ifndef USB_INTR_VECTOR /* default to hardware interrupt INT0 */ -# define USB_INTR_VECTOR SIG_INTERRUPT0 +# ifdef INT0_vect +# define USB_INTR_VECTOR INT0_vect // this is the "new" define for the vector +# else +# define USB_INTR_VECTOR SIG_INTERRUPT0 // this is the "old" vector +# endif # endif .text .global USB_INTR_VECTOR @@ -138,16 +143,93 @@ RTMODEL "__rt_version", "3" #endif -; extern unsigned usbCrc16(unsigned char *data, unsigned char len); -; data: r24/25 -; len: r22 +#if USB_USE_FAST_CRC + +; This implementation is faster, but has bigger code size +; Thanks to Slawomir Fras (BoskiDialer) for this code! +; It implements the following C pseudo-code: +; unsigned table(unsigned char x) +; { +; unsigned value; +; +; value = (unsigned)x << 6; +; value ^= (unsigned)x << 7; +; if(parity(x)) +; value ^= 0xc001; +; return value; +; } +; unsigned usbCrc16(unsigned char *argPtr, unsigned char argLen) +; { +; unsigned crc = 0xffff; +; +; while(argLen--) +; crc = table(lo8(crc) ^ *argPtr++) ^ hi8(crc); +; return ~crc; +; } + +; extern unsigned usbCrc16(unsigned char *argPtr, unsigned char argLen); +; argPtr r24+25 / r16+r17 +; argLen r22 / r18 ; temp variables: -; r18: data byte -; r19: bit counter -; r20/21: polynomial -; r23: scratch -; r24/25: crc-sum -; r26/27=X: ptr +; byte r18 / r22 +; scratch r23 +; resCrc r24+r25 / r16+r17 +; ptr X / Z +usbCrc16: + mov ptrL, argPtrL + mov ptrH, argPtrH + ldi resCrcL, 0xFF + ldi resCrcH, 0xFF + rjmp usbCrc16LoopTest +usbCrc16ByteLoop: + ld byte, ptr+ + eor resCrcL, byte ; resCrcL is now 'x' in table() + mov byte, resCrcL ; compute parity of 'x' + swap byte + eor byte, resCrcL + mov scratch, byte + lsr byte + lsr byte + eor byte, scratch + inc byte + lsr byte + andi byte, 1 ; byte is now parity(x) + mov scratch, resCrcL + mov resCrcL, resCrcH + eor resCrcL, byte ; low byte of if(parity(x)) value ^= 0xc001; + neg byte + andi byte, 0xc0 + mov resCrcH, byte ; high byte of if(parity(x)) value ^= 0xc001; + clr byte + lsr scratch + ror byte + eor resCrcH, scratch + eor resCrcL, byte + lsr scratch + ror byte + eor resCrcH, scratch + eor resCrcL, byte +usbCrc16LoopTest: + subi argLen, 1 + brsh usbCrc16ByteLoop + com resCrcL + com resCrcH + ret + +#else /* USB_USE_FAST_CRC */ + +; This implementation is slower, but has less code size +; +; extern unsigned usbCrc16(unsigned char *argPtr, unsigned char argLen); +; argPtr r24+25 / r16+r17 +; argLen r22 / r18 +; temp variables: +; byte r18 / r22 +; bitCnt r19 +; poly r20+r21 +; scratch r23 +; resCrc r24+r25 / r16+r17 +; ptr X / Z usbCrc16: mov ptrL, argPtrL mov ptrH, argPtrH @@ -155,27 +237,30 @@ usbCrc16: ldi resCrcH, 0 ldi polyL, lo8(0xa001) ldi polyH, hi8(0xa001) - com argLen ; argLen = -argLen - 1 -crcByteLoop: - subi argLen, -1 - brcc crcReady ; modified loop to ensure that carry is set below + com argLen ; argLen = -argLen - 1: modified loop to ensure that carry is set + ldi bitCnt, 0 ; loop counter with starnd condition = end condition + rjmp usbCrcLoopEntry +usbCrcByteLoop: ld byte, ptr+ - ldi bitCnt, -8 ; strange loop counter to ensure that carry is set where we need it eor resCrcL, byte -crcBitLoop: - ror resCrcH ; carry is always set here +usbCrcBitLoop: + ror resCrcH ; carry is always set here (see brcs jumps to here) ror resCrcL - brcs crcNoXor + brcs usbCrcNoXor eor resCrcL, polyL eor resCrcH, polyH -crcNoXor: - subi bitCnt, -1 - brcs crcBitLoop - rjmp crcByteLoop -crcReady: +usbCrcNoXor: + subi bitCnt, 224 ; (8 * 224) % 256 = 0; this loop iterates 8 times + brcs usbCrcBitLoop +usbCrcLoopEntry: + subi argLen, -1 + brcs usbCrcByteLoop +usbCrcReady: ret ; Thanks to Reimar Doeffinger for optimizing this CRC routine! +#endif /* USB_USE_FAST_CRC */ + ; extern unsigned usbCrc16Append(unsigned char *data, unsigned char len); usbCrc16Append: rcall usbCrc16 @@ -276,21 +361,33 @@ usbMFTimeout: ;---------------------------------------------------------------------------- #ifndef USB_CFG_CLOCK_KHZ -# define USB_CFG_CLOCK_KHZ 12000 +# ifdef F_CPU +# define USB_CFG_CLOCK_KHZ (F_CPU/1000) +# else +# error "USB_CFG_CLOCK_KHZ not defined in usbconfig.h and no F_CPU set!" +# endif #endif -#if USB_CFG_CLOCK_KHZ == 12000 -# include "usbdrvasm12.inc" -#elif USB_CFG_CLOCK_KHZ == 12800 -# include "usbdrvasm128.inc" -#elif USB_CFG_CLOCK_KHZ == 15000 -# include "usbdrvasm15.inc" -#elif USB_CFG_CLOCK_KHZ == 16000 -# include "usbdrvasm16.inc" -#elif USB_CFG_CLOCK_KHZ == 16500 -# include "usbdrvasm165.inc" -#elif USB_CFG_CLOCK_KHZ == 20000 -# include "usbdrvasm20.inc" -#else -# error "USB_CFG_CLOCK_KHZ is not one of the supported rates!" -#endif +#if USB_CFG_CHECK_CRC /* separate dispatcher for CRC type modules */ +# if USB_CFG_CLOCK_KHZ == 18000 +# include "usbdrvasm18-crc.inc" +# else +# error "USB_CFG_CLOCK_KHZ is not one of the supported crc-rates!" +# endif +#else /* USB_CFG_CHECK_CRC */ +# if USB_CFG_CLOCK_KHZ == 12000 +# include "usbdrvasm12.inc" +# elif USB_CFG_CLOCK_KHZ == 12800 +# include "usbdrvasm128.inc" +# elif USB_CFG_CLOCK_KHZ == 15000 +# include "usbdrvasm15.inc" +# elif USB_CFG_CLOCK_KHZ == 16000 +# include "usbdrvasm16.inc" +# elif USB_CFG_CLOCK_KHZ == 16500 +# include "usbdrvasm165.inc" +# elif USB_CFG_CLOCK_KHZ == 20000 +# include "usbdrvasm20.inc" +# else +# error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!" +# endif +#endif /* USB_CFG_CHECK_CRC */ diff --git a/firmware/usbdrv/usbdrvasm.asm b/firmware/usbdrv/usbdrvasm.asm index a534b73bb..9cc4e4d73 100644 --- a/firmware/usbdrv/usbdrvasm.asm +++ b/firmware/usbdrv/usbdrvasm.asm @@ -1,5 +1,5 @@ /* Name: usbdrvasm.asm - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2006-03-01 * Tabsize: 4 diff --git a/firmware/usbdrv/usbdrvasm12.inc b/firmware/usbdrv/usbdrvasm12.inc index 528ca4136..d720f7efd 100644 --- a/firmware/usbdrv/usbdrvasm12.inc +++ b/firmware/usbdrv/usbdrvasm12.inc @@ -1,11 +1,11 @@ /* Name: usbdrvasm12.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2004-12-29 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm12.inc 692 2008-11-07 15:07:40Z cs $ + * This Revision: $Id: usbdrvasm12.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm128.inc b/firmware/usbdrv/usbdrvasm128.inc index db8cc8277..bcd6621cc 100644 --- a/firmware/usbdrv/usbdrvasm128.inc +++ b/firmware/usbdrv/usbdrvasm128.inc @@ -1,11 +1,11 @@ /* Name: usbdrvasm128.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2008-10-11 * Tabsize: 4 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm128.inc 692 2008-11-07 15:07:40Z cs $ + * This Revision: $Id: usbdrvasm128.inc 758 2009-08-06 10:12:54Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the @@ -31,8 +31,9 @@ limitations: They typical range is 14.5 MHz and most AVRs can actually reach this rate. (2) Writing EEPROM and Flash may be unreliable (short data lifetime) since the write procedure is timed from the RC oscillator. -(3) End Of Packet detection is between bit 0 and bit 1 where the EOP condition -may not be reliable when a hub is used. It should be in bit 1. +(3) End Of Packet detection (SE0) should be in bit 1, bit it is only checked +if bits 0 and 1 both read as 0 on D- and D+ read as 0 in the middle. This may +cause problems with old hubs which delay SE0 by up to one cycle. (4) Code size is much larger than that of the other modules. Since almost all of this code is timing critical, don't change unless you @@ -217,8 +218,10 @@ unstuff0s: ifioclr USBIN, USBMINUS ;[00] ifioset USBIN, USBPLUS ;[01] rjmp bit0IsClr ;[02] executed if first expr false or second true -jumpToSe0AndStore: - rjmp se0AndStore ;[03] executed only if both bits 0 +se0AndStore: ; executed only if both bits 0 + st y+, x1 ;[15/17] cycles after start of byte + rjmp se0 ;[17/19] + bit0IsClr: ifrset phase, USBMINUS ;[04] check phase only if D- changed lpm ;[05] @@ -228,7 +231,7 @@ bit1AfterClr: andi phase, USBMASK ;[08] ifioset USBIN, USBMINUS ;[09] <--- sample 1 rjmp bit1IsSet ;[10] - breq jumpToSe0AndStore ;[11] + breq se0AndStore ;[11] if D- was 0 in bits 0 AND 1 and D+ was 0 in between, we have SE0 andi shift, ~(7 << 1) ;[12] in phase, USBIN ;[13] <- phase breq unstuff1c ;[14] @@ -355,10 +358,6 @@ unstuff7c: nop ;[59] rjmp bit7IsSet ;[60] -se0AndStore: - st y+, x1 ;[15/17] cycles after start of byte - rjmp se0 ;[17/19] - bit7IsClr: ifrset phase, USBMINUS ;[62] check phase only if D- changed lpm ;[63] @@ -391,25 +390,24 @@ bit0IsSet: in phase, USBIN ;[06] <- phase (one cycle too late) ori shift, 1 << 0 ;[07] bit1AfterSet: - andi phase, USBMASK ;[08] + andi shift, ~(7 << 1) ;[08] compensated by "ori shift, 1<<1" if bit1IsClr ifioclr USBIN, USBMINUS ;[09] <--- sample 1 rjmp bit1IsClr ;[10] - andi shift, ~(7 << 1) ;[11] - breq unstuff1s ;[12] - in phase, USBIN ;[13] <- phase - nop ;[14] + breq unstuff1s ;[11] + nop2 ;[12] do not check for SE0 if bit 0 was 1 + in phase, USBIN ;[14] <- phase (one cycle too late) rjmp bit2AfterSet ;[15] unstuff1s: - in phase, USBIN ;[14] <- phase (one cycle too late) - andi fix, ~(1 << 1) ;[15] - nop2 ;[08] + in phase, USBIN ;[13] <- phase + andi fix, ~(1 << 1) ;[14] + lpm ;[07] nop2 ;[10] bit1IsClr: ifrset phase, USBMINUS ;[12] check phase only if D- changed lpm ;[13] in phase, USBIN ;[14] <- phase (one cycle too late) - breq se0AndStore ;[15] if we come from unstuff1s, Z bit is never set - ori shift, 1 << 1 ;[16] + ori shift, 1 << 1 ;[15] + nop ;[16] bit2AfterClr: ifioset USBIN, USBMINUS ;[17] <--- sample 2 rjmp bit2IsSet ;[18] diff --git a/firmware/usbdrv/usbdrvasm15.inc b/firmware/usbdrv/usbdrvasm15.inc index 29edee5d4..c13bd91b5 100644 --- a/firmware/usbdrv/usbdrvasm15.inc +++ b/firmware/usbdrv/usbdrvasm15.inc @@ -1,11 +1,11 @@ /* Name: usbdrvasm15.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: contributed by V. Bosch * Creation Date: 2007-08-06 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm15.inc 692 2008-11-07 15:07:40Z cs $ + * Revision: $Id: usbdrvasm15.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm16.inc b/firmware/usbdrv/usbdrvasm16.inc index 1a1add5ab..a30e194e9 100644 --- a/firmware/usbdrv/usbdrvasm16.inc +++ b/firmware/usbdrv/usbdrvasm16.inc @@ -1,11 +1,11 @@ /* Name: usbdrvasm16.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2007-06-15 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm16.inc 692 2008-11-07 15:07:40Z cs $ + * Revision: $Id: usbdrvasm16.inc 760 2009-08-09 18:59:43Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the @@ -117,12 +117,15 @@ haveTwoBitsK: ; Receiver loop (numbers in brackets are cycles within byte after instr) ;---------------------------------------------------------------------------- +; duration of unstuffing code should be 10.66666667 cycles. We adjust "leap" +; accordingly to approximate this value in the long run. + unstuff6: andi x2, USBMASK ;[03] ori x3, 1<<6 ;[04] will not be shifted any more andi shift, ~0x80;[05] mov x1, x2 ;[06] sampled bit 7 is actually re-sampled bit 6 - subi leap, 3 ;[07] since this is a short (10 cycle) bit, enforce leap bit + subi leap, -1 ;[07] total duration = 11 bits -> subtract 1/3 rjmp didUnstuff6 ;[08] unstuff7: @@ -130,7 +133,7 @@ unstuff7: in x2, USBIN ;[00] [10] re-sample bit 7 andi x2, USBMASK ;[01] andi shift, ~0x80;[02] - subi leap, 3 ;[03] since this is a short (10 cycle) bit, enforce leap bit + subi leap, 2 ;[03] total duration = 10 bits -> add 1/3 rjmp didUnstuff7 ;[04] unstuffEven: @@ -139,8 +142,8 @@ unstuffEven: andi shift, ~0x80;[01] andi x1, USBMASK ;[02] breq se0 ;[03] - subi leap, 3 ;[04] since this is a short (10 cycle) bit, enforce leap bit - nop ;[05] + subi leap, -1 ;[04] total duration = 11 bits -> subtract 1/3 + nop2 ;[05] rjmp didUnstuffE ;[06] unstuffOdd: @@ -149,8 +152,8 @@ unstuffOdd: andi shift, ~0x80;[01] andi x2, USBMASK ;[02] breq se0 ;[03] - subi leap, 3 ;[04] since this is a short (10 cycle) bit, enforce leap bit - nop ;[05] + subi leap, -1 ;[04] total duration = 11 bits -> subtract 1/3 + nop2 ;[05] rjmp didUnstuffO ;[06] rxByteLoop: diff --git a/firmware/usbdrv/usbdrvasm165.inc b/firmware/usbdrv/usbdrvasm165.inc index 0b252e6ce..d29139a5a 100644 --- a/firmware/usbdrv/usbdrvasm165.inc +++ b/firmware/usbdrv/usbdrvasm165.inc @@ -1,11 +1,11 @@ /* Name: usbdrvasm165.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2007-04-22 * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm165.inc 692 2008-11-07 15:07:40Z cs $ + * Revision: $Id: usbdrvasm165.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm18-crc.inc b/firmware/usbdrv/usbdrvasm18-crc.inc new file mode 100644 index 000000000..ad0269e71 --- /dev/null +++ b/firmware/usbdrv/usbdrvasm18-crc.inc @@ -0,0 +1,706 @@ +/* Name: usbdrvasm18.inc + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Lukas Schrittwieser (based on 20 MHz usbdrvasm20.inc by Jeroen Benschop) + * Creation Date: 2009-01-20 + * Tabsize: 4 + * Copyright: (c) 2008 by Lukas Schrittwieser and OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * Revision: $Id: usbdrvasm18-crc.inc 740 2009-04-13 18:23:31Z cs $ + */ + +/* Do not link this file! Link usbdrvasm.S instead, which includes the + * appropriate implementation! + */ + +/* +General Description: +This file is the 18 MHz version of the asssembler part of the USB driver. It +requires a 18 MHz crystal (not a ceramic resonator and not a calibrated RC +oscillator). + +See usbdrv.h for a description of the entire driver. + +Since almost all of this code is timing critical, don't change unless you +really know what you are doing! Many parts require not only a maximum number +of CPU cycles, but even an exact number of cycles! +*/ + + +;max stack usage: [ret(2), YL, SREG, YH, [sofError], bitcnt(x5), shift, x1, x2, x3, x4, cnt, ZL, ZH] = 14 bytes +;nominal frequency: 18 MHz -> 12 cycles per bit +; Numbers in brackets are clocks counted from center of last sync bit +; when instruction starts +;register use in receive loop to receive the data bytes: +; shift assembles the byte currently being received +; x1 holds the D+ and D- line state +; x2 holds the previous line state +; cnt holds the number of bytes left in the receive buffer +; x3 holds the higher crc byte (see algorithm below) +; x4 is used as temporary register for the crc algorithm +; x5 is used for unstuffing: when unstuffing the last received bit is inverted in shift (to prevent further +; unstuffing calls. In the same time the corresponding bit in x5 is cleared to mark the bit as beening iverted +; zl lower crc value and crc table index +; zh used for crc table accesses + +;-------------------------------------------------------------------------------------------------------------- +; CRC mods: +; table driven crc checker, Z points to table in prog space +; ZL is the lower crc byte, x3 is the higher crc byte +; x4 is used as temp register to store different results +; the initialization of the crc register is not 0xFFFF but 0xFE54. This is because during the receipt of the +; first data byte an virtual zero data byte is added to the crc register, this results in the correct initial +; value of 0xFFFF at beginning of the second data byte before the first data byte is added to the crc. +; The magic number 0xFE54 results form the crc table: At tabH[0x54] = 0xFF = crcH (required) and +; tabL[0x54] = 0x01 -> crcL = 0x01 xor 0xFE = 0xFF +; bitcnt is renamed to x5 and is used for unstuffing purposes, the unstuffing works like in the 12MHz version +;-------------------------------------------------------------------------------------------------------------- +; CRC algorithm: +; The crc register is formed by x3 (higher byte) and ZL (lower byte). The algorithm uses a 'reversed' form +; i.e. that it takes the least significant bit first and shifts to the right. So in fact the highest order +; bit seen from the polynomial devision point of view is the lsb of ZL. (If this sounds strange to you i +; propose a research on CRC :-) ) +; Each data byte received is xored to ZL, the lower crc byte. This byte now builds the crc +; table index. Next the new high byte is loaded from the table and stored in x4 until we have space in x3 +; (its destination). +; Afterwards the lower table is loaded from the table and stored in ZL (the old index is overwritten as +; we don't need it anymore. In fact this is a right shift by 8 bits.) Now the old crc high value is xored +; to ZL, this is the second shift of the old crc value. Now x4 (the temp reg) is moved to x3 and the crc +; calculation is done. +; Prior to the first byte the two CRC register have to be initialized to 0xFFFF (as defined in usb spec) +; however the crc engine also runs during the receipt of the first byte, therefore x3 and zl are initialized +; to a magic number which results in a crc value of 0xFFFF after the first complete byte. +; +; This algorithm is split into the extra cycles of the different bits: +; bit7: XOR the received byte to ZL +; bit5: load the new high byte to x4 +; bit6: load the lower xor byte from the table, xor zl and x3, store result in zl (=the new crc low value) +; move x4 (the new high byte) to x3, the crc value is ready +; + + +macro POP_STANDARD ; 18 cycles + pop ZH + pop ZL + pop cnt + pop x5 + pop x3 + pop x2 + pop x1 + pop shift + pop x4 + endm +macro POP_RETI ; 7 cycles + pop YH + pop YL + out SREG, YL + pop YL + endm + +macro CRC_CLEANUP_AND_CHECK + ; the last byte has already been xored with the lower crc byte, we have to do the table lookup and xor + ; x3 is the higher crc byte, zl the lower one + ldi ZH, hi8(usbCrcTableHigh);[+1] get the new high byte from the table + lpm x2, Z ;[+2][+3][+4] + ldi ZH, hi8(usbCrcTableLow);[+5] get the new low xor byte from the table + lpm ZL, Z ;[+6][+7][+8] + eor ZL, x3 ;[+7] xor the old high byte with the value from the table, x2:ZL now holds the crc value + cpi ZL, 0x01 ;[+8] if the crc is ok we have a fixed remainder value of 0xb001 in x2:ZL (see usb spec) + brne ignorePacket ;[+9] detected a crc fault -> paket is ignored and retransmitted by the host + cpi x2, 0xb0 ;[+10] + brne ignorePacket ;[+11] detected a crc fault -> paket is ignored and retransmitted by the host + endm + + +USB_INTR_VECTOR: +;order of registers pushed: YL, SREG, YH, [sofError], x4, shift, x1, x2, x3, x5, cnt, ZL, ZH + push YL ;[-28] push only what is necessary to sync with edge ASAP + in YL, SREG ;[-26] + push YL ;[-25] + push YH ;[-23] +;---------------------------------------------------------------------------- +; Synchronize with sync pattern: +;---------------------------------------------------------------------------- +;sync byte (D-) pattern LSb to MSb: 01010100 [1 = idle = J, 0 = K] +;sync up with J to K edge during sync pattern -- use fastest possible loops +;The first part waits at most 1 bit long since we must be in sync pattern. +;YL is guarenteed to be < 0x80 because I flag is clear. When we jump to +;waitForJ, ensure that this prerequisite is met. +waitForJ: + inc YL + sbis USBIN, USBMINUS + brne waitForJ ; just make sure we have ANY timeout +waitForK: +;The following code results in a sampling window of < 1/4 bit which meets the spec. + sbis USBIN, USBMINUS ;[-17] + rjmp foundK ;[-16] + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK + sbis USBIN, USBMINUS + rjmp foundK +#if USB_COUNT_SOF + lds YL, usbSofCount + inc YL + sts usbSofCount, YL +#endif /* USB_COUNT_SOF */ +#ifdef USB_SOF_HOOK + USB_SOF_HOOK +#endif + rjmp sofError +foundK: ;[-15] +;{3, 5} after falling D- edge, average delay: 4 cycles +;bit0 should be at 30 (2.5 bits) for center sampling. Currently at 4 so 26 cylces till bit 0 sample +;use 1 bit time for setup purposes, then sample again. Numbers in brackets +;are cycles from center of first sync (double K) bit after the instruction + push x4 ;[-14] +; [---] ;[-13] + lds YL, usbInputBufOffset;[-12] used to toggle the two usb receive buffers +; [---] ;[-11] + clr YH ;[-10] + subi YL, lo8(-(usbRxBuf));[-9] [rx loop init] + sbci YH, hi8(-(usbRxBuf));[-8] [rx loop init] + push shift ;[-7] +; [---] ;[-6] + ldi shift, 0x80 ;[-5] the last bit is the end of byte marker for the pid receiver loop + clc ;[-4] the carry has to be clear for receipt of pid bit 0 + sbis USBIN, USBMINUS ;[-3] we want two bits K (sample 3 cycles too early) + rjmp haveTwoBitsK ;[-2] + pop shift ;[-1] undo the push from before + pop x4 ;[1] + rjmp waitForK ;[3] this was not the end of sync, retry +; The entire loop from waitForK until rjmp waitForK above must not exceed two +; bit times (= 24 cycles). + +;---------------------------------------------------------------------------- +; push more registers and initialize values while we sample the first bits: +;---------------------------------------------------------------------------- +haveTwoBitsK: + push x1 ;[0] + push x2 ;[2] + push x3 ;[4] crc high byte + ldi x2, 1< jump back and store the byte + ori shift, 0x01 ;[11] invert the last received bit to prevent furhter unstuffing + in x2, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + andi x5, 0xFE ;[1] mark this bit as inverted (will be corrected before storing shift) + eor x1, x2 ;[2] x1 and x2 have to be different because the stuff bit is always a zero + andi x1, USBMASK ;[3] mask the interesting bits + breq stuffErr ;[4] if the stuff bit is a 1-bit something went wrong + mov x1, x2 ;[5] the next bit expects the last state to be in x1 + rjmp didunstuff0 ;[6] + ;[7] jump delay of rjmp didunstuffX + +unstuff1: ;[11] this is the jump delay of breq unstuffX + in x1, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + ori shift, 0x02 ;[1] invert the last received bit to prevent furhter unstuffing + andi x5, 0xFD ;[2] mark this bit as inverted (will be corrected before storing shift) + eor x2, x1 ;[3] x1 and x2 have to be different because the stuff bit is always a zero + andi x2, USBMASK ;[4] mask the interesting bits + breq stuffErr ;[5] if the stuff bit is a 1-bit something went wrong + mov x2, x1 ;[6] the next bit expects the last state to be in x2 + nop2 ;[7] + ;[8] + rjmp didunstuff1 ;[9] + ;[10] jump delay of rjmp didunstuffX + +unstuff2: ;[9] this is the jump delay of breq unstuffX + ori shift, 0x04 ;[10] invert the last received bit to prevent furhter unstuffing + andi x5, 0xFB ;[11] mark this bit as inverted (will be corrected before storing shift) + in x2, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + eor x1, x2 ;[1] x1 and x2 have to be different because the stuff bit is always a zero + andi x1, USBMASK ;[2] mask the interesting bits + breq stuffErr ;[3] if the stuff bit is a 1-bit something went wrong + mov x1, x2 ;[4] the next bit expects the last state to be in x1 + nop2 ;[5] + ;[6] + rjmp didunstuff2 ;[7] + ;[8] jump delay of rjmp didunstuffX + +unstuff3: ;[9] this is the jump delay of breq unstuffX + ori shift, 0x08 ;[10] invert the last received bit to prevent furhter unstuffing + andi x5, 0xF7 ;[11] mark this bit as inverted (will be corrected before storing shift) + in x1, USBIN ;[0] we have some free cycles so we could check for bit stuffing errors + eor x2, x1 ;[1] x1 and x2 have to be different because the stuff bit is always a zero + andi x2, USBMASK ;[2] mask the interesting bits + breq stuffErr ;[3] if the stuff bit is a 1-bit something went wrong + mov x2, x1 ;[4] the next bit expects the last state to be in x2 + nop2 ;[5] + ;[6] + rjmp didunstuff3 ;[7] + ;[8] jump delay of rjmp didunstuffX + + + +; the include has to be here due to branch distance restirctions +#define __USE_CRC__ +#include "asmcommon.inc" + + + +; USB spec says: +; idle = J +; J = (D+ = 0), (D- = 1) +; K = (D+ = 1), (D- = 0) +; Spec allows 7.5 bit times from EOP to SOP for replies +; 7.5 bit times is 90 cycles. ...there is plenty of time + + +sendNakAndReti: + ldi x3, USBPID_NAK ;[-18] + rjmp sendX3AndReti ;[-17] +sendAckAndReti: + ldi cnt, USBPID_ACK ;[-17] +sendCntAndReti: + mov x3, cnt ;[-16] +sendX3AndReti: + ldi YL, 20 ;[-15] x3==r20 address is 20 + ldi YH, 0 ;[-14] + ldi cnt, 2 ;[-13] +; rjmp usbSendAndReti fallthrough + +;usbSend: +;pointer to data in 'Y' +;number of bytes in 'cnt' -- including sync byte [range 2 ... 12] +;uses: x1...x4, btcnt, shift, cnt, Y +;Numbers in brackets are time since first bit of sync pattern is sent + +usbSendAndReti: ; 12 cycles until SOP + in x2, USBDDR ;[-12] + ori x2, USBMASK ;[-11] + sbi USBOUT, USBMINUS;[-10] prepare idle state; D+ and D- must have been 0 (no pullups) + in x1, USBOUT ;[-8] port mirror for tx loop + out USBDDR, x2 ;[-6] <- acquire bus + ldi x2, 0 ;[-6] init x2 (bitstuff history) because sync starts with 0 + ldi x4, USBMASK ;[-5] exor mask + ldi shift, 0x80 ;[-4] sync byte is first byte sent +txByteLoop: + ldi bitcnt, 0x40 ;[-3]=[9] binary 01000000 +txBitLoop: ; the loop sends the first 7 bits of the byte + sbrs shift, 0 ;[-2]=[10] if we have to send a 1 don't change the line state + eor x1, x4 ;[-1]=[11] + out USBOUT, x1 ;[0] + ror shift ;[1] + ror x2 ;[2] transfers the last sent bit to the stuffing history +didStuffN: + nop ;[3] + nop ;[4] + cpi x2, 0xfc ;[5] if we sent six consecutive ones + brcc bitstuffN ;[6] + lsr bitcnt ;[7] + brne txBitLoop ;[8] restart the loop while the 1 is still in the bitcount + +; transmit bit 7 + sbrs shift, 0 ;[9] + eor x1, x4 ;[10] +didStuff7: + ror shift ;[11] + out USBOUT, x1 ;[0] transfer bit 7 to the pins + ror x2 ;[1] move the bit into the stuffing history + cpi x2, 0xfc ;[2] + brcc bitstuff7 ;[3] + ld shift, y+ ;[4] get next byte to transmit + dec cnt ;[5] decrement byte counter + brne txByteLoop ;[7] if we have more bytes start next one + ;[8] branch delay + +;make SE0: + cbr x1, USBMASK ;[8] prepare SE0 [spec says EOP may be 25 to 30 cycles] + lds x2, usbNewDeviceAddr;[9] + lsl x2 ;[11] we compare with left shifted address + out USBOUT, x1 ;[0] <-- out SE0 -- from now 2 bits = 24 cycles until bus idle + subi YL, 20 + 2 ;[1] Only assign address on data packets, not ACK/NAK in x3 + sbci YH, 0 ;[2] +;2006-03-06: moved transfer of new address to usbDeviceAddr from C-Code to asm: +;set address only after data packet was sent, not after handshake + breq skipAddrAssign ;[3] + sts usbDeviceAddr, x2 ; if not skipped: SE0 is one cycle longer +skipAddrAssign: +;end of usbDeviceAddress transfer + ldi x2, 1< +int main (int argc, char **argv) +{ + int i, j; + for (i=0; i<512; i++){ + unsigned short crc = i & 0xff; + for(j=0; j<8; j++) crc = (crc >> 1) ^ ((crc & 1) ? 0xa001 : 0); + if((i & 7) == 0) printf("\n.byte "); + printf("0x%02x, ", (i > 0xff ? (crc >> 8) : crc) & 0xff); + if(i == 255) printf("\n"); + } + return 0; +} + +// Use the following algorithm to compute CRC values: +ushort computeCrc(uchar *msg, uchar msgLen) +{ + uchar i; + ushort crc = 0xffff; + for(i = 0; i < msgLen; i++) + crc = usbCrcTable16[lo8(crc) ^ msg[i]] ^ hi8(crc); + return crc; +} +*/ + +.balign 256 +usbCrcTableLow: +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41 +.byte 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40 + +; .balign 256 +usbCrcTableHigh: +.byte 0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2 +.byte 0xC6, 0x06, 0x07, 0xC7, 0x05, 0xC5, 0xC4, 0x04 +.byte 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E +.byte 0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, 0x08, 0xC8 +.byte 0xD8, 0x18, 0x19, 0xD9, 0x1B, 0xDB, 0xDA, 0x1A +.byte 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC +.byte 0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6 +.byte 0xD2, 0x12, 0x13, 0xD3, 0x11, 0xD1, 0xD0, 0x10 +.byte 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32 +.byte 0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4 +.byte 0x3C, 0xFC, 0xFD, 0x3D, 0xFF, 0x3F, 0x3E, 0xFE +.byte 0xFA, 0x3A, 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38 +.byte 0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA +.byte 0xEE, 0x2E, 0x2F, 0xEF, 0x2D, 0xED, 0xEC, 0x2C +.byte 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26 +.byte 0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0 +.byte 0xA0, 0x60, 0x61, 0xA1, 0x63, 0xA3, 0xA2, 0x62 +.byte 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4 +.byte 0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F, 0x6E, 0xAE +.byte 0xAA, 0x6A, 0x6B, 0xAB, 0x69, 0xA9, 0xA8, 0x68 +.byte 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA +.byte 0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C +.byte 0xB4, 0x74, 0x75, 0xB5, 0x77, 0xB7, 0xB6, 0x76 +.byte 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0 +.byte 0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92 +.byte 0x96, 0x56, 0x57, 0x97, 0x55, 0x95, 0x94, 0x54 +.byte 0x9C, 0x5C, 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E +.byte 0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98 +.byte 0x88, 0x48, 0x49, 0x89, 0x4B, 0x8B, 0x8A, 0x4A +.byte 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C +.byte 0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86 +.byte 0x82, 0x42, 0x43, 0x83, 0x41, 0x81, 0x80, 0x40 diff --git a/firmware/usbdrv/usbdrvasm20.inc b/firmware/usbdrv/usbdrvasm20.inc index fcdd429fc..9dd25039e 100644 --- a/firmware/usbdrv/usbdrvasm20.inc +++ b/firmware/usbdrv/usbdrvasm20.inc @@ -1,12 +1,12 @@ /* Name: usbdrvasm20.inc - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Jeroen Benschop * Based on usbdrvasm16.inc from Christian Starkjohann * Creation Date: 2008-03-05 * Tabsize: 4 * Copyright: (c) 2008 by Jeroen Benschop and OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm20.inc 692 2008-11-07 15:07:40Z cs $ + * Revision: $Id: usbdrvasm20.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbportability.h b/firmware/usbdrv/usbportability.h index 2dd24245f..476184dc6 100644 --- a/firmware/usbdrv/usbportability.h +++ b/firmware/usbdrv/usbportability.h @@ -1,11 +1,11 @@ /* Name: usbportability.h - * Project: AVR USB driver + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers * Author: Christian Starkjohann * Creation Date: 2008-06-17 * Tabsize: 4 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbportability.h 692 2008-11-07 15:07:40Z cs $ + * This Revision: $Id: usbportability.h 785 2010-05-30 17:57:07Z cs $ */ /* @@ -125,7 +125,11 @@ static inline void sei(void) # include #endif -#define USB_READ_FLASH(addr) pgm_read_byte(addr) +#if USB_CFG_DRIVER_FLASH_PAGE +# define USB_READ_FLASH(addr) pgm_read_byte_far(((long)USB_CFG_DRIVER_FLASH_PAGE << 16) | (long)(addr)) +#else +# define USB_READ_FLASH(addr) pgm_read_byte(addr) +#endif #define macro .macro #define endm .endm