| Auteur | Bericht |
|---|
Kripton2035
Lid geworden: 19 juli 2001 Posts: 482 Geholpen: 15 Locatie: Aarde
| 03 april 2006 8:28 Re: Project ter vervanging CY7C64613 in de ICD2 | | |
|
| | predrage schreef: | Mijn vrienden heb ik niet slagen in de programmering ICD2_4550_BOOT_0180.BIN in 4550. I'v probeerde te openen bin bestand met winpic 800 software, maar deze mislukt. Ik tryed te openen met de optie "alle files" in "bestandstypen" omdat er geen directe ondersteuning voor bin-bestanden. ICprog hebben dat ondersteuning (om bin-bestanden), maar kan geen programma 4550. In feite is er geen 4550 in Apparaatbeheer lijst. Wat moet ik doen? Eventuele suggesties? Ik ben net een beginner, maar ik heb goede wil om te helpen. Sorry voor mijn slechte Engels. |
de naam van het. BIN is. HEX en winpic zullen openen! soms veel bestanden zijn. BIN in werkelijkheid zijn Intel. hex! om zeker te zijn, open het bestand met notepad, indien het bevat regels die beginnen met ":" dan hernoemen naar. hex en open deze met winpic .. als het vuilnis, dan is een bin2hex moeten worden gebruikt om het te openen. |
|
| Terug naar boven | |
 |
narccizzo
Lid geworden: 20 januari 2006 Posts: 173 Geholpen: 4 Locatie: PATZCUARO, Michoacán, MEXICO
| 03 april 2006 9:42 Re: Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Dit zijn de twee bestanden bin omgezet in hex heb ik opende de bin bestanden met de ic-prog software dan sla ik de bestanden in hex-formaat, als je kijkt naar deze bestanden kunt u een leesbare string "Microchip Tecnology ICD2 USB Device icd2 usb" in het adres 0x0ee7 voor de boot.hex bestand en dezelfde string in de 0x0b8e voor de os.hex bestand, i dont hebben een disassembler om meer in detail deze bestanden, maar iets zegt me dat deze twee bestanden zijn allen dat we nodig hebben.
BR Narccizzo
|
|
| Terug naar boven | |
 |
Jay.slovak
Lid geworden: 23 maart 2006 Posts: 11
| 03 april 2006 11:17 Re: Project ter vervanging CY7C64613 in de ICD2 | | |
|
| | narccizzo schreef: | Dit zijn de twee bestanden bin omgezet in hex heb ik opende de bin bestanden met de ic-prog software dan sla ik de bestanden in hex-formaat, als je kijkt naar deze bestanden kunt u een leesbare string "Microchip Tecnology ICD2 USB Device icd2 usb" in het adres 0x0ee7 voor de boot.hex bestand en dezelfde string in de 0x0b8e voor de os.hex bestand, i dont hebben een disassembler om meer in detail deze bestanden, maar iets zegt me dat deze twee bestanden zijn allen dat we nodig hebben.
BR Narccizzo |
Weet u zeker dat u de geconverteerde bestanden correct? Als ik importeren in MPLAB, de code is niet zinvol, alles in het werk doet, is gewoon via het Programma geheugen en doet NOPs. Niets nuttig gebeurt in beide Boot en OS HEXs. Zelfs config bits verschillend zijn in beide files! |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 03 april 2006 11:19 Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Albert,
de kernel driver (s) verwachten, de cipres zal aansluiten op een andere vid / pid wanneer firt aangesloten, en na de lader sys downloads is het fw zal opnieuw als een andere vid / pid, zodat de andere sys gesprekken aan. We hebben voor de uitvoering van alleen de tweede. Iam @ werk dus ik kan niets doen hier verwachten hard denken ... |
|
| Terug naar boven | |
 |
silvio
Lid geworden: 31 december 2001 Posts: 800 Geholpen: 90
| 03 april 2006 11:31 Re: Project ter vervanging CY7C64613 in de ICD2 | | | tags: mplab protocol icd2 cipres disassembler disassembler cipres |
|
| Hi Zedman,
it's a must to understand what's under cover. Wat CY hex bestand het is niet alleen een kwestie van goede disassembler die kent de cipres chip, maar lezing van 436 pagina's EZ-USB-FX TechRefManual het is een must om te begrijpen wat er onder dekking. En ik denk niet dat je hebt tijd voor. Echter, als u niet vertrouwd bent met 8051 opcodes, parseren van de code zal enige tijd in beslag nemen. (Ik weet dat u bekend bent met PIC-structuren) with appropiate values from CY7C64613 registers 0x7800-0x7FFF but you'll definitely end up turning the pages of TechRefManual looking for definitions. Ik kan vervangen alle het vóórkomen van MOV DPTR, # LXXXX met de juiste waarden uit CY7C64613 registers 0x7800-0x7FFF maar u zult zeker uiteindelijk draaien de pagina's van TechRefManual op zoek naar definities. Behalve dat het aantal hoe moeilijk het toewijzen van bits namen die zijn ingesteld of duidelijk in het programma, zolang ze niet in kaart gebracht SFR ruimte (dat eindigt op 0 of 8). with MOV DPTR, #EP0CS but it's difficult to say SETB HSNAK due to the above reasons. Het is gemakkelijk te vervangen MOV DPTR, # L7FB4 met MOV DPTR, # EP0CS maar het is moeilijk te zeggen SETB HSNAK vanwege de bovengenoemde redenen.
and EP0STAL L which are affected in the bellow code at 0x03E2. Laten we het voorbeeld nemen bits HSNAK en EP0STAL L die zijn getroffen in het geloei code op 0x03E2. | Code: | L03E2: LCALL L0FBE JNC L03EE MOV DPTR, # L7FB4 MOVX A, @ DPTR KNO-A, # 01h; een soort SETB EP0STALL MOVX @ DPTR, A L03EE: MOV DPTR, # L7FB4 MOVX A, @ DPTR KNO-A, # 02u; een soort SETB HSNAK MOVX @ DPTR, A RET
L0FBE: SETB C RET
|
Neem bijvoorbeeld (CP_1.asm) de code regels die beginnen met gecompenseerd 0x0100 (een subroutine aangeroepen vanuit 0x05FA), de eerste code regel gebruikt immediatelly blaten vector onderbreken tabel Op RAM 0x7FE9 vindt u 2e byte van de 8 bytes USB SETUP packet-gegevens (zie pagina 215 table9-1), zin bRequest gebied (zie tabel 9-2).
| Code: | L0100: MOV DPTR, # L7FE9 MOVX A, @ DPTR JNZ L0109 LJMP L029B; indien bRequest = GetStatus naar 0x029B L0109: DEC A JNZ L010F LJMP L0317; indien bRequest = Wissen Feature, naar 0x0317 L010F: ADD A, # 0FEh JNZ L0116 LJMP L038E; indien bRequest = Set Feature, naar 0x038E L0116: ADD A, # 0FBh JNZ L011D LJMP L0295; indien bRequest = Get Configuration, naar 0x0295 L011D: DEC A JNZ L0123 LJMP L028F; indien bRequest = Set Configuration, naar 0x028F L0123: DEC A JNZ L0129 LJMP L0283; indien bRequest = Get Interface, naar 0x0283 L0129: DEC A JNZ L012F LJMP L0289; indien bRequest = Set Interface, naar 0x0289 L012F: ADD A, # 05h JZ L0136 LJMP L03E2; indien bRequest = geen van de bovenstaande, vervolgens bits HSNAK ; en EP0STALL van EP0CS Control & status register en , vandaar RET op 0x05FD ; L0136: LCALL L0F7A; indien bRequest = Get Descriptor, LCALL 0x0F7A waar JC L013E; carry bit is standaard ingesteld, dus ga naar 0x013E LJMP L03EE; indien ten 0x0F7A voeren zou 0 standaard set bit HSNAK ; van EP0CS controle & status register en RET op 0x05FD ; L013E: MOV DPTR, # L7FEB; hier omdat bRequest was een Get Descriptor MOVX A, @ DPTR, dus controleer de WValueH gebied van USB SETUP pakket ADD A, # 0FEh JZ L015F; indien wValueH werd 0x02 Ga naar 0x015F DEC A JZ L0190; indien wValueH werd 0x03 Ga naar 0x0190 ADD A, # 02u JZ L0150; indien wValueH werd waarde 0x01 Ga naar 0x0150 LJMP L0279; indien wValueh is verschillend van een waarde 0x01 of 0x02 of 0x03 vervolgens ; bits HSNAK en EP0STALL van EP0CS registreren en RET op 0x05FD ; L0150: MOV A, 0Ch; hier omdat wValueH werd waarde 0x01, dus belasting SUDPTR mondiale USB registreren MOV DPTR, # L7FD4; met waarde 0x0C0D, vervolgens beetje HSNAK van EP0CS en RET op 0x05FD MOVX @ DPTR, A MOV A, 0DH MOV DPTR, # L7FD5 MOVX @ DPTR, A LJMP L03EE L015F: MOV DPTR, # L7FEA; kijk nu op wValueL gebied van USB SETUP pakket ; ; ; ; , en zo verder ...................
|
port2: Microchip MPLAB ICD2 Fw client Of dit opzoektabel te compenseren 0x0622 die overeenkomen met de Kripton2035 port2: Microchip MPLAB ICD2 Fw cliënt
| Code: | Tabel 5-9. Standaard USB Device Descriptor
RAM Prijs Offset Veld Beschrijving
0622 0x12 0 bLength Lengte van dit Descriptor = 18 bytes 0623 waarde 0x01 1 bDescriptorType Descriptor Type = Apparaat 0624 0x00 2 bcdUSB (L) USB Specification Version 1.10 (L) 0625 waarde 0x01 3 bcdUSB (H) USB Specification Version 1.10 (H) 0626 0xFF 4 bDeviceClass Device Class (FF is Vendor-specifieke) 0627 0xFF 5 bDeviceSubClass Device Sub-Class (FF is Vendor-specifieke) 0628 0xFF 6 bDeviceProtocol Device Protocol (FF is Vendor-specifieke) 0629 0x40 7 bMaxPacketSize0 maximumpakketgrootte voor EP0 = 64 bytes 062A 0xD8 8 idVendor (L) Vendor ID (L) Microchip Technology = 04D8H 062B 0x04 9 idVendor (H) Vendor ID (H) 062C waarde 0x01 10 idProduct (L) Product ID (L) ICD2 = 8001H 062D 0x80 11 idProduct (H) Product ID (H) 062E 0x03 12 bcdDevice (L) Apparaat Release Number (BCD, L) 062F 0x00 13 bcdDevice (H) Apparaat Release Number (BCD, H) 0630 0x00 14 iManufacturer Fabrikant Index String = Geen 0631 0x00 15 iProduct Product Index String = Geen 0632 0x00 16 iSerialNumber Serienummer Index String = Geen 0633 waarde 0x01 17 bNumConfigurations Aantal Configuraties in dit Interface = 1
Tabel 5-10. USB-standaard configuratie Descriptor
RAM Prijs Offset Veld Beschrijving
0634 0x09 0 bLength Lengte van dit Descriptor = 9 bytes 0635 0x02 1 bDescriptorType Descriptor Type = Configuratie 0636 0x74 2 wTotalLength (L) Totale lengte (L) Inclusief Interface en eindpunt Descriptoren = 116 0637 0x00 3 wTotalLength (H) Totale lengte (H) 0638 waarde 0x01 4 bNumInterfaces aantal interfaces in deze configuratie 0639 waarde 0x01 5 bConfigurationValue Configuratie Prijs Gebruikt door Set_Configuration Verzoek om Selecteer deze configuratie 063A 0x00 6 iConfiguration Index String beschrijven deze configuratie = Geen 063B 0x80 7 bmAttributes Attributen - Bus-Powered, nr. Wakeup 063C 0x4B 8 MaxPower Maximum Power - 150 mA
Tabel 5.11. USB-standaard interface 0, Alternate Kader 0 Descriptor
RAM Prijs Offset Veld Beschrijving
063D 0x09 0 bLength Lengte van het Interface Descriptor 063E 0x04 1 bDescriptorType Descriptor Type = Interface 063F 0x00 2 bInterfaceNumber Zero-based Index van deze interface = 0 0640 0x00 3 bAlternateSetting Afwisselende instellen Prijs = 0 0641 0x0E 4 bNumEndpoints Aantal eindpunten in dit Interface (Niet Counting EOB) = 14 0642 0xFF 5 bInterfaceClass Interface Class = Vendor Specifieke 0643 0xFF 6 bInterfaceSubClass Interface Sub-class = Vendor Specifieke 0644 0xFF 7 bInterfaceProtocol Interface protocol = Vendor Specifieke 0645 0x00 8 iInterface Index op Tekenreekswaarde descriptor voor deze interface = Geen
Tabel 5-14. Standaard interface 0, Alternate Kader 1, Bulk Endpoint Descriptoren
RAM Prijs Offset Veld Beschrijving
0646 0x07 0 bLength Lengte van dit eindpunt Descriptor 0647 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0648 waarde 0x01 2 bEndpointAddress Endpoint Richting (1 is) en Adres = OUT1 0649 0x02 3 bmAttributes XFR Type = BULK 064A 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 064B 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 064C waarde 0x01 6 bInterval Polling Interval in milliseconden
064D 0x07 0 bLength Lengte van dit eindpunt Descriptor 064E 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 064F 0x02 2 bEndpointAddress Endpoint Richting (1 is) en Adres = OUT2 0650 0x02 3 bmAttributes XFR Type = BULK 0651 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0652 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0653 waarde 0x01 6 bInterval Polling Interval in milliseconden
0654 0x07 0 bLength Lengte van dit eindpunt Descriptor 0655 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0656 0x03 2 bEndpointAddress Endpoint Richting (1 is) en adres = OUT3 0657 0x02 3 bmAttributes XFR Type = BULK 0658 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0659 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 065A waarde 0x01 6 bInterval Polling Interval in milliseconden
065B 0x07 0 bLength Lengte van dit eindpunt Descriptor 065C 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 065D 0x04 2 bEndpointAddress Endpoint Richting (1 is) en adres = OUT4 065E 0x02 3 bmAttributes XFR Type = BULK 065F 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0660 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0661 waarde 0x01 6 bInterval Polling Interval in milliseconden
0662 0x07 0 bLength Lengte van dit eindpunt Descriptor 0663 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0664 0x05 2 bEndpointAddress Endpoint Richting (1 is) en adres = OUT5 0665 0x02 3 bmAttributes XFR Type = BULK 0666 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0667 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0668 waarde 0x01 6 bInterval Polling Interval in milliseconden
0669 0x07 0 bLength Lengte van dit eindpunt Descriptor 066A 0x05 1 bDescriptor Type Descriptor Type = eindpunt 066B 0x06 2 bEndpointAddress Endpoint Richting (1 is) en adres = OUT6 066C 0x02 3 bmAttributes XFR Type = BULK 066D 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 066E 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 066F waarde 0x01 6 bInterval Polling Interval in milliseconden
0670 0x07 0 bLength Lengte van dit eindpunt Descriptor 0671 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0672 0x07 2 bEndpointAddress Endpoint Richting (1 is) en adres = OUT7 0673 0x02 3 bmAttributes XFR Type = BULK 0674 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0675 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0676 waarde 0x01 6 bInterval Polling Interval in milliseconden
RAM Prijs Offset Veld Beschrijving
0677 0x07 0 bLength Lengte van dit eindpunt Descriptor 0678 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0679 0x81 2 bEndpointAddress Endpoint Richting (1 is) en Adres = IN1 067A 0x02 3 bmAttributes XFR Type = BULK 067B 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 067C 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 067D waarde 0x01 6 bInterval Polling Interval in milliseconden
067E 0x07 0 bLength Lengte van dit eindpunt Descriptor 067F 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0680 0x82 2 bEndpointAddress Endpoint Richting (1 is) en Adres = IN2 0681 0x02 3 bmAttributes XFR Type = BULK 0682 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0683 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0684 waarde 0x01 6 bInterval Polling Interval in milliseconden
0685 0x07 0 bLength Lengte van dit eindpunt Descriptor 0686 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0687 0x83 2 bEndpointAddress Endpoint Richting (1 is) en Adres = IN3 0688 0x02 3 bmAttributes XFR Type = BULK 0689 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 068A 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 068B waarde 0x01 6 bInterval Polling Interval in milliseconden
068C 0x07 0 bLength Lengte van dit eindpunt Descriptor 068D 0x05 1 bDescriptor Type Descriptor Type = eindpunt 068E 0x84 2 bEndpointAddress Endpoint Richting (1 is) en adres = IN4 068F 0x02 3 bmAttributes XFR Type = BULK 0690 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0691 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0692 waarde 0x01 6 bInterval Polling Interval in milliseconden
0693 0x07 0 bLength Lengte van dit eindpunt Descriptor 0694 0x05 1 bDescriptor Soort Descriptor Type = eindpunt 0695 0x85 2 bEndpointAddress Endpoint Richting (1 is) en Adres = IN5 0696 0x02 3 bmAttributes XFR Type = BULK 0697 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 0698 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 0699 waarde 0x01 6 bInterval Polling Interval in milliseconden
069A 0x07 0 bLength Lengte van dit eindpunt Descriptor 069B 0x05 1 bDescriptor Type Descriptor Type = eindpunt 069C 0x86 2 bEndpointAddress Endpoint Richting (1 is) en adres = IN6 069D 0x02 3 bmAttributes XFR Type = BULK 069E 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 069F 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 06A0 waarde 0x01 6 bInterval Polling Interval in milliseconden
06A1 0x07 0 bLength Lengte van dit eindpunt Descriptor 06A2 0x05 1 bDescriptor Type Descriptor Type = eindpunt 06A3 0x87 2 bEndpointAddress Endpoint Richting (1 is) en adres = IN7 06A4 0x02 3 bmAttributes XFR Type = BULK 06A5 0x40 4 wMaxPacketSize (L) Maximale Packet Size = 64 Bytes 06A6 0x00 5 wMaxPacketSize (H) maximumpakketgrootte - Hoog 06A7 waarde 0x01 6 bInterval Polling Interval in milliseconden
die wordt dan gevolgd door unicode vorm van nul eindigde string "Microchip Technology ICD2 USB Device"
|
Maar als je vastloopt met 4550 bin, ik kan proberen te helpen door het toevoegen van opmerkingen in de CY asm bestand. |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 03 april 2006 17:10 Re: Project ter vervanging CY7C64613 in de ICD2 | | | tags: icd2.dll |
|
| Hoi Silvio,
Bedankt voor de info, lang geleden moest ik een parse bin-bestand uit een EPROM-chip. Ik heb niet eens niet de processor type noch het circuit. Maar ik moest zoeken hoe het gaat met een geheugenkaart, en het is gegevens. Ik ging ervan uit dat het een soort van 8051 chip en probeerde veel disassemblers, en eindigde met een 80C542 (i cant remember die een was het precies) Ik dacht dat hij uit de poortnummers en hoe de code heeft betrekking op individuele poort pinnen. Maar het duurde 2 weken dag en nacht werken voor mij, veel lezen / debug / leren. Daarom wilde ik een assembler wat er staat te doen wat je gezegd plaats me ...  Nogmaals bedankt Silvio.
-----------------------------
Iam beginnen te geloven dat je alle, volgens bin bestanden. Ik deed een onderzoek in ICD2 dll en ontdekte dat het oproepen GETUSBDESCRIPTOR en controles nummers in de descriptor en indien dit overeenkomt met nieuwere versie ICD2 dan ik dat in mijn 4550's descriptor dan wel een send4550image bellen! En ook zijn er descriptoren in de bin-bestanden identiek zijn aan de ene Kripton geüpload. Een ding begrijp ik niet dat is de reden waarom hebben ze de boot geleverd afbeelding? En waarom ICD2.dll probeert dit bestand downloaden? Als ik thuis ben, zal ik proberen om mijn descriptoren aan de ene vond ik in de bak en zal proberen MPLAB op.
Ik denk dat we steeds dichterbij! 
Toegevoegd na 46 minuten:
En er is een magische ding in de eerste btyes van de boot bin: MCHP (microchip?) Ik heb gezocht naar haar, als het later (na belasting) vervangt deze met echte ingangsadres GOTO of st, maar in de ICD2.dll niet.
Toegevoegd na 3 uur 34 minuten:
Kijk eens naar deze:
Ik deed wat ik al eerder zei, alleen de versie nummer aan de nieuwere hij verwacht en MPLAB probeert te sturen van de OS! (Natuurlijk mijn fw is geen opstartlader)
| Code: | MPLAB ICD 2 Klaarstand Aansluiten op MPLAB ICD 2 ICD0289: Unable to re-program ICD2 USB OS firmware. ICD0021: Unable to connect met MPLAB ICD 2 MPLAB ICD 2 Klaarstand
|
Ergens de opstartlader moeten werken, zal ik proberen iets te doen 's nachts. |
|
| Terug naar boven | |
 |
narccizzo
Lid geworden: 20 januari 2006 Posts: 173 Geholpen: 4 Locatie: PATZCUARO, Michoacán, MEXICO
| 03 april 2006 18:43 Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Hi JaySlovak Nee, Im not sure, ik alleen het openen van de bak en sla het op in hex formaat. |
|
| Terug naar boven | |
 |
Jay.slovak
Lid geworden: 23 maart 2006 Posts: 11
| 03 april 2006 20:45 Re: Project ter vervanging CY7C64613 in de ICD2 | | |
|
| | narccizzo schreef: | Hi JaySlovak Nee, Im not sure, ik alleen het openen van de bak en sla het op in hex formaat.  |
Yep, het is raar als de string is leesbaar, maar de code doet niets |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 03 april 2006 22:25 Re: Project ter vervanging CY7C64613 in de ICD2 | | | tags: icd2.dll |
|
| Goed nieuws na 2 uur debuggen,
ICD2.dll doet zowel van bin bestanden. Het OS-bestand wil downloaden alleen ICD2s met een nieuw product serienummer. Maar wanneer u het versienummer in de bestandsnaam van OS.bin naar * _FFFF.bin dan begint om de bootloader versie bekijken:
| Code: | Aansluiten op MPLAB ICD 2 ICDWarn0062: De USB-Boot firmware van de ICD2 actief is en die de communicatie met de ICD2. Deze firmware is out-of-date is en moet worden bijgewerkt. Het kan niet worden bijgewerkt terwijl actief. Echter, u kan blijven werken met de huidige firmware opstarten als u ervoor kiest om dit te doen. Wilt u doorgaan?
|
Als ik druk op YES hier dan probeert om verbinding te maken met ICD2 zelf, en bevriest (Ik heb alleen de 4550 nog niet geïnstalleerd). Als ik druk op NEE dan lijkt hij probeert bij te werken, maar wij moeten hier een bootloader als dit, dus dit bericht wordt weergegeven:
| Code: | ICD0288: Unable to re-program ICD2 USB Boot firmware. ICD0021: Unable to connect met MPLAB ICD 2 MPLAB ICD 2 Klaarstand
|
Oke jongens, denk denk denk hoe kunnen we gebruik dat bin om een werkgroep in een bootloader 4550!
Toegevoegd na 2 minuten:
Ik heb ook samengesteld monster bootloader met de juiste VID / PID maar kreeg hetzelfde resultaat als met mijn 4550.
Toegevoegd na 16 minuten:
Het kan worden, dat kunnen we niet de eerste oorspronkelijke aanvankelijke:) deel van de bootloader die laadt de eerste bootloader die laadt de os ...
Toegevoegd na 5 minuten:
Dit is het moment waarop rkodaira moet dumpbestand zijn 4550 voor de 0-niveau bootloader. (met een grote hoop, die niet beschermd ...)
Rkodaira WE NEED YOU |
|
| Terug naar boven | |
 |
albert22
Lid geworden: 20 juli 2004 Posts: 95 Geholpen: 3
| 03 april 2006 22:46 Re: Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Ik heb het analyseren van een afdruk die ik heb met me mee van de BL010101. en vind sommige dingen. Het lijkt te aanvaarden 5 opdrachten komen zowel uit de PSP of de USART. 0x55 code uitvoeren vanaf 0x0010. 0x56 Load hex (dit lijkt meer subcommands) 0x5a stuurt de gegevens waarde 0x01 waarde 0x01 0x03 (Versie van het BL??) Twee andere commando's gewoon op de fout en Busy LEDs en hangt in een inffinite lus.
De volgende routines zijn in verband met wat ik de "load hex" commando:
In een andere routinecontrole de BL stuurt de volgende string 0x5b, "0810C9", 0x5d Andere stuurt embeded antwoorden in de volgende string 0x5b, "0A000", U, 0x31, U, 0x5d. (indien U lijkt 0x31, 0x34, 0x36 en 0x37).
I didnt hebben veel tijd om door te gaan met de analyse. Ik zag niet de USB-toezicht zijn geplaatst omdat Im op een cyber. Maar ik denk dat deze gegevens moeten worden verpakt in de USB-communicatie |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 03 april 2006 23:30 Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Albert,
Ik heb de seriële comm versus de USB, USB maakt gebruik van een wrapper via de seriële ding. Het lijkt het gebruikt EP1 voor controle haven (het is UIT en IN) en EP2 als data port, alleen in (ICD-> pct). |
|
| Terug naar boven | |
 |
albert22
Lid geworden: 20 juli 2004 Posts: 95 Geholpen: 3
| 05 april 2006 6:39 Re: Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Hier zijn mijn vorderingen met de BL Er waren geen dergelijke subcommands. De belasting hex commando gewoon de hexadecimale records en schrijft de gegevens aan het programma geheugen 2 bytes per keer. Het checkt voor verschillende fouten met inbegrip van het bereik van adres. Ap. om te voorkomen dat de intensivering in de BL-programma. Dit bevestigt dat de BL is altijd ingezeten bij de 877. De [0A000 ", U, 0x31, U]. (De 2e U is de eerste U 1) is onwaarschijnlijk moet worden gezien, omdat het een foutenrapport. Fouten bevatten: slecht formaat, controlesom, slecht bereik en adres schrijven EEPROM fout . De routine wacht voor 16 karakters die beginnen met een 0x3c ('<') en eindigend met een 0x3e ('>'). deze 16 tekens bevatten header het adres, de lengte en de controlesom voor de gegevens die moeten worden geschreven in ASCII. Als de header is correct Ap. BL de antwoorden met "[0810C9]" De gegevens mee komt na een 0x7b Dit formaat lijkt te verschillen van een Intel hex formaat.
Zedman. Mag je herkende iets als dit in de RS232 Morgen wil ik op mijn huis en kunnen installeren hdd om de logs en kijken of ik kan worden van enige hulp. |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 05 april 2006 12:17 Re: Project ter vervanging CY7C64613 in de ICD2 | | | tags: mplab protocol icd2 icd2.dll icd2w2k.sys mplbcomm.dll |
|
| Ik zit vast met deze USB-ding. En ik ben verdrietig.
Ik niet echt weet wat te doen. Ik besteed veel tijd debuggen de icd2.dll.
Het probleem is: ik kan niet sturen zelfs een byte terug naar MPLAB.
Ik zal uitleggen wat ik gevonden heb tot nu toe, hoewel niemand echt geïnteresseerd in de (iets wilt grijper het eindproduct ding). (Met uitzondering van: Albert, Kripton, rkodaira, Silvio en de jongens in deze draad)
Dus, MPLAB communiceert met de ICD2 deze manier:
[MPLAB -> ICD2.dll -> MPLBCOMM.dll -> icd2w2k.sys ->] --- [ICD2 apparaat]
Als u kiest voor USB type verbinding zal de vraag het apparaat descriptor uit de ICD2 en controles voor het product versie woord, als het 0x0003 dan is het een Cypress gebaseerd ICD2, als het 0x0010 dan is het een 4550 gebaseerd. Als 0x0010 gevonden dan zegt dat wat ik heb gepost vóór die van de OS in de ICD2 moet worden opgewaardeerd. Het is interessant dat, als de versie (0100) in de bestandsnaam van het OS.bin is gewijzigd om FFFF dan slaat u deze stap en de controle van de bootloader versie. Hier moest ik patch ICD2.dll om het proberen na te gaan of het bestand BL.bin's versie ook, het is meegecodeerd dat zelfs het is ingesteld op FFFF it wont probeert bij te werken, dat is waarom ik deze patch (set meegecodeerd FFFF te verlagen), zodat nu zegt wat ik mentoined ook voor: de bl versie is te oud, maar kan niet worden bijgewerkt terwijl het actief is.
Oke. Ik maakte een klein prog uit de steekproef bootloader, met de juiste descriptoren en proberen te communiceren met MPLAB om het protocol te decoderen en te emuleren de BL in de nieuwe 4550 ICD2. ICD2 dat Kripton gebruikt, (cipres versie) bevat 7 OUT / IN eindpunten, maar volgens de logs daarbij alleen EP1 voor IN / OUT en EP2 voor IN. (OUT betekent PC-> Apparaatbeheer) Het ziet er naar stuurt de usb-specifieke commando's en gegevens via EP1, en terug op EP1 in en stuurt de bytes readed uit de ICD2 de 877 via afzonderlijke eindpunt EP2 inch
Wanneer MPLAB probeert te verzenden e OS.bin ter verbetering van het FW os het thema getUSBdescriptor een oproep aan de kernel driver, en stuurt een 0x12 bytes lang commando met behulp van DeviceIoControl commando. Ik debugged, het komt met succes op de 4550. Dan MPLAB kwesties een GetStatus gesprek, en het lijkt uit de gesprekkenlijst parameters die hij verwacht 0x08 bytes gegevens terug. Ik mijn buffer met 8 bytes, en de eigendom aan SIE. Maar het nooit stuurt dat 8 byte terug (het niet verschijnen in USBMon). Net wacht. Er kunnen veel dingen. Misschien ben ik st er mis met de setup van 4550, maar ik probeerde het met een ander progs en het werkt, kunt bytes terug. Ik weet het gastland moet verzenden en het commando te laten het apparaat sturen in wat zij wil. Maar toen ik debugged MBLBCOMM, ik zag dat de DeviceIoControl commando mislukt! Ik dacht dat misschien wat intelligentie is gebouwd in de. Sys-bestand en het daalt het pakket vanwege zijn verkeerde inhoud, maar ik denk dat het moet een hoger niveau taak. Als ik thuis ben zal ik de GetLastError waarde.
Iedereen heeft enig idee hoe kan ik zien of er sprake was van een in de packet verzonden, of hoe kan ik doorgaan? |
|
| Terug naar boven | |
 |
Kripton2035
Lid geworden: 19 juli 2001 Posts: 482 Geholpen: 15 Locatie: Aarde
| 05 april 2006 16:59 Project ter vervanging CY7C64613 in de ICD2 | | |
|
| kan worden moet je verbinden met een 877 op de PSP-poort van de 4550 om te zien wat er binnenkomt, en programmeert de 877 met de bootloader hebben we? kunnen de bytes u zit te wachten zijn afkomstig uit de EP2 en dus de 877?
wil je dat ik voor het verzenden van een logbestand van een precieze toestand? door de manier waarop het is zeker dat je een rokaida inloggen met zijn 4550 icd2 ..
PS: Ik ben niet geïnteresseerd in dit project .. Ik ben alleen nieuwsgierig! Ik heb al een usb icd2! |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 05 april 2006 20:08 Project ter vervanging CY7C64613 in de ICD2 | | |
|
| Dankzij Kripton,
Ik zal u op de hoogte als ik meer dump , Het is een beetje ingewikkelder dan alleen maar door de bytes naar 877 en weer terug, zij heeft een protocol wrapper op. Wat u zei was heel nuttig, maar rkodeira wont sacrify zijn gloednieuwe ICD2 ... Als hij zou dan met de dump van het OS-update zou het protocol goed ... |
|
| Terug naar boven | |
 |
Kripton2035
Lid geworden: 19 juli 2001 Posts: 482 Geholpen: 15 Locatie: Aarde
| 05 april 2006 22:09 Project ter vervanging CY7C64613 in de ICD2 | | |
|
| | en ik denk niet dat hij moet sacrify zijn icd2! slechts enkele stortplaatsen met usbmon zoals ik .. hopelijk mijn icd2 werkt nog steeds! |
|
| Terug naar boven | |
 |
albert22
Lid geworden: 20 juli 2004 Posts: 95 Geholpen: 3
| 05 april 2006 22:16 Re: Project ter vervanging CY7C64613 in de ICD2 | | | tags: icd2 laden hex commando |
|
| Ik kan niet installeren HHD monitor zie de logs want ik heb maar w98 thuis. Kun je de uitvoer van een dump van het besturingssysteem te downloaden naar een. Txt, voor mij? ------- Hoe de CY herstelt de 877? Er is een signaal (pin 43) aan de basis van Q1 wiens Collector is MCLR. Maar dit gaat naar een connector genaamd PROG. Ik besef nu dat dit signaal zou naar de 877 ook. We zouden moeten weten welke USB commando herstelt de 877. Kunnen worden is het bij een van de eindpunten controle? I dont weet wat is de functie van dit PROG connector. maar de extra eindpunten kan worden gerelateerd aan het. ---------- Een van de OS geladen aan de ICD2 lijkt te zijn: ICD01020405.hex Ik heb geprobeerd om disassemby, maar ik kan niet de disassembler ter vervanging van de hex adressen met de naam van de registers. Het zal meer tijd om uit te vinden hoe het werkt. Een interessant feit is dat de code start met het 0x0010. Vergeet niet dat de BL noemt dit adres met het uitvoeren van commando.
De BL-versie door mplab is 01.01.01.00 dit gaat redelijk goed met de BL commando die antwoorden 01,01,01,03 --------- Er is geen DPot (MCP41xxxx) in het Braziliaanse ICD. Hoe doen ze Vpp? Het merendeel van de klonen hebben een vaste Vpp. Is dit betekent dat de Braziliaanse ICD is gewoon een goedkope kloon en niet de nieuwe ICD2? I dont denk dat microchip ging voor een vaste VPP. Als er een andere methode voor het controleren van de VPP, andere dan de DPot zou moeten firmware-wijzigingen van de ICD OS. Het oude OS niet zou werken in de nieuwe. Dat kan de oorzaak dat het DLL-bestand is het controleren van de versie. |
|
| Terug naar boven | |
 |
Zedman
Lid geworden: 13 oktober 2003 Posts: 294 Geholpen: 2
| 05 april 2006 22:32 Project ter vervanging CY7C64613 in de ICD2 | | | tags: mplab protocol icd2 icd2w2k.sys icd2w2k download 4550 bootloader schrijven icd2w2k.sys Download Download icd2w2k |
|
| Ik denk niet dat we moeten omgaan met alles wat met betrekking tot het circuit of het protocol of een verbinding tussen de 877 en 4550 nog niet. Ik denk dat alle wij nodig hebben is geschreven in 4550 bakken met MPLAB. We moeten schrijven van een bootloader met de icd2w2k.sys om de OS.bin gedownload, en na dat we onze hoofden scracth hoe de 877 is aangesloten.
Toegevoegd na 5 minuten:
In ICD2br maakt gebruik van een ander soort chip waarop de Vpp. Rkodaira mentoined, controleert u de berichten voor. |
|
| Terug naar boven | |
 |
silvio
Lid geworden: 31 december 2001 Posts: 800 Geholpen: 90
| 06 april 2006 2:36 Re: Project ter vervanging CY7C64613 in de ICD2 | | | tags: icd2w2k.sys icd2w2k download 4550 bootloader write icd2w2k.sys download download icd2w2k |
|
| | Zedman wrote: | We should write a bootloader compatible with the icd2w2k.sys to get the OS.bin downloaded.
|
Yes, this is the main reason for which I said that dissasembling CY fw it's useless as long as we have the OS and BL bin file provided by Microchip. To start coding from scratch for 4550 and simulate the CY fw would be time consuming and worthless. That's I appreciate zedman's efforts.
However sometimes I can't help myself to ask this stupid question : If the BL cannot be upgraded while it's active, what was Microchip's ICD2 designers approach for upgrade ? In parallel programmer before soldering 4550 ? Or through ICSP with a clean bin image downloaded after boot block erased ? If rkodaira will find that CPB and EBTRB bits are cleared , then how can OS.bin be loaded in 4550 ? I start asking like you : why did they supplied the boot image ? Or, as Jay.slovak said "the string is readable, just the code does nothing" because it's encrypted and makes sense only for original boot code. So, the only solution is to simulate the 4550's bootloader and get the mirror bin image of OS ? |
|
| Back to top | |
 |
albert22
Joined: 20 Jul 2004 Posts: 95 Helped: 3
| 06 Apr 2006 4:36 Re: Project to replace CY7C64613 in the ICD2 | | | tags: mplab protocol icd2 |
|
| | Quote: | In ICD2br uses another kind of chip which generates the Vpp. Rkodaira mentoined, check the posts before.
| I didnt mean the MIC2175, which is a switching regulator as the MC34063. I was aiming at the DPOT and specifically to its I2C interfase because it requires the support of the firmware in the 877 to set the correct Vpp voltage. As I said before if the new ICD2 relies in other component to change the Vdd, all the firmware needs to change.
May be Rkodaira could check ithe circuit associated with pin 3 (FB) of the MIC2172 to see if vpp can be controlled or it is fixed.
Let me make my statement a little clear. If the Brazilian ICD has no control of Vpp it is highly probable that it is just a clone. In that case there is no warranty that the real new ICD2 is based on a 4550 and a 877. It could be just a 4450 alone for example (why not) in that case the following statement would not be true. | Quote: | | I think ALL we need is written in the 4550 bins supplied with MPLAB. | As we dont know for sure the arquitecture of the new ICD we need to emulate the CY. However chances are that the 4550BINs will still be usefull to solve the USB protocol. I tried to disassemble it today but found nothing coherent yet.
To the question: | Quote: | | why did they supplied the boot image ? | They supplied the BL010101.hex which needs to be programmed at the factory for the ICD to work.[/quote] |
|
| Back to top | |
 |
Zedman
Joined: 13 Oct 2003 Posts: 294 Helped: 2
| 06 Apr 2006 11:48 Re: Project to replace CY7C64613 in the ICD2 | | | tags: icd2 load hex command |
|
| Silvio,
the BL cannot be upgraded thing was a little trick. Actually MPLAB is set to check the BL's version against 0xFFFF, and if 0xFFFF (it's only a word) is lower than it will try to upgrade the bootloader. So it wont ever get here, because larger number than 0xFFFF cannot be set on a word. So I patched it to skip this test and try to do it, but anyway it's a BUILT IN function in MPLAB! It CAN update the boot image too. I just patched the version check out. But think: it's not accidentaly set to 0xFFFF, they may not want to use this function yet. According to the OS.bin file, if the product version is 0x0010 than it's downloaded all the time. Maybe 0x0010 is the BL's version only, and set to lower when OS will run in it! The OS.bin's version is also checked against 0xFFFF. If it's equals to 0xFFFF it's starts the checking for the BOOT.bin file as I mentoined above.
I'll check how it handles the active check when it complains about "it cannot be upgraded while active".
Another strange thing is if the original bootloader handles the decryption of the OS.bin image, than it will be a nice thing to clone... Anyway there is no processing on the .bin files in the software as I saw.
the DeviceIOControl command returns 0x57: The parameter is incorrect. (ERROR_INVALID_PARAMETER)
If we get the OS.bin downloaded than we can read it back with another icd2 and see how it works.
Albert,
they wont change the 877 firmware. They have a lot of hexs supplied with MPLAB should work with both versions. They may do minor changes, but thats all. Sorry I misunderstood that DPOT thing. The question "Why they supplied the boot image?" I asked was for the 4550_boot.bin file. |
|
| Back to top | |
 |
rkodaira
Joined: 08 Jun 2004 Posts: 332 Helped: 54 Location: Sao Paulo - Brasil
| 06 Apr 2006 14:19 Re: Project to replace CY7C64613 in the ICD2 | | |
|
| Hi guys !
Bad news. I could not install the USB monitor in my PC with Windows98SE, because it doesn´t accept to be installed. I think it (if installed) wouldn´t make any damage to my ICD2, but i could not test it.
About the Vpp control, I think that there is only the high voltage generator for Vpp and there is another way to control this voltage. I don´t know if the DG411 has this role, and there is a power mosfet also in the circuit.
I don´t think my clone is the new ICD2 from Microchip. I suppose the local manufacturer only made a clone using more available parts and making some changes in the firmware to adequate the new parts. Sorry I cannot make any attempt to read the 18F4550 contents.
Added after 15 minutes:
One more thing:
I tried to build the PICKIT2 programmer (onlu the basic part: the PIC, crystal and some connections) some weeks ago. It has the schematic and "all" the software available for download in the Microchip pages. I bought some 18F2550 and programmed with the firmware provided. I installed the programmer software and connected the hardware to the USB port. The PC recognized it once but the software did not. I think that there is something missing in the package, that blocks the programmer to communicate with the software. Could be the same case be happening with the hex files provided for the ICD2 ? Or in other words: Microchip does´t provide the complete code for the ICD2. |
|
| Back to top | |
 |
albert22
Joined: 20 Jul 2004 Posts: 95 Helped: 3
| 06 Apr 2006 18:26 Re: Project to replace CY7C64613 in the ICD2 | | |
|
| Please Can somebody export to .txt the USB log files captured by HDD monitor? I cannot install this soft at my home. Otherwise Ill have to wait until next week to read them on my PC at work. I am now studying the protocol between the CY and the 877 OS. If they are too big. A connect log, and a program log would be nice. Thanks |
|
| Back to top | |
 |
Kripton2035
Joined: 19 Jul 2001 Posts: 482 Helped: 15 Location: Earth
| 06 Apr 2006 19:31 Re: Project to replace CY7C64613 in the ICD2 | | |
|
| | rkodaira wrote: | Hi guys ! Bad news. I could not install the USB monitor in my PC with Windows98SE, because it doesn´t accept to be installed. I think it (if installed) wouldn´t make any damage to my ICD2, but i could not test it.
|
may be you can try this one : they say it works under w98... http://www.perisoft.net/bushound/
zedman needs a log of a real 4550... my cypress clone doesnt give all he needs... |
|
| Back to top | |
 |
Zedman
Joined: 13 Oct 2003 Posts: 294 Helped: 2
| 06 Apr 2006 20:14 Project to replace CY7C64613 in the ICD2 | | |
|
| | It can be exported from USBMon to HTML format, but I have only serial ICD2. |
|
| Back to top | |
 |
Brem
Joined: 06 Apr 2006 Posts: 36
| 06 Apr 2006 20:22 Re: Project to replace CY7C64613 in the ICD2 | | | tags: mplab protocol icd2 icd2 load hex command |
|
| Hi group,
Zedman drew my attention to this thread. I find it very interesting.
Last winter my hobby project was to build an ICD clone on a 2455/2550. I used the CDC firmware for RS232 emulation to connect to MPLAB. I disassambled the 877 firmware and made it more readable with a VB program. As far as I can tell the protocol CY<->877 and the protocol RS232<->877 are the same. There are no USB specific things in the 877 firmware.
I'll try to explain what I learned of the protocol.
MPLAB starts a connection by sending a 'Z'. ICD should reply with some kind of version nr in binary: 0x01,0x01,0x03.
Now MPLAB sends a 'V' if it wants to connect to the bootloader, ICD should reply with a 'v' 'U' if it wants to connect to the OS, ICD should reply 'u'
Next is the version of the ICD hardware, this has to be compatible with the old ICD1, so its different from all other commands: MPLAB send '$7F00\r', ICD replies '02' for ICD2
From here on all commands are send in packets in the form: '<', packet len, command, [params], checksum, '>' all items are sent in hex, packet length is including the <>. An example: '<0801C9>', len=8, cmd=1 (GETFIRMWAREVERSION), no params, checksum=0xC9
Reply's to commands are in the same form, except packed in []. Reply to the above example would be: '[0E0102630102]', len=14, cmd=1 (GETFIRMWAREVERSION), param 2.99.1, checksum=0x02.
Large chunks of data are sent in {} packets : {data [,data..], checksum}. For example the write program command: MPLAB: <184300005DC000000120FF>, len 24, cmd=0x43 (WRITEPROGRAM), program size= 0x05DC, start address=0x0120, checksum = 0xFF ICD: [0843CF], len 8, cmd 0x43, checksum 0xCF MPLAB: {FF3FFF3F.....3C} , data data data.., checksum-0x3C ICD: [0843CF], ack cmd 0x43 again
I used the information from this thread to connect my existing program with the real ICD USB Driver. I got so far that I receive the GETFIRMWAREVERSION command, but my response seems not to be understood. It sends the same command again and then hangs (?) . |
|
| Back to top | |
 |
albert22
Joined: 20 Jul 2004 Posts: 95 Helped: 3
| 06 Apr 2006 23:17 Re: Project to replace CY7C64613 in the ICD2 | | |
|
| | Quote: | | It can be exported from USBMon to HTML format, but I have only serial ICD2. | Zedman may be you can open the log files that had been posted here and export them to html. No need to have the USB ICD2.
Brem, Great. I was just at the routines that handle connection with the ICD once the OS is loaded. Thanks. |
|
| Back to top | |
 |
Zedman
Joined: 13 Oct 2003 Posts: 294 Helped: 2
| 06 Apr 2006 23:29 Re: Project to replace CY7C64613 in the ICD2 | | | tags: mplbcomm.dll |
|
| Hey Brem!
nice to see you here! Thanks for the infos on the protocol.
| Quote: | I used the information from this thread to connect my existing program with the real ICD USB Driver. I got so far that I receive the GETFIRMWAREVERSION command, but my response seems not to be understood. It sends the same command again and then hangs (?) .
|
would you please explain this a bit more? What's that mean you response is not understood? You got an usb packet starting with 0x01, replied it succesfully and just the content was wrong?
Please explain this, because as you can see from the thread Iam stuck with the replying. 
-------------------
Iam now trying an alternate way to **** with the replying thing, I wrote a small program in Delphi to test if the reply works, getting the same results yet but it's faster than switching the programmer in mplab while using it too.
here is the proc (values got from disassembled/debugged MPLBCOMM.dll): | Code: | procedure TForm1.Button1Click(Sender: TObject); var hnd: cardinal; InBuffer: array[0..3] of byte; OutBuffer: array[0..17] of byte; bytesReturned: cardinal; a: integer; begin hnd:=CreateFile('\\.\i3kmc-0', $C0000000, 2, 0, 3, 0, 0);
if hnd <> INVALID_HANDLE_VALUE then begin // get usb descriptor for a:=0 to 3 do InBuffer[a]:=0; for a:=0 to 17 do OutBuffer[a]:=0; bytesReturned:=0; if (DeviceIoControl(hnd, $0A4122404, @InBuffer, 4, @OutBuffer, $12, bytesReturned, nil)) then begin Memo1.Lines.Add('1 OK'); end;
// write command for a:=0 to 3 do InBuffer[a]:=0; for a:=0 to 17 do OutBuffer[a]:=0; bytesReturned:=0; OutBuffer[0]:=3; if (DeviceIoControl(hnd, $0A4122451, @InBuffer, 4, @OutBuffer, $12, bytesReturned, nil)) then begin Memo1.Lines.Add('2 OK'); end;
// get status for a:=0 to 3 do InBuffer[a]:=0; for a:=0 to 17 do OutBuffer[a]:=0; bytesReturned:=0; InBuffer[0]:=7; if (DeviceIoControl(hnd, $0A412244E, @InBuffer, 4, @OutBuffer, 0, bytesReturned, nil)) then begin Memo1.Lines.Add('3 OK'); end; Memo1.Lines.Add('- done.'); end; end;
|
the 3rd DeviceIOControl returns failed.
I can't even remeber how my wife look like... |
|
| Back to top | |
 |
Brem
Joined: 06 Apr 2006 Posts: 36
| 07 Apr 2006 0:31 Re: Project to replace CY7C64613 in the ICD2 | | |
|
| Hi Zedman,
Besides some recognizable data like the 'Z', the 'U' and <0801C9>, I receive packets I don't understand. They are all 18 bytes long, 1st char is 0x00,0x01 or 0x02, 2nd char seems to be some kind of seq.nr, 3rd byte a length.
First packet received is: HOST->DEV: 02 C1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 I reply with 8 x 0 DEV->HOST: 00 00 00 00 00 00 00 00 00 Second packet received is: HOST->DEV: 01 C2 01 00 00 00 00 00 00 00 C9 00 00 00 00 00 00 00 Here the first byte 0x01 seems to mean "data incoming", 3rd bytes undicates length. I dont send reply on this packet. Next rcvd is a singe 'Z', I reply with the hardware version HOST->DEV: 5A DEV->HOST: 01 01 03 Next again a packet starting with 0x02, same reply HOST->DEV: 02 C1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DEV->HOST: 00 00 00 00 00 00 00 00 00 then a "data incoming" packet folowed by a 'U', connect to OS HOST-DEV: 01 C2 01 00 00 00 00 00 00 00 C9 00 00 00 00 00 00 00 HOST-DEV: 55 Now MPLAB seems to want 8 bytes so I send a 'u' with 7 zeros DEV->HOST: 75 00 00 00 00 00 00 00
Now comes the tricky part. A packet starting with 0x02 means MPLAB wants data on EP2. HOST-DEV: 02 C3 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DEV-HOST (on EP2!!): 75 DEV-HOST (on EP1): 00 00 00 00 00 00 00 00
And here I get stuck at the moment. MPLAB sends a <0801C9> but my response is ignored. I think from here on the ICD should send all data over EP2. |
|
| Back to top | |
 |
Zedman
Joined: 13 Oct 2003 Posts: 294 Helped: 2
| 07 Apr 2006 10:51 Project to replace CY7C64613 in the ICD2 | | |
|
| Brem,
Iam a lamer. PLEASE TELL ME how do you reply? How the hell does it work for you? What am I missing? If I set up the shared ram with 0s set the Cnt to 8 and set UOWN bit to SIE, MPLAB wont send me ANY more data, and UOWN never get cleared!! But from this I see u managed it to work!!!
HELP ME PLEASE!
| Code: | HOST->DEV: 02 C1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 I reply with 8 x 0 DEV->HOST: 00 00 00 00 00 00 00 00 00
|
|
|
| Back to top | |
 |