Flashing NROM PRG-ROM working but unstable.

Not sure how I thought flash operations were previously working as there
were many bugs I had to correct to support flash operations properly.
Operations module appears to be working so far, still need to pass
functions to operation module.
Flash operations verify PRG-ROM 32KB writes working with file comparison.
Currently dependent on extra buffer status reads to delay next buffer.
I think the write operation is taking longer than the usb load operation.
Potentially due to slow code of operation module, but also possible I
had only been testing with slow eeepc linux machine previously.  Perhaps
combination of both.

Still need to correct issue so added buff status delays aren't needed.
buffer manager should be able to key off of status==USB_FULL but that
doesn't seem to work.  When trying I don't always get the same number of
buffers to get flashed so appear to have a race condition or something
not properly intialized..?

Need sort out sending of USB STALL if buffer isn't ready to be loaded yet.

This commit is mainly for documentation/reference purposes as things are
kind of working, but buggy/unstable.

AVR Memory Usage
----------------
Device: atmega164a

Program:    6486 bytes (39.6% Full)
(.text + .data + .bootloader)

Data:        679 bytes (66.3% Full)
(.data + .bss + .noinit)
This commit is contained in:
Paul Molloy pinkASUS 2017-02-13 11:49:57 -06:00
parent 31c063cd78
commit fe04496cfb
12 changed files with 582 additions and 421 deletions

View File

@ -1,345 +1,408 @@
:100000000C94E8000C9477090C9405010C940501FC
:100010000C9405010C9405010C9405010C94050148
:100020000C9405010C9405010C9405010C94050138
:100030000C9405010C9405010C9405010C94050128
:100040000C9405010C9405010C9405010C94050118
:100050000C9405010C9405010C9405010C94050108
:100060000C9405010C9405010C9405010C940501F8
:100070000C9405010C9405010C940501CB05CD05EC
:10008000D005D205D505D705DA05DC05DF05E10584
:10009000E305E605E805EA05EC05EE05F005F205E1
:1000A000F4056706670667066706F605F805FA05AC
:1000B000FC056706670667066706FE05000602067A
:1000C0000406060608060A060C060E0610061206A8
:1000D0001406160618061A061C0667066706670643
:1000E00067061E06200665062206240628062B063D
:1000F0002F063206380635063106340637063A062C
:100100003C063E06400642064406460648064A06A7
:100110004C064E06500652065406560658065A0617
:100120005C06670667066706670661065E06600688
:1001300064067406780676067A06800687068906BF
:100140008B068D0697069A06EE06F006F206F40672
:10015000F606F806FA06FC06FE0600070207060782
:10016000090212000101008096090400000000004D
:10017000000012011001FF000008C016DC0500029B
:10018000010200011E0349004E004C0020005200F5
:100190006500740072006F002D00500072006F0047
:1001A00067002A0349006E00660069006E0069005E
:1001B000740065004E00650073004C006900760015
:1001C000650073002E0063006F006D0004030904D6
:1001D00011241FBECFEFD4E0DEBFCDBF11E0A0E001
:1001E000B1E0ECE6F5E102C005900D92A230B10756
:1001F000D9F713E0A2E0B1E001C01D92AD38B1071C
:10020000E1F70E948B0A0C94B40A0C940000CF9280
:10021000DF92EF92FF92CF93DF93DB01F701E601CC
:10022000813579F1F0F4803509F04BC012968C914C
:100230001297808313968C911397818314968C91D7
:100240001497828315968C911597838316968C91BB
:100250001697848317968C911797858318968C919F
:100260002AC0803629F0813661F58091300105C0C1
:10027000A22FB0E0AF5ABE4F8C91808388818F5FF0
:100280001DC019968C91199780831A968C911A9794
:1002900081831B968C911B9782831C968C911C9753
:1002A00083831D968C911D9784831E968C911E9737
:1002B00085831F968C9186838881895F888380E0FF
:1002C00001C084EBDF91CF91FF90EF90DF90CF9052
:1002D0000895CF93DF93FC01DB01E9018091410197
:1002E0009091420120812078203849F4368138836A
:1002F000442309F445C08D919C9111970CC02FEFB8
:100300002883268120932F01442351F170936203A7
:100310006093610320E913962C93139714961C9213
:100320002281213711F02034F1F5A0916103B091C1
:1003300062030D90BC91A02D25812C93A0916103A7
:10034000B09162030D90BC91A02D248111962C9345
:10035000E0916103F091620324812E5F248323C026
:10036000A0911D01B0911E01B0936203A09361039F
:1003700020E913962C93A0911D01B0911E01CECFC0
:10038000A0911D01B0911E0113963C911397383D29
:1003900021F48D919C911197ECCF2FEF288320E1D0
:1003A00020933001E8CFDF91CF910895E1E5F1E0AE
:1003B0009FEF8FEF919321E0E136F207D1F7809321
:1003C000440180932201809347018093250180930B
:1003D000340180931001809337018093130181E0F1
:1003E000809330010895FB01803391F038F4882325
:1003F00061F08130B9F42093300112C0823371F082
:1004000050F0833379F427870BC00E94D60108C0CF
:100410004187228705C04387248702C045872687F6
:1004200080E0089584EB0895CF93DF93FC0150E0C2
:10043000CA01820F911D41970CF047C0222309F495
:1004400046C083818F3F09F044C086818F3F09F009
:1004500042C080E090E0EA01CF5ADE4F821750F4AC
:100460000196DE01A80FB91F11973C913F3FB1F3F0
:1004700081EC32C066831382822F8295880F807E42
:10048000815082831482158210861782118612860B
:1004900013861486158616861786CA0135E0880FDE
:1004A000991F3A95E1F78F599E4F9183808380E0A1
:1004B00090E04F5A5E4F821730F4FA01E80FF91FAF
:1004C00060830196F8CF80E007C08EEB05C082EC18
:1004D00003C08FEB01C080ECDF91CF9108950F93A3
:1004E000FB01642F422F202F803888F0883858F085
:1004F0008059883060F40583242F30E0362B308714
:10050000278380E005C0CF010F910C94140286EB85
:100510000F910895CF92DF92EF92FF920F93CF93B6
:10052000DF93FC01EB016A01828190ED980F90331B
:1005300070F49381913071F050F0923029F0933043
:10054000C1F56DE071E008C061E371E005C061E4F0
:1005500071E002C06FE171E0803768F4803580F4AB
:10056000803408F047C00381248145810E94F30153
:10057000888381E03CC0803868F4960140E03CC04C
:100580007E019FEFE91AF90A0381248145810E94C7
:1005900007013DC0982F97709130A1F080F0923004
:1005A00029F0933031F46DE071E00EC061E371E049
:1005B0000BC086E8888381E0D6018C9329C061E472
:1005C00071E002C06FE171E0803F50F4803C58F46C
:1005D0008038E0F00381248145810E946F0217C0BA
:1005E000883F40F013C0DB01CD91DC918681F6019C
:1005F00080830EC096014FEFCF01DF91CF910F9115
:10060000FF90EF90DF90CF900C94690185E888838C
:10061000CE01DF91CF910F91FF90EF90DF90CF90BF
:10062000089590914401809122018F3F29F481E047
:100630009F3F19F480E001C082E0909134019F3F18
:1006400009F083E0909110019F3F09F084E0089544
:10065000623049F421E08134920739F121E08F3191
:10066000920761F10895633069F421E081349207C3
:10067000E1F021E08F319207D9F021E08133920738
:10068000E9F008956430E1F421E08134920769F0E3
:1006900021E08F31920761F021E08133920759F018
:1006A00021E08D30920751F008958FE191E0089597
:1006B00081E391E008958DE091E0089581E491E077
:1006C0000895CF93DF93D09130018D2F8F7D823DA0
:1006D00001F50E941103C82F8093020121E431E04B
:1006E00030931E0120931D01D23D99F4C901D1E040
:1006F000DC1728F46C2F0E942803DF5FF9CF90935A
:100700001E0180931D0120E8FC01238380ED80936E
:10071000300180913001823F19F480EF80933001E5
:10072000C0913001C03D31F580911D0190911E01B5
:10073000FC0123812038F1F4609102010E9428031A
:1007400090931E0180931D01FC011482C3830E94BB
:10075000BD03E0911D01F0911E01882311F08383F8
:1007600009C088ED8383258187819085820F911D43
:1007700090878783DF91CF9108950F93CF93DF9375
:10078000EC016F8189858C3061F028F48A3039F072
:100790008B3081F002C08F3068F083EC0CC0606851
:1007A00001C060660FEF2A814E81888199810E9485
:1007B0008A058C8380E0DF91CF910F9108950F938C
:1007C0001F93CF93DF93EC011F8110689C818A8176
:1007D000981790F54AEA65E585E50E94B00445E57D
:1007E0006AEA8AE20E94B00440EA65E585E50E9473
:1007F000B0046C81E881F981E60FF11D4081812F01
:100800000E94B0046C81812F0E94D804082F6C8153
:10081000812F0E94D8040813F5CF8C81E881F981DB
:10082000E80FF11D9081091304C08F5F8C835998E4
:10083000CDCF519A599ACACF80E0DF91CF911F91C5
:100840000F91089511B88FEF82B914B885B917B810
:1008500088B98AB184718AB98BB18B6E8BB9509883
:1008600058985198599A08950E942204399A419AA9
:10087000389A40983A9A429A3C9A449A3D9A459AB4
:100880003F9A479A47988FEF84B915B8479A479887
:1008900014B812B881B914B885B908950E94220419
:1008A000399A419A3C9A449A3D9A459A509A589A54
:1008B0003F9A479A4798579A5F9A5F988FEF84B903
:1008C00015B8479A479814B884B915B85F9A5F98D5
:1008D00014B812B881B914B885B90895813049F0B7
:1008E00028F0823051F40E944E0405C00E94220478
:1008F00002C00E94340480E0089586E90895FC0156
:1009000081E080835898509A000089B18183509883
:100910005898908181818923891308C08AEA868347
:100920008483828385E58583838308955098589ACC
:1009300089B1818389B1828389B1838389B18483B9
:1009400089B1858389B186835098589808958038F5
:1009500029F4CB010E947F0480E0089587E908957F
:100960009FEF94B985B9479A479862B945B95898A5
:10097000509A5098589A14B808955098589840989A
:10098000419A429A62B99FEF94B985B9479A4798BC
:1009900014B800000000409A87FD41980000000054
:1009A000000000000000000083B14098419A0895C3
:1009B00062B99FEF94B985B9479A479814B8409A9D
:1009C00087FD4198000000000000000083B14098BE
:1009D000419A0895509858989FEF94B962B985B993
:1009E000479A4798429845B9409A87FD4198000038
:1009F00000004098419A429A14B808959FEF94B924
:100A0000803208F4806885B9479A479814B862B96B
:100A10004498000000000000000083B1449A08954B
:100A20009FEF94B9803208F4806885B9479A479857
:100A300062B945B9000045980000459A14B8089578
:100A4000982F862F642F422F913049F028F0923052
:100A500051F40E94EA0405C00E94B00402C00E9442
:100A6000100580E0089580EA08958FEF84B984E04E
:100A700085B9479A479829B188E085B9479A479838
:100A800089B1807214B891E0422F407225FD90E048
:100A900031E0882311F030E002C0911114C021E050
:100AA000411101C020E0811103C0222381F003C065
:100AB000222329F00AC0332351F082E108959923BB
:100AC00031F083E1089580E1089581E108958FEF89
:100AD0000895CF93DF93982F862F642FE9019138E3
:100AE00069F028F4903891F40E94BD040CC092384B
:100AF00041F0933859F40E94350505C00E94D8048E
:100B000002C00E94FE04888380E001C081EADF9178
:100B1000CF910895EF92FF920F93CF93DF9300D080
:100B20001F92CDB7DEB77C018FEF84B965B9479AC4
:100B3000479814B8409A67FD419842B980E0011186
:100B400003C00000000008C02B834A8389830E94F1
:100B50004E0889814A812B8193B1F701E80FF11D7D
:100B600090834F5F42B98F5F281748F74098419AAA
:100B70000F900F900F90DF91CF910F91FF90EF901A
:100B8000089590E08B35910508F0A1C0FC01E25C6E
:100B9000FF4F0C94AE0A11B895C08FEF81B992C087
:100BA00012B890C08FEF82B98DC014B88BC08FEF90
:100BB00084B988C015B886C08FEF85B983C017B8CF
:100BC00081C018B87FC08FEF88B97CC038987AC0D0
:100BD000389A78C0409876C0409A74C0399872C0EC
:100BE000399A70C041986EC0419A6CC03A986AC0F8
:100BF0003A9A68C0429866C0429A64C03B9862C004
:100C00003B9A60C043985EC0439A5CC03C985AC00F
:100C10003C9A58C0449856C0449A54C03D9852C01B
:100C20003D9A50C045984EC0459A4CC03E984AC027
:100C30003E9A48C0469846C0469A44C03F9842C033
:100C40003F9A40C0479A3EC08AB184718AB93AC07F
:100C50008BB1847102C08BB18B6E8BB933C050984D
:100C600031C05898509A2EC05098589A2BC050981E
:100C7000589828C0519826C0519A24C0599822C02B
:100C8000599A20C053981EC0539A1CC05B981AC032
:100C90005B9A18C0559816C0559A14C05D9812C03A
:100CA0005D9A10C056980EC0569A0CC05E980AC045
:100CB0005E9A08C0579806C0579A04C05F9A02C04F
:100CC0005F9A5F9880E00895479A4798FBCF8CE839
:100CD000089590E0FC01E058F109EB30F105A0F532
:100CE000E756FF4F0C94AE0A62B922C08FEF84B969
:100CF00065B91EC08FEF84B965B9479A479805C09A
:100D00008FEF84B965B95F9A5F9814B811C061B963
:100D10000FC064B90DC067B90BC09AB1862F84614A
:100D200089238AB98AB16B7E682B6AB901C068B918
:100D300080E008959BB1862F846189238BB98BB1A4
:100D40006B7E682B6BB9F4CF8DE80895813A61F022
:100D5000823AB9F0803A11F58FEF84B965B9479AB4
:100D6000479814B842B916C08FEF84B965B9479A4D
:100D7000479814B842B967FF02C041980BC0419A26
:100D800009C042B98FEF84B9603230F415B8479A80
:100D9000479814B880E0089565B9F9CF8EE80895B2
:100DA000803B61F422B98FEF84B945B9479A4798DF
:100DB00065B95F9A5F9814B880E008958FE8089548
:100DC000CF93DF93EB0190E0805C91098C3091052B
:100DD000F8F48C559F4FFC010C94AE0A80B113C0FF
:100DE00083B111C086B10FC089B10DC082B10BC0F3
:100DF00085B109C088B107C08BB105C081B103C0FE
:100E000084B101C087B1888380E003C08AB1FBCF81
:100E100080E9DF91CF9108950F93811102C0589A14
:100E200001C058988FEF84B922B945B9479A4798BD
:100E300005B9459800000000459A419A14B85898A1
:100E40000F9108950F93022F813061F030F08230BE
:100E500089F4242F462F60E008C0242F462F6FEF1F
:100E600081E004C0242F462F6FEF80E00E940C0722
:100E700080E001C08AEA0F9108950F93811102C0AA
:100E8000589A01C058988FEF84B902B925B9479A8A
:100E9000479845B95F9A5F9814B8449800000000DD
:100EA0000000000083B1449A419A58980F91089528
:100EB0000F931F93CF93DF93E801813851F082386D
:100EC00091F08038A9F4022F242F462F6FEF81E094
:100ED00005C0022F242F462F6FEF80E00E943D07B0
:100EE000888380E006C0022F242F462F60E0F5CFD4
:100EF0008BEADF91CF911F910F9108950F931F936C
:100F0000CF93DF931F92CDB7DEB7FC0183E091E072
:100F100090937203809371031982808187FF02C0CE
:100F200081E089838181833009F44BC028F48130CA
:100F3000D1F08230C1F179C0853009F467C008F47E
:100F400054C0863009F071C01092030180910B01EA
:100F500080930401E0916103F091620382818093A8
:100F6000050183E060C08281803B38F4803A88F4D8
:100F7000803858F40E94C10559C0803C78F424811F
:100F8000458163810E94D00651C064810E94690638
:100F90004DC0448165810E94A60648C064E071E0AE
:100FA0000E94E0061DC08281803818F40E946E0401
:100FB0003DC064E071E00E94A7048093030188E0D3
:100FC00032C08281803830F42381448165810E945F
:100FD00020052CC024E031E0448165810E94690530
:100FE0008093030189818F5F1EC08281803830F435
:100FF0002381448165810E94220718C004E011E02A
:101000002481458163810E945807EACFAE014F5F7A
:101010005F4F63E071E0CF010E948A0290937203F8
:101020008093710305C0898303C080E88093030126
:1010300089810F90DF91CF911F910F910895E091D9
:101040006103F0916203448120813181582FFC01BA
:10105000742F781B972F9E0F8E2F851B861730F4C9
:101060008191D901A90FB11D8C93F4CFE091610357
:10107000F09162038481860F848390912F01961BE7
:1010800090932F0110920B01640F8281861302C08E
:1010900088E9838381E0911180E00895CF93DF9305
:1010A00060917303635067FDA4C080917003CCE02E
:1010B000D0E0C81BD109C958DC4F80916F038D3235
:1010C00009F085C0683009F092C083EC8093630317
:1010D0008AE58093010110920C018881807621F0CD
:1010E000CE010E947E0760C08A8110926C039981B4
:1010F000911106C010926D032CE633E082E050C0DF
:10110000953019F4809374033DC09630A9F59B8106
:10111000913019F482E791E004C0923041F480E606
:1011200091E0909372038093710382E121C0933028
:10113000F1F4811108C08CEC91E0909372038093DC
:10114000710384E015C0813041F482EA91E090930C
:101150007203809371038AE20BC0823041F484E809
:1011600091E090937203809371038EE101C080E05F
:1011700090E490930C0118C0983079F0993031F4D4
:10118000809376032CE633E080E00AC081E09A3059
:1011900009F080E02CE633E003C026E733E081E08D
:1011A00030937203209371038F3F39F4988197FD38
:1011B0008E8190E890930C0107C09F81911104C02B
:1011C0009E81981708F4892F8093000110C08091A8
:1011D0000C0187FF0CC0CE010E941F088F3F21F435
:1011E0008EE18093010103C08111109200011092E1
:1011F00073038091010184FF4DC0809100018F3FF6
:1012000009F448C0C82F893008F0C8E08C1B8093CF
:1012100000018091630398E8892780936303CC23BE
:1012200061F1809171039091720320910C0126FF6E
:1012300012C0A4E6B3E023E633E020953095280FF2
:10124000391F4C2F4A0FF901EA0FFB1FE491ED9370
:101250004A13F9CF09C0E4E6F3E0DC012C2F2E0F8E
:101260003D9131932E13FCCF01962FEF2C0F820F5F
:10127000911D90937203809371036C2F84E693E029
:101280000E947309CC5FCC3019F08FEF809300017E
:10129000C093010184E199B1947131F48150D9F77F
:1012A0001092740310926E03DF91CF910895E9E6D6
:1012B000F0E0808182608083E89A0895A82FB92F9A
:1012C00080E090E041E050EA609530E009C02D9167
:1012D00082279795879510F084279527305EC8F36D
:1012E0006F5FA8F30895EADF8D939D930895CF93E0
:1012F000CFB7CF93DF93C3954C9BE9F74C9B0BC0C3
:101300004C9B09C04C9B07C04C9B05C04C9B03C029
:101310004C9B01C089C06F93C0917003DD27C958F1
:10132000DC4F2F9365E54C9B03C02F916F91E6CF67
:101330000F931F934F9320E040E15F9309B1047135
:1013400004FB27F93F9350E03BE039C0147140643F
:101350002F77012F5F5F1EC0406819B114712F777E
:1013600052501FC0406409B12F770471D1F15F5F03
:1013700000C023C0406219B12F77147191F15F5FF3
:1013800000C025C004711027515012F45D5F0000A9
:10139000115027952C3F19B1C8F61471012701503F
:1013A00027952C3FC8F64227499309B104711027AD
:1013B0004F73115027952C3FA8F64695469519B1C5
:1013C000147179F00127015027952C3F98F66B5A3C
:1013D00060F3315009B1B0F600C011E01CBB00272A
:1013E00017C03B503195C31BD04011E01CBB088196
:1013F000033CF9F00B34E9F020916E031981110FD1
:101400001213EDCF093651F10D3211F0013E39F7CB
:10141000009375033F915F914F911F910F912F9111
:101420006F91CCB3C0FD67CFDF91CF91CFBFCF918C
:10143000189520917503222369F3109173031123EA
:1014400039F534303AF13093730320936F031091E0
:1014500070033BE0311B309370031CC00091730399
:101460000130B4F40AE53091010134FD14C0009359
:101470000101C3E6D3E013C0052710E000C000005F
:101480000BB91AC0052710E0221F1DC010E021C0B3
:101490004AE502C032ED432FC4E1D0E032E01AB198
:1014A00014615C9A0BB11AB954E120E865E320FF9E
:1014B00005270BB9279517951C3FF0F66695B8F7E9
:1014C000B1F720FF05270BB9279517951C3FD0F6DC
:1014D0002795179517FF052700001C3F0BB9B0F69D
:1014E00029913A9519F70B7E10917403110FC6518B
:1014F000D0400BB911F010936E0311E01CBB0061DA
:101500001AB11B7E402F4B7E54E05A95F1F70BB970
:101510001AB94BB97FCF2EE088E190E00FB6F8946E
:10152000A895809360000FBE209360000E94570929
:10153000549A80E0815041F0A895EFE9FFE031979F
:10154000F1F700C00000F6CF54980E94220478946E
:10155000A8950E944E080E946103FACFEE0FFF1F6C
:0C1560000590F491E02D0994F894FFCF61
:02156C00FF5A24
:100000000C94D1000C94930B0C94EE000C94EE0025
:100010000C94EE000C94EE000C94EE000C94EE00A8
:100020000C94EE000C94EE000C94EE000C94EE0098
:100030000C94EE000C94EE000C94EE000C94EE0088
:100040000C94EE000C94EE000C94EE000C94EE0078
:100050000C94EE000C94EE000C94EE000C94EE0068
:100060000C94EE000C94EE000C94EE000C94EE0058
:100070000C94EE000C94EE000C94EE00AE07B0076A
:10008000B307B507B807BA07BD07BF07C207C4075C
:10009000C607C907CB07CD07CF07D107D307D507B9
:1000A000D707AC07AC07AC07AC07D907DB07DD0700
:1000B000DF07AC07AC07AC07AC07E107E307E507D0
:1000C000E707E907EB07ED07EF07F107F307F50788
:1000D000F707F907FB07FD07FF07AC07AC07AC07FD
:1000E000AC07010803080508070809080D081008EF
:1000F000140817081D081A08160819081C081F08F4
:10010000210823082508270829082B082D082F086F
:10011000310833083508370839083B083D083F08DF
:100120004108AC07AC07AC07AC07460843084508D4
:100130004908040309042A0349006E0066006900A7
:100140006E006900740065004E00650073004C008D
:1001500069007600650073002E0063006F006D007B
:100160001E0349004E004C00200052006500740040
:1001700072006F002D00500072006F0067001201C6
:100180001001FF000008C016DC050002010200019A
:10019000090212000101008096090400000000001D
:1001A000000011241FBECFEFD4E0DEBFCDBF11E0B1
:1001B000A0E0B1E0E2E5F9E102C005900D92A430C3
:1001C000B107D9F713E0A4E0B1E001C01D92A73A4E
:1001D000B107E1F70E9462050C94A70C0C94000093
:1001E000CF92DF92EF92FF92CF93DF93FB01D70183
:1001F000E601813539F1803621F0803559F085EB03
:100200003EC0E22FF0E0EE5AFE4F80818C93888151
:100210008F5F33C082818C93838111968C93119769
:10022000848112968C931297858113968C931397E1
:10023000868114968C931497878115968C931597C5
:10024000808517C081858C93828511968C93119738
:10025000838512968C931297848513968C931397AB
:10026000858514968C931497868515968C9315978F
:10027000878516968C938881895F888380E0DF91DB
:10028000CF91FF90EF90DF90CF9008950F931F9341
:10029000CF93DF93FC01062F122FA42FB0E030E0A4
:1002A000C9018A0F9B1F419714F08EEB47C01123A1
:1002B00011F482EC43C083818F3F11F08FEB3EC07D
:1002C00086818F3F11F080EC39C0BD016E5A7E4FA0
:1002D000EB0190E006C089918F3F11F081EC2EC0B8
:1002E0009F5F9117C0F30683138295E0220F331F9F
:1002F0009A95E1F7822F81508283148215821086AD
:10030000178211861286138614861586168617861E
:1003100085E0AA0FBB1F8A95E1F7AE59BE4FB183A6
:10032000A08350E0410F511D4E5A5E4F03C0FB01A8
:100330000193BF0164177507D1F780E0DF91CF917A
:100340001F910F9108950F93FB01803828F0883892
:1003500028F08059883048F086EB10C0CB01642F1C
:10036000422F202F0E94460109C00583942F80E070
:1003700030E0822B932B9087878380E00F91089544
:10038000DC0190E009C0E0914201F0914301E90FE6
:10039000F11D80818D939F5F9617A8F30895DC016E
:1003A00090E009C0E0914201F0914301E90FF11D95
:1003B0008D9180839F5F9617A8F308952091450142
:1003C000809124018F3F11F092E004C090E02F3F14
:1003D00009F091E0809135018F3F09F093E0809121
:1003E00012018F3F09F094E0892F08959C0162303B
:1003F00049F481E022343807D1F081E02132380716
:1004000069F52AC0633069F481E02234380779F055
:1004100081E02132380791F081E022333807F1F48E
:100420001BC06430D9F481E02234380719F421E28A
:1004300031E014C081E02132380719F422E331E0C1
:100440000DC081E02233380719F42FE031E006C0F7
:1004500081E02F30380711F422E431E0C90108951A
:10046000E2E5F1E08FEF819391E0E236F907D9F709
:100470008093450180932401809348018093270154
:100480008093350180931201809338018093150188
:1004900081E00E941D070895FB01813399F08233AA
:1004A00028F4882349F0803329F409C0823369F0A5
:1004B000833379F084EB08950E94300208C04187AD
:1004C000228705C04387248702C04587268780E0AE
:1004D0000895278780E008950F931F93CF93DF93AC
:1004E000EC01FB01D9010091420110914301988177
:1004F0009078903819F48E818C9305C08FEF8C938F
:100500008E8180933101442311F5E0911F01F09118
:100510002001903851F48381883D21F400811181BC
:10052000938310C08FEF8C930AC08381882339F4A2
:10053000F0936303E093620380E9838303C080E167
:100540000E941D07E0911F01F09120010CC090381E
:1005500021F400811181938306C0F0936303E0933B
:10056000620380E983831482E0911F01F0912001EE
:1005700083818039F1F48A81813711F08034C9F4A4
:10058000E0916203F09163030190F081E02D8D8191
:100590008083E0916203F09163030190F081E02D8C
:1005A0008C818183E0916203F091630384818E5F8B
:1005B0008483C801DF91CF911F910F910895CF924D
:1005C000DF92EF92FF920F93CF93DF93DC01EB0169
:1005D0006A0112962C911297822F80538033B0F4C7
:1005E00013968C911397813041F0813078F08230EE
:1005F00039F0833009F053C006C061E271E008C0F1
:1006000062E371E005C06FE071E002C062E471E096
:10061000203728F42035A0F4203420F00FC02038F3
:10062000F8F021C0822F15964C91159714962C91B5
:10063000149713960C910E944C0232C0CD0157C002
:100640007E010894E11CF11C822F15964C911597A0
:1006500014962C91149713960C910E94F0004EC0A2
:10066000CD0140E045C0822F90E0877090708130CE
:10067000910579F0823091051CF4892BB1F00FC0FF
:100680008230910519F0039751F406C0E2E3F1E0DE
:100690000EC0E1E2F1E00BC0EFE0F1E008C086E857
:1006A000888381E0F60180832AC0E2E4F1E0203F04
:1006B00028F4203C98F4203800F103C0283FE8F4E7
:1006C00014C0822FBF0115964C91159714962C914A
:1006D000149713960C910E94A30110C02081918160
:1006E00016968C91F60180830CC0CD01BF014FEFAF
:1006F00096010E946C02282F04C085E888832C2F65
:100700009D2F822FDF91CF910F91FF90EF90DF907F
:10071000CF9008950F931F93CF93DF930E942307E9
:10072000823D21F00E942307823F51F40E94DE01A6
:100730008093040182E491E09093200180931F0153
:100740000E942307823DC1F40091040111E009C019
:10075000CF01602F0E94F6019093200180931F012A
:100760001F5FE0911F01F0912001101788F380E8CE
:10077000838380ED0E941D070E942307823F41F47E
:1007800080EF0E941D07E0911F01F091200113826C
:100790000E942307182F803D31F5E0911F01F09151
:1007A000200183818038F9F4CF01609104010E9417
:1007B000F601FC019093200180931F0114821383A2
:1007C0000E942704E0911F01F0912001882311F07D
:1007D000838309C088ED8383258187819085820F7B
:1007E000911D908787830E942307182F803F51F522
:1007F00080913101882331F5C0911F01D0912001F2
:100800008B818823F9F08FEF80933101CE016091C5
:1008100004010E94F601FC019093200180931F01C6
:1008200013821B83CE010E94AF04882311F08B83B7
:1008300009C084EF8B832D818F819885820F911D54
:1008400098878F83DF91CF911F910F9108950F9318
:10085000CF93DF93EC016F8189858C30A9F08D30C7
:1008600028F48A3039F08B3019F406C08F30A8F0A4
:1008700083EC14C0606809C0888199814E812A8107
:100880000FEF0E94740608C06066888199814E81CE
:100890002A810FEF0E94A6068C8380E0DF91CF9122
:1008A0000F9108958F929F92BF92CF92DF92EF9215
:1008B000FF920F931F93CF93DF93B62E6A017901B6
:1008C0004801DA0114968C91C82FD0E033C0E09132
:1008D0000001F0910101858166814781F701099549
:1008E000E0910001F0910101818562854385F70166
:1008F0000995E0910001F0910101858566854785A4
:10090000F7010995D601ED91FC91E00FF11D8B2DBA
:100910006C2F4081F70109950E94750A8B2D602F7D
:10092000F4010995182F8B2D602FF40109951817E4
:1009300099F721960C2FF601828190E08C179D0784
:1009400030F6C48380E0DF91CF911F910F91FF902B
:10095000EF90DF90CF90BF909F908F9008950F936E
:100960001F93FC01678181858B3089F08C3018F4EE
:100970008A3019F404C08F3090F083EC11C06068A5
:1009800080E0AF0124E835E00FEA15E006C080E022
:10099000AF012BEE35E005ED15E00E94520480E03A
:1009A0001F910F91089511B88FEF82B914B885B9CE
:1009B00017B888B98AB184718AB98BB18B6E8BB93B
:1009C000509858985198599A08950E94D304399A8A
:1009D000419A389A40983A9A429A3C9A449A3D9A57
:1009E000459A3F9A479A47988FEF84B915B8479A26
:1009F000479814B812B881B914B885B908950E94FF
:100A0000D304399A419A3C9A449A3D9A459A509A0D
:100A1000589A3F9A479A4798579A5F9A5F988FEFEC
:100A200084B915B8479A479814B884B915B85F9A2D
:100A30005F9814B812B881B914B885B90895813097
:100A400049F0813020F0823049F086E908950E9413
:100A5000D30402C00E94E50480E008950E94FF04D0
:100A600080E00895FC0181E080835898509A00004E
:100A700089B181835098589890818923891741F4CE
:100A80008AEA86838483828385E5858383830895C8
:100A90005098589A89B1818389B1828389B18383BF
:100AA00089B1848389B1858389B1868350985898A8
:100AB0000895803811F087E90895CB010E9432052E
:100AC00080E008952EE088E190E00FB6F894A895B4
:100AD000809360000FBE209360000E946E0A549ABB
:100AE00020E040EA5FE004C0A895CA010197F1F751
:100AF0002150D1F754980E94D3047894A8950E946D
:100B0000750A0E948A03FACF9FEF94B985B9479A74
:100B1000479862B945B95898509A5098589A14B85D
:100B20000895509858984098419A429A62B99FEF18
:100B300094B985B9479A479814B80000000087FF18
:100B400003C0409A419801C0409A00000000000094
:100B500000000000000083B14098419A089562B9F6
:100B60009FEF94B985B9479A479814B8409A87FD82
:100B70004198000000000000000083B14098419AB5
:100B80000895509858989FEF94B962B985B9479ADB
:100B90004798429845B9409A87FD41980000000067
:100BA0004098419A429A14B80895982F803220F4C0
:100BB0008FEF84B9906802C08FEF84B995B9479AD6
:100BC000479814B862B94498000000000000000083
:100BD00083B1449A0895982F8FEF84B9903208F426
:100BE000906895B9479A479862B945B90000459809
:100BF0000000459A14B80895813061F0813020F0EA
:100C0000823079F080EA0895862F642F422F0E9467
:100C1000840505C0862F642F422F0E94EB0580E0DB
:100C20000895862F642F422F0E94C10580E0089509
:100C30008FEF84B984E085B9479A479899B188E0E5
:100C400085B9479A479889B1807214B830E0492F26
:100C5000407295FF31E020E0882309F421E033233E
:100C600021F0222311F080E10895942F411191E0A9
:100C7000811181E0992321F0882311F081E1089509
:100C8000992321F0222311F082E10895332311F0FA
:100C9000882311F48FEF089583E10895CF93DF93B4
:100CA000E901813881F0823818F4803829F406C0CF
:100CB000823871F0833889F081EA13C0862F642F5F
:100CC0000E9491050CC0862F642F0E94AF0507C0BB
:100CD000862F642F0E94D50502C00E9418068883C3
:100CE00080E0DF91CF910895EF92FF920F931F93D1
:100CF000CF93DF93EC01F42EE22E603220F48FEFDD
:100D000084B9606802C08FEF84B965B9479A479883
:100D100014B84498F2B810E0002319F40000000061
:100D200002C00E94750A83B1FE01E10FF11D8083AC
:100D3000F394F2B81F5FE11678F7449A812FDF91A0
:100D4000CF911F910F91FF90EF900895EF92FF9236
:100D50000F931F93CF93DF93EC01F42EE22E8FEFCE
:100D600084B965B9479A479814B8409A67FD419885
:100D7000F2B810E0002319F40000000002C00E9445
:100D8000750A83B1FE01E10FF11D8083F394F2B87F
:100D90001F5FE11678F74098419A812FDF91CF913C
:100DA0001F910F91FF90EF900895833081F4613887
:100DB00041F0623819F0603851F406C025ED35E095
:100DC00008C02FEA35E005C021E935E002C02FEF69
:100DD0003FEFC9010895833079F4613051F06130FB
:100DE00028F0623049F421EC35E008C024E835E011
:100DF00005C02BEE35E002C02FEF3FEFC90108958B
:100E0000EF92FF920F931F93CF93DF93E801D701E7
:100E1000803411F083ED0AC0E0910001F0910101EE
:100E2000808188838C918F5F8C9380E0DF91CF915C
:100E30001F910F91FF90EF900895E0910001F091C4
:100E4000010180830895E0910001F091010180810A
:100E500008958330B9F1843048F4813089F0E0910D
:100E60000001F0910101823098F408C0853001F151
:100E7000853098F0863041F182ED0895408322C09C
:100E8000809100019091010163E10E94C0011AC0AC
:100E9000CF0163E10E94CF0115C0862F642F0E940D
:100EA000D506E0910001F0910101948B838B0AC07B
:100EB000862F642F0E94EB06E0910001F091010162
:100EC000968B858B80E00895862F642F0E94EB0619
:100ED000E0910001F0910101908F878B80E00895EF
:100EE0000F931F93CF93DF93FC01EB018A01828163
:100EF000803418F08038D8F40AC065814481238199
:100F00000E942907888381E0F801808312C0803421
:100F100011F083ED0DC0E0910001F091010180819D
:100F20008983FA0180818F5F808380E001C087E838
:100F30008883CE01DF91CF911F910F910895E82F03
:100F4000F0E0EB35F10540F4E25CFF4FEE0FFF1FE0
:100F50000590F491E02D09948CE8089511B897C09C
:100F60008FEF81B994C012B892C08FEF82B98FC051
:100F700014B88DC08FEF84B98AC015B888C08FEFC0
:100F800085B985C017B883C018B881C08FEF88B9FC
:100F90007EC038987CC0389A7AC0409878C0409A11
:100FA00076C0399874C0399A72C0419870C0419A1D
:100FB0006EC03A986CC03A9A6AC0429868C0429A29
:100FC00066C03B9864C03B9A62C0439860C0439A35
:100FD0005EC03C985CC03C9A5AC0449858C0449A41
:100FE00056C03D9854C03D9A52C0459850C0459A4D
:100FF0004EC03E984CC03E9A4AC0469848C0469A59
:1010000046C03F9844C03F9A42C0479840C0479A64
:101010003EC08AB184718AB93AC08BB1847102C072
:101020008BB18B6E8BB933C0509831C05898509AA1
:101030002EC05098589A2BC05098589828C0519854
:1010400026C0519A24C0599822C0599A20C053985A
:101050001EC0539A1CC05B981AC05B9A18C0559862
:1010600016C0559A14C05D9812C05D9A10C056986B
:101070000EC0569A0CC05E980AC05E9A08C0579877
:1010800006C0579A04C05F9A02C05F9A5F9880E0DA
:101090000895479A479880E00895853891F18638F9
:1010A00070F48238E9F0833828F48038B9F0813858
:1010B00099F418C08338C1F0843871F41BC08838A3
:1010C00031F1893828F48638F1F0873829F41DC0C9
:1010D000893839F18A3841F18DE8089562B922C022
:1010E0008FEF84B965B91EC08FEF84B965B9479A8F
:1010F000479805C08FEF84B965B95F9A5F9814B8B7
:1011000011C061B90FC064B90DC067B90BC08AB115
:10111000962F946198239AB98AB16B7E862B8AB9EF
:1011200001C068B980E008958BB1962F946198232F
:101130009BB98BB16B7E862B8BB980E00895813A89
:1011400071F0823AC9F0803A11F08EE808958FEF7D
:1011500084B965B9479A479814B842B917C08FEF58
:1011600084B965B9479A479814B842B967FF02C075
:1011700041980CC0419A0AC042B9603248F48FEFDE
:1011800084B9607865B9479A479814B880E00895A3
:101190008FEF84B965B9479A479814B880E00895ED
:1011A000803B11F08FE8089522B98FEF84B945B9DB
:1011B000479A479865B95F9A5F9814B880E0089598
:1011C000FB01853C59F1863C70F4823C09F1833C7B
:1011D00028F4803CC9F0813CA9F418C0833CD1F0CC
:1011E000843C81F419C0883CF9F0893C28F4863CA1
:1011F000B9F0873C39F416C08A3CD1F08A3CB0F093
:101200008B3CD1F080E9089580B113C083B111C047
:1012100086B10FC089B10DC082B10BC085B109C0C4
:1012200088B107C08BB105C081B103C084B101C0D2
:1012300087B1808380E008958AB1808380E008953B
:101240000F93882311F4589A01C058988FEF84B9EE
:1012500022B945B9479A479805B94598000000005A
:10126000459A419A14B858980F9108950F93962F64
:10127000342F022F813041F0813020F0823039F05C
:101280008AEA0CC081E001C080E06FEF02C080E01C
:1012900060E0492F232F0E94200980E00F910895DC
:1012A0000F93882311F4589A01C058988FEF84B98E
:1012B00002B925B9479A479845B95F9A5F9814B81B
:1012C0004498000000000000000083B1449A419A55
:1012D00058980F9108950F931F93CF93DF93962FF4
:1012E000342F522FE801813841F0823849F080389C
:1012F00011F08BEA0EC081E001C080E06FEF02C008
:1013000080E060E0492F232F052F0E945009888339
:1013100080E0DF91CF911F910F910895E0916203DA
:10132000F0916303748140815181DC0190E006C03B
:10133000FA01E80FF11D8D9180839F5F892F870F40
:101340009617B0F3E0916203F09163039481960FD6
:10135000948320913101261B2093310182818917CA
:1013600011F488E98383222311F080E0089588E94D
:10137000838381E008950F931F93DF93CF930F92A0
:10138000CDB7DEB7FC0185E091E090938C038093AC
:101390008B031982808187FF03C081E0898301C0AC
:1013A00019828181843009F454C0853040F4823040
:1013B00091F18330F0F5813009F086C00AC08630A3
:1013C00009F466C0863008F45AC0873009F07CC042
:1013D0006EC08281803B28F4803A68F4803820F027
:1013E00006C0803C68F012C00E949F076EC06481F6
:1013F0000E944D086AC0658144810E949F0865C0B3
:101400006381458124810E94D0085FC066E071E05D
:101410000E94E0082EC08281803818F40E941F05C7
:1014200054C066E071E00E9459058093050188E090
:1014300024C08281803830F46581448123810E94F8
:10144000FC0543C06581448126E031E00E944E06E0
:1014500010C08281803830F46581448123810E94EC
:10146000360933C063814581248106E011E00E9482
:101470006B098093050189818F5F898328C0CF0123
:1014800065E071E0AE014F5F5F4F0E94DF0217C061
:101490001092050180910D0180930601E091620395
:1014A000F091630382818093070183E0E6CFCF014F
:1014B00065E071E0AE014F5F5F4F0E94700790934F
:1014C0008C0380938B0303C080E88093050189819E
:1014D0000F90CF91DF911F910F910895E9E6F0E011
:1014E000808182608083E89A08951F93CF93DF9371
:1014F00060918D03635067FDA5C080918A03CCE0A5
:10150000D0E0C81BD109CF56DC4F809189038D32C2
:1015100009F085C0683009F093C083EC80937D03A7
:101520008AE58093020110920E018881807641F055
:10153000CE010E94BB09282F8F3F09F45FC065C010
:101540009A81109286038981882321F4109287035F
:1015500022E04DC0853019F490938E0347C0863049
:10156000B1F58B81813019F48EE791E004C08230AF
:1015700041F480E991E090938C0380938B0322E106
:1015800022C08330F9F48A81882341F482E391E018
:1015900090938C0380938B0324E015C0813041F439
:1015A00086E391E090938C0380938B032AE20BC037
:1015B000823041F480E691E090938C0380938B031A
:1015C0002EE101C020E080E480930E011EC088302F
:1015D00021F421E080E993E00CC0893019F4909364
:1015E000900304C08A3011F421E001C020E086E8B5
:1015F00093E090938C0380938B0307C0888187FDD1
:101600002E8180E880930E0106C08F81882319F413
:101610008E81821708F0822F8093030111C0809180
:101620000E0187FF0DC0CE010E948E098F3F21F46D
:101630008EE18093020104C0882311F0109203010F
:1016400010928D038091020184FF46C080910301B6
:101650008F3F09F441C0182F893008F018E0811B32
:101660008093030180917D0398E8892780937D030F
:10167000112321F120918B0330918C0380910E0175
:1016800086FF0AC0912FF901AEE7B3E084918D93F4
:1016900031969150D9F708C0912FD901EEE7F3E0C8
:1016A0008D9181939150E1F7C90101961150810FFD
:1016B000911D1F5F90938C0380938B038EE793E0C3
:1016C000612F0E948F0B612F6C5F6C3019F08FEFD0
:1016D000809303016093020194E189B1847131F434
:1016E0009150D9F710928E0310928803DF91CF9119
:1016F0001F910895A82FB92F80E090E041E050EAB3
:10170000609530E009C02D9182279795879510F05C
:1017100084279527305EC8F36F5FA8F30895EADF4A
:101720008D939D930895CF93CFB7CF93DF93C395B8
:101730004C9BE9F74C9B0BC04C9B09C04C9B07C0D2
:101740004C9B05C04C9B03C04C9B01C089C06F9350
:10175000C0918A03DD27CF56DC4F2F9365E54C9B64
:1017600003C02F916F91E6CF0F931F934F9320E00B
:1017700040E15F9309B1047104FB27F93F9350E006
:101780003BE039C0147140642F77012F5F5F1EC0AA
:10179000406819B114712F7752501FC0406409B1CD
:1017A0002F770471D1F15F5F00C023C0406219B18F
:1017B0002F77147191F15F5F00C025C0047110276D
:1017C000515012F45D5F0000115027952C3F19B164
:1017D000C8F614710127015027952C3FC8F64227FF
:1017E000499309B1047110274F73115027952C3F6D
:1017F000A8F64695469519B1147179F00127015064
:1018000027952C3F98F66B5A60F3315009B1B0F62A
:1018100000C011E01CBB002717C03B503195C31B13
:10182000D04011E01CBB0881033CF9F00B34E9F017
:10183000209188031981110F1213EDCF093651F150
:101840000D3211F0013E39F700938F033F915F9104
:101850004F911F910F912F916F91CCB3C0FD67CF26
:10186000DF91CF91CFBFCF91189520918F03222385
:1018700069F310918D03112339F534303AF1309327
:101880008D032093890310918A033BE0311B309331
:101890008A031CC000918D030130B4F40AE5309135
:1018A000020134FD14C000930201CDE7D3E013C060
:1018B000052710E000C000000BB91AC0052710E092
:1018C000221F1DC010E021C04AE502C032ED432FA7
:1018D000C4E1D0E032E01AB114615C9A0BB11AB9DC
:1018E00054E120E865E320FF05270BB927951795FC
:1018F0001C3FF0F66695B8F7B1F720FF05270BB946
:10190000279517951C3FD0F62795179517FF0527A4
:1019100000001C3F0BB9B0F629913A9519F70B7EE0
:1019200010918E03110FC651D0400BB911F01093D6
:10193000880311E01CBB00611AB11B7E402F4B7E57
:1019400054E05A95F1F70BB91AB94BB97FCFF89417
:02195000FFCFC7
:0419520064035AFFD1
:00000001FF

View File

@ -320,8 +320,7 @@ uint8_t * buffer_payload( setup_packet *spacket, buffer *buff, uint8_t hostsetbu
//if buffer number not designated by host buffer.c gets to decide
if ( hostsetbuff == FALSE ) {
//buffer.c gets to decide buffer in use
//TODO implement some fancy double buffering code
//for now just designate buffer 0
//buffer manager sets cur_buff
if ( endpoint == ENDPOINT_IN) {
//reads
if ( cur_buff->status == DUMPED ) {
@ -330,7 +329,6 @@ uint8_t * buffer_payload( setup_packet *spacket, buffer *buff, uint8_t hostsetbu
} else {
//problem, buffers not prepared or initialized
*rlength = USB_NO_MSG;
//operation = PROBLEM;
set_operation( PROBLEM );
}
} else {//writes
@ -339,7 +337,6 @@ uint8_t * buffer_payload( setup_packet *spacket, buffer *buff, uint8_t hostsetbu
cur_usb_load_buff = cur_buff;
cur_buff->status = USB_LOADING;
} else {
//operation = PROBLEM;
set_operation( PROBLEM );
}
}
@ -358,8 +355,8 @@ uint8_t * buffer_payload( setup_packet *spacket, buffer *buff, uint8_t hostsetbu
}
//now only thing left to do is stuff 2 bytes from setup packet into the buffer if designated by the opcode
if ( (spacket->opcode == BUFF_OUT_PAYLOAD_2B_INSP)
||(spacket->opcode == BUFF_OUT_PAYLOADN_2B_INSP) ) {
if ( (cur_buff->status == USB_LOADING) &&
((spacket->opcode == BUFF_OUT_PAYLOAD_2B_INSP)||(spacket->opcode == BUFF_OUT_PAYLOADN_2B_INSP)) ) {
//operandMSB:LSB actually contains first 2 bytes
//these two bytes don't count as part of transfer OUT byte count
//but they do count as part of buffer's byte count.
@ -634,7 +631,6 @@ void update_buffers()
//this manager only needs to know which buffers are active
//but the host sets operation when it wants this manager to send
//little buffers out to start dumping/flashing
//if ( (operation == STARTDUMP) || (operation == STARTFLASH ) ) {
if ( (get_operation() == STARTDUMP) || (get_operation() == STARTFLASH ) ) {
//only want to do this once per operation at the start
//figure out how many buffers are in operation
@ -647,7 +643,6 @@ void update_buffers()
//now we can get_next_buff by passing cur_buff
}
//if (operation == STARTDUMP) {
if (get_operation() == STARTDUMP) {
//prepare both buffers to dump
@ -666,7 +661,6 @@ void update_buffers()
//operation = DUMPING;
set_operation( DUMPING );
}
//if (operation == STARTFLASH) {
if (get_operation() == STARTFLASH) {
//don't want to reenter start initialiation again
//operation = FLASHING;
@ -685,7 +679,6 @@ void update_buffers()
}
//this will get entered on first and all successive calls
//if ( operation == DUMPING ) {
if ( get_operation() == DUMPING ) {
//buffer_payload will pass cur_buff to usb driver on next IN transfer
//on receipt of the IN transfer buffer_payload sets:
@ -713,13 +706,13 @@ void update_buffers()
}
//if ( operation == FLASHING ) {
if ( get_operation() == FLASHING ) {
//cur_buff will get sent to usbFunctionWrite on next payload OUT transfer
//All we need to do here is monitor usbFWr's status via incoming_bytes_remain
//which gets set to 254 on wr transfers once gets to zero buffer is filled
if ( incoming_bytes_remain == 0 ) {
if ( (incoming_bytes_remain == 0) && (cur_buff->status != EMPTY) ) {
incoming_bytes_remain--; //don't want to re-enter
//if ( cur_buff->status == USB_FULL) {
//buffer full, send to flash routine
last_buff = cur_buff;
@ -729,12 +722,13 @@ void update_buffers()
cur_buff->status = EMPTY;
last_buff->status = FLASHING;
//last_buff->cur_byte = 0;
result = flash_buff( last_buff );
if (result != SUCCESS) {
last_buff->status = result;
} else {
last_buff->status = FLASHED;
cur_buff->page_num += cur_buff->reload;
last_buff->page_num += last_buff->reload;
}
//page should be flashed to memory now
//the next buffer should be in process of getting filled

View File

@ -3,11 +3,12 @@
uint8_t write_page( uint8_t bank, uint8_t addrH, buffer *buff, write_funcptr wr_func, read_funcptr rd_func )
{
uint8_t i = buff->cur_byte;
uint16_t cur = buff->cur_byte;
uint8_t n = buff->cur_byte;
uint8_t read;
extern operation_info *oper_info;
do {
while ( cur <= buff->last_idx ) {
//write unlock sequence
//need to make address and unlock data variable
//best for host to communcate these values
@ -31,17 +32,21 @@ uint8_t write_page( uint8_t bank, uint8_t addrH, buffer *buff, write_funcptr wr_
wr_func( oper_info->unlock2_AH, oper_info->unlock2_AL, oper_info->unlock2_data );
//wr_func( 0x55, 0x55, 0xA0 );
wr_func( oper_info->command_AH, oper_info->command_AL, oper_info->command1_data );
wr_func( addrH, i, buff->data[i] );
wr_func( addrH, n, buff->data[n] );
do {
usbPoll();
read = rd_func( addrH, i );
read = rd_func( addrH, n );
} while( read != rd_func( addrH, i) );
} while( read != rd_func( addrH, n) );
//TODO verify byte is value that was trying to be flashed
//move on to next byte
i++;
} while ( i != buff->last_idx );
n++;
cur++;
}
buff->cur_byte = n;
return SUCCESS;

View File

@ -306,18 +306,20 @@ USB_PUBLIC uchar usbFunctionWrite(uchar *data, uchar len) {
//update counters and status
cur_usb_load_buff->cur_byte += len;
incoming_bytes_remain -= len;
usbWrite_status = SUCCESS;
//usbWrite_status = SUCCESS;
//want this function to be as fast as possible, so buffer.c checks if
//the buffer is full 'behind the scenes' outside of this function.
if ( (cur_usb_load_buff->last_idx) == buf_cur) {
//if ( (cur_usb_load_buff->last_idx) == buf_cur) {
if ( cur_usb_load_buff->last_idx == cur_usb_load_buff->cur_byte ) {
//this signals to buffer.c so it can update cur_usb_load_buf
//and start tasking this buffer to programming
cur_usb_load_buff->status = USB_FULL;
}
if ( incoming_bytes_remain == 0 ) { //done with OUT transfer
cur_usb_load_buff->status = USB_FULL;
return PAYLD_DONE;
} else { //more data packets remain to complete OUT transfer
return NOT_DONE;

Binary file not shown.

View File

@ -166,7 +166,8 @@ int payload_out( USBtransfer *transfer, uint8_t *data, int length )
if ( length > MAX_VUSB ) {
return dictionary_call( transfer, DICT_BUFFER, BUFF_OUT_PAYLOAD_2B_INSP,
//byte0, byte1, bytes3-254
data[0], data[1], USB_OUT, &data[2], length-2);
//data[0], data[1], USB_OUT, &data[2], length-2);
((data[0]<<8) | data[1]), NILL, USB_OUT, &data[2], length-2);
} else {
return dictionary_call( transfer, DICT_BUFFER, BUFF_PAYLOAD,
NILL, NILL, USB_OUT, data, length);

View File

@ -2,10 +2,9 @@
int erase_nes( USBtransfer *transfer )
{
//uint8_t rv[8];
uint8_t rv[8];
//int i = 0;
return 0;
debug("erasing_nrom");
@ -13,6 +12,7 @@ return 0;
nes_init(transfer);
debug("erasing PRG-ROM");
dictionary_call_debug( transfer, DICT_NES, DISCRETE_EXP0_PRGROM_WR, 0x5555, 0xAA, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, DISCRETE_EXP0_PRGROM_WR, 0x2AAA, 0x55, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, DISCRETE_EXP0_PRGROM_WR, 0x5555, 0x80, USB_IN, NULL, 1);
@ -21,24 +21,30 @@ return 0;
dictionary_call_debug( transfer, DICT_NES, DISCRETE_EXP0_PRGROM_WR, 0x5555, 0x10, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, NULL, 2);
do {
dictionary_call( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0, USB_IN, rv, 2);
printf("%x, ",rv[1]);
}
while ( rv[1] != 0xFF);
printf("\n done erasing prg.\n");
debug("erasing CHR-ROM");
dictionary_call_debug( transfer, DICT_NES, NES_PPU_WR, 0x1555, 0xAA, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_WR, 0x0AAA, 0x55, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_WR, 0x1555, 0x80, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_WR, 0x1555, 0xAA, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_WR, 0x0AAA, 0x55, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_WR, 0x1555, 0x10, USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x0000, 0, USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x0000, 0, USB_IN, NULL, 2);
do {
dictionary_call( transfer, DICT_NES, NES_PPU_RD, 0x0000, 0, USB_IN, rv, 2);
printf("%x, ",rv[1]);
}
while ( rv[1] != 0xFF);
printf("\n done erasing chr.\n");
//dictionary_call( transfer, IO, IO_RESET, 0, 0);
//dictionary_call( transfer, IO, NES_INIT, 0, 0);

View File

@ -53,6 +53,21 @@ int flash_cart( USBtransfer* transfer, rom_image *rom, cartridge *cart )
nes_init( transfer );
//Run some CRC's to determine size of memories
//start operation at reset
check(! set_operation( transfer, RESET ), "Unable to set buffer operation");
//setup buffers and manager
//reset buffers first
check(! reset_buffers( transfer ), "Unable to reset device buffers");
//need to allocate some buffers for flashing
//2x 256Byte buffers
check(! allocate_buffers( transfer, num_buffers, buff_size ), "Unable to allocate buffers");
//tell buffers what function to use for flashing
//load operation elements into buff0 and then copy buff0 to oper_info
load_oper_info_elements( transfer, cart );
get_oper_info_elements( transfer );
//setup buffers and manager
//reset buffers first
check(! reset_buffers( transfer ), "Unable to reset device buffers");
@ -71,25 +86,15 @@ int flash_cart( USBtransfer* transfer, rom_image *rom, cartridge *cart )
check(! set_map_n_mapvar( transfer, buff0, NROM, NILL ), "Unable to set mapper and map_var");
check(! set_map_n_mapvar( transfer, buff1, NROM, NILL ), "Unable to set mapper and map_var");
//tell buffers what function to use for flashing
//TODO when start implementing other mappers
//debugging print out buffer elements
get_operation( transfer );
get_buff_elements( transfer, buff0 );
get_buff_elements( transfer, buff1 );
//load operation elements into buff0 and then copy buff0 to oper_info
load_oper_info_elements( transfer, cart );
get_oper_info_elements( transfer );
debug("\n\nsetting operation STARTFLASH");
//inform buffer manager to start dumping operation now that buffers are initialized
check(! set_operation( transfer, STARTFLASH ), "Unable to set buffer operation");
// get_operation( transfer );
// get_buff_elements( transfer, buff0 );
// get_buff_elements( transfer, buff1 );
// //manager updates buffer status' so they'll start dumping
// //once they're full manager prepares them to be read back on USB payloads
// //once the next payload request happens manager knows last buffer can start dumping again
@ -120,6 +125,32 @@ int flash_cart( USBtransfer* transfer, rom_image *rom, cartridge *cart )
tstart = clock();
//now just need to call series of payload IN transfers to retrieve data
for( i=0; i<(32*KByte/buff_size); i++) {
//for( i=0; i<8; i++) {
//debug("\n\npayload out #%d", i);
//get_operation( transfer );
get_buff_elements( transfer, buff0 );
get_buff_elements( transfer, buff1 );
check(! read_from_file( rom, data, buff_size ), "Error with file read");
check(! payload_out( transfer, data, buff_size ), "Error with payload OUT");
//if ( i % 256 == 0 ) debug("payload in #%d", i);
if ( i % 32 == 0 ) debug("payload out #%d", i);
}
get_operation( transfer );
get_buff_elements( transfer, buff0 );
get_buff_elements( transfer, buff1 );
get_buff_elements( transfer, buff0 );
get_buff_elements( transfer, buff1 );
get_buff_elements( transfer, buff0 );
get_buff_elements( transfer, buff1 );
debug("payload done");
//end operation at reset
check(! set_operation( transfer, RESET ), "Unable to set buffer operation");
/*
//for( i=0; i<(512*KByte/buff_size); i++) {
for( i=0; i<(32*KByte/buff_size); i++) {
//for( i=0; i<(8*KByte/buff_size); i++) {
@ -164,6 +195,7 @@ int flash_cart( USBtransfer* transfer, rom_image *rom, cartridge *cart )
if ( i % 32 == 0 ) debug("payload out #%d", i);
}
debug("payload done");
*/
//close file in main

View File

@ -269,6 +269,24 @@ int main(int argc, char *argv[])
rom->fileptr = NULL;
debug("closed");
}
//if flashing, determine if erasures are necessary and where
//erase required sectors of flash
//forced to erase board regardless of current status
//if (e_flag || p_value) {
if (e_flag) {
erase_nes( transfer );
}
//if flashing determine auto-doubling for oversized flash
//determine if rom can be flashed in a manner to make board compatible with rom
//ie CNROM/colordreams can be over flashed to play NROM
//BNROM can be overflashed to simulate UNROM
//SUROM can be overflashed to run as SNROM
//determine if snes input rom needs deinterleaved
if ( p_value ) {
//program file provided at commandline
@ -283,23 +301,6 @@ int main(int argc, char *argv[])
debug("closed");
}
//if flashing, determine if erasures are necessary and where
//erase required sectors of flash
//forced to erase board regardless of current status
if (e_flag || p_value) {
// erase_nes( transfer );
}
//if flashing determine auto-doubling for oversized flash
//determine if rom can be flashed in a manner to make board compatible with rom
//ie CNROM/colordreams can be over flashed to play NROM
//BNROM can be overflashed to simulate UNROM
//SUROM can be overflashed to run as SNROM
//determine if snes input rom needs deinterleaved
//dump or program data based on user args

View File

@ -10,7 +10,7 @@ int load_oper_info_elements( USBtransfer *transfer, cartridge *cart )
uint8_t rv[RETURN_BUFF_SIZE];
uint8_t buff_num = 0; //buffer used to load elements according to shared_dict_operation.h
uint8_t oper_info[OPER_DATA_NUM_BYTE_ELEMENTS];
int i;
// int i;
//first make sure buff0 is big enough
dictionary_call_debug( transfer, DICT_BUFFER, GET_PRI_ELEMENTS, NILL, buff_num,

View File

@ -10,6 +10,26 @@ int test_function( cartridge *cart, USBtransfer *transfer )
NULL, 1);
debug("io reset and nes init'd");
/*
dictionary_call( transfer, DICT_PINPORT, PRGRW_RD, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ADDR16_SET, 0x00AA, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_HI, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call_debug( transfer,DICT_PINPORT, DATA_RD, 0, 0, USB_IN, NULL, 2);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_HI, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, PRGRW_RD, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ADDR16_SET, 0x0055, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_HI, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call_debug( transfer,DICT_PINPORT, DATA_RD, 0, 0, USB_IN, NULL, 2);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_HI, 0, 0, USB_IN, NULL, 1);
*/
/*
//spansion/cypress A18-11 are don't care, that translates to A19-12 for byte mode I think
//$AAA / AA
@ -23,22 +43,37 @@ int test_function( cartridge *cart, USBtransfer *transfer )
USB_IN, NULL, 1);
*/
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0,
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x0000, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8002, 0,
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x0055, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x00AA, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, EMULATE_NES_CPU_RD, 0x8000, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, EMULATE_NES_CPU_RD, 0x8002, 0,
USB_IN, NULL, 2);
//RESET write F0 anywhere
// dictionary_call( transfer, DICT_NES, NES_CPU_WR, 0x8000, 0xF0,
// USB_IN, NULL, 1);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8000, 0,
dictionary_call_debug( transfer, DICT_NES, EMULATE_NES_CPU_RD, 0x8000, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8002, 0,
dictionary_call_debug( transfer, DICT_NES, EMULATE_NES_CPU_RD, 0x8002, 0,
USB_IN, NULL, 2);
//Read what we're looking to flash
dictionary_call_debug( transfer, DICT_NES, EMULATE_NES_CPU_RD, 0x80AA, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, EMULATE_NES_CPU_RD, 0x8055, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x80AA, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x8055, 0,
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x0055, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_CPU_RD, 0x80AA, 0,
USB_IN, NULL, 2);
dictionary_call_debug( transfer, DICT_NES, NES_PPU_RD, 0x00AA, 0,
USB_IN, NULL, 2);
/*
@ -55,6 +90,25 @@ int test_function( cartridge *cart, USBtransfer *transfer )
USB_IN, NULL, 1);
*/
/*
dictionary_call( transfer, DICT_PINPORT, PRGRW_RD, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ADDR16_SET, 0x00AA, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_HI, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call_debug( transfer,DICT_PINPORT, DATA_RD, 0, 0, USB_IN, NULL, 2);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_HI, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, PRGRW_RD, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ADDR16_SET, 0x0055, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, M2_HI, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call_debug( transfer,DICT_PINPORT, DATA_RD, 0, 0, USB_IN, NULL, 2);
dictionary_call( transfer, DICT_PINPORT, M2_LO, 0, 0, USB_IN, NULL, 1);
dictionary_call( transfer, DICT_PINPORT, ROMSEL_HI, 0, 0, USB_IN, NULL, 1);
*/
/*
dictionary_call_debug( transfer, DICT_IO, IO_RESET, 0, 0, USB_IN,
NULL, 1);
@ -496,6 +550,9 @@ int test_function( cartridge *cart, USBtransfer *transfer )
// dictionary_call( transfer, NES, NES_CPU_RD, 0x8000, 0);
// dictionary_call( transfer, NES, NES_CPU_RD, 0x8000, 0);
dictionary_call( transfer, DICT_IO, IO_RESET, 0, 0, USB_IN,
NULL, 1);
return 0;
//error:

View File

@ -161,8 +161,8 @@
//rv5: id
#define BUFF_ID 5
//rv76: page_num
#define BUFF_PGNUM_MSB 7
#define BUFF_PGNUM_LSB 6
#define BUFF_PGNUM_MSB 7
//return buffer elements