• Visit https://www.embeddedcomputers.net/ for Hardware; Software and all other things related to FlashcatUSB

DPC2100 Script BCM3349 JTAG

Status
Not open for further replies.

D3m0n

Administrator
Staff member
MYDevice = "WebSTAR DPC2100"
ImgFile = "images\DPC2100.jpg"

FwBase = 0x10000

JTAG.MemoryAddress(0x0)
JTAG.MemoryType("RAM")
JTAG.MemorySize(0x800000)
CFGMEM = JTAG.MemoryInit()
JTAG.MemoryAddress(0x1FC00000)
JTAG.MemoryType("CFI")
CFGFLASH = JTAG.MemoryInit()

SetParam(1,50) #Sets the Intel flash delay
SetParam(2,175) #Sets the AMD flash delay
SetParam(3,50) #Sets the DMA read delay

JTAG.BigEndian #Sets the device endian

if not (Memory(CFGFLASH).Exist)
Writeline("Error in script: Flash not connected")
exit script
endif

FwNameLoc = FWBase + 0x14
FwName = Memory(CFGFLASH).ReadString(FwNameLoc)

if (FwName = Nothing)
Writeline("Flash data does not contain proper firmware format")
exit script
endif


t1 = Tab.Create(MyDevice)
Tab(t1).AddGroup("Firmware",76,10,300,95)
Tab(t1).AddButton("ReadFirmware","Read",110,62)
Tab(t1).AddButton("WriteFirmware","Write",270,62)
Tab(t1).AddText("FwLbl","(No firmware found)",86,34)
Tab(t1).AddImage("LOGO",ImgFile,20,115)

LoadFwInfo()


CreateEvent(ReadFirmware)
Status("Saving the DPC2100 Firmware")
Tab(t1).ButtonDisable()
MyData = Memory(CFGFLASH).ReadVerify(FwBase,FwLen) #ReadFlashVerify
if (MyData = Nothing)
Status("Error: data read was corrupted")
Tab(t1).ButtonEnable()
Exit
endif
Prompt = "Choose filename to save the firmware"
SaveFile(MyData,Prompt,FwName)
Status("Successfully read firmware from Flash")
Tab(t1).ButtonEnable()
EndEvent


CreateEvent(WriteFirmware)
Status("Programming the DPC2100 Firmware")
Tab(t1).ButtonDisable()
Prompt = "Choose a firmware to install"
MyData = OpenFile(Prompt,"Firmware files (*.bin)|*.bin")
if (MyData = Nothing)
WriteErr = "User cancelled opperation"
goto ExitWriteFwErr
endif
Memory(CFGFLASH).Write(MyData,FwBase,FwLen)
Status("New firmware successfully installed")
LoadFwInfo()
Tab(t1).ButtonEnable()
Exit
ExitWriteFwErr:
Status(WriteErr)
Tab(t1).ButtonEnable()
EndEvent


CreateEvent(LoadFwInfo)
FwNameLoc = FWBase + 0x14
FwName = Memory(CFGFLASH).ReadString(FwNameLoc)
SizeLoc = FWBase + 0xC
Fdata = Memory(CFGFLASH).Read(SizeLoc,4,true)
FwLen = Word(Fdata,0) + 92
MYFwLabel = "Currently installed: " & FwName
Tab(t1).SetText("FwLbl",MYFwLabel)
EndEvent
 

Attachments

  • DPC2100_JTAG.bcs
    2.3 KB · Views: 94
Status
Not open for further replies.
Top