X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETSPI.py;h=bd28019a0da971fd84eee219572243c85766bb2c;hp=044aea2e17b98af05f83a981a010ceca6789eddd;hb=cdc69563892a4e2e085e5d1654b3b397e0e7ec2e;hpb=f4a6b415e762bcdc560f3ea655851d16f483ea5a diff --git a/client/GoodFETSPI.py b/client/GoodFETSPI.py index 044aea2..bd28019 100644 --- a/client/GoodFETSPI.py +++ b/client/GoodFETSPI.py @@ -62,6 +62,7 @@ class GoodFETSPIFlash(GoodFETSPI): """Grab an SPI Flash ROM's JEDEC bytes.""" data=[0x9f, 0, 0, 0]; data=self.SPItrans(data); + self.JEDECmanufacturer=ord(data[1]); self.JEDECtype=ord(data[2]); self.JEDECcapacity=ord(data[3]); @@ -91,11 +92,13 @@ class GoodFETSPIFlash(GoodFETSPI): def SPIpokebyte(self,adr,val): self.SPIpokebytes(adr,[val]); def SPIpokebytes(self,adr,data): - #self.SPIwriteenable(); - adranddata=[(adr&0xFF0000)>>16, - (adr&0xFF00)>>8, - adr&0xFF - ]+data; + #Used to be 24 bits, BE, not 32 bits, LE. + adranddata=[adr&0xFF, + (adr&0xFF00)>>8, + (adr&0xFF0000)>>16, + 0, #MSB + ]+data; + #print "%06x: poking %i bytes" % (adr,len(data)); self.writecmd(0x01,0x03, len(adranddata),adranddata);