Re: [Fx2lib-devel] eeprom reset program
Status: Beta
Brought to you by:
mulicheng
From: Dennis M. <de...@ub...> - 2009-01-29 18:32:29
|
Gerry Rozema wrote: > Ok, this did the trick. I fixed my git installation first, so I could > check out the whole lib, instead of copy/paste from the viewer online. > Built it all, seemed to build ok, then I wrote up a quick little thingy > to read the eprom instead of write it. Two of my devices it read back > fine, and I found exactly what I expected, a C0 format, and to my > surprise, only 8 bytes there. The third one surprised me, it's got a C2 > format and appears to have some firmware embedded into a larger eprom. > All of these are in sealed packages which will entail breaking the > plastic to open up and look at the parts on board. I am _hoping_ I wont > have to resort to that, because one of them will definitely not go back > together if I do that. > c2 is valid too. It is the code for embedded firmware like you said: c0 = just boot up with a default vendor_id/product_id and default usb descriptors for the chip but the firmware doesn't do anything. c2= load the firmware from the eeprom. > Just another 'point of interest', the third one did give me a bit of > trouble initially, kept reading C3 back from the first byte in the > eeprom, and that's not valid. Then for giggles, I commented out the one > line that sets up cpu clock, unplugged and replugged the device so that > it comes up 'stock out of the box', and voila, now when I put it into > reset, load my own little bit (using cycfx2prog for now), take it out of > reset, let it run the program that dumps eprom contents into ram, reset > again, then dump dram, there it was, a properly formatted C2 header. It > wont take me very long to poke at all the registers and find out what > setup the on board firmware is putting in place. > I'm not sure why you got c3 at any time. > I think I'm away to the races at this point. Next step, gonna write > something up that dumps the entire eprom out of all of them, then store > that away for safe keeping, and _then_ start reprogramming eproms. > > This is exactly what I first did. I have a program that can dump eeprom contents from an endpoint. It dynamically reads the eeprom as it's dumping to know who much to read. In the TRM for the ez-usb, you can see the iic from of the c2 data and you just need to read the length field and then read that many bytes in a loop until you read the entire iic file. There end block stop condition is in there too. -Dennis |