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

SBG6580 script

lamp

Member
.

I don't see script for Motorola SBG6580.
This exist?
If don't exist, is possible to make it and share with your users?

Thanks a lot!

.
 
Supply me with a full dump and i can compile a script for you
 
.

One question, Mr. D3m0n!

In your script have:
- Boot (64KB)
- Cfg (64KB)
- Firmware (8064KB)
- Firmware1 (8064KB)


but in script of USB JTAG NT:
- Boot (64KB)
- cfg (64KB)
- Image0 (8064KB)
- Image1 (8064KB)
- log (128KB)

I undestand that:
Boot = Boot
Cfg = cfg
Firmware = Image0
Firmware1 = Image1

and "log"? Where is it?

.
 
The logs are of no use this is why they were left out .
 
Zipped 6580 script and re-attached

Edit: tested and not working, maybe the forum mod needs to be alerted

Edit 2: added code

C++:
MyDevice = "SBG6580"    #Name of device

BootBase = 0x0
BootSize = 0x10000
CfgBase = 0x10000
CfgSize = 0x10000
Img0Base = 0x20000
Img0Size = 0x7E0000
Img1Base = 0x800000
Img1Size = 0x7E0000
LogBase = 0xFE0000
LogSize = 0x20000

t1 = Tab.Create(MyDevice)

Tab(t1).AddProgress(10,142,440)
Tab(t1).AddGroup("Read",10,10,440,120)
Tab(t1).AddGroup("Write",10,160,440,120)
Tab(t1).AddButton("ReadBoot","Boot",20,42)
Tab(t1).AddButton("WriteBoot","Boot",20,192)
Tab(t1).AddButton("ReadCFG","cfg",105,42)
Tab(t1).AddButton("WriteCFG","cfg",105,192)
Tab(t1).AddButton("ReadImage0","Image0",190,42)
Tab(t1).AddButton("WriteImage0","Image0",190,192)
Tab(t1).AddButton("ReadImage1","Image1",275,42)
Tab(t1).AddButton("WriteImage1","Image1",275,192)
Tab(t1).AddButton("ReadLog","Log",360,42)
Tab(t1).AddButton("WriteLog","Log",360,192)

CreateEvent(ReadBoot)
    Status("Reading Boot")
        Tab(t1).ButtonDisable()
    MyData = Memory(0).ReadVerify(BootBase,BootSize)
        if (MyData == Nothing)
        Status("Error: data read back failed")
            Tab(t1).ButtonEnable()
        Exit Event
    endif
    Prompt = "Choose filename for Boot"
    IO.Save(MyData,Prompt,"Boot.bin")
    Status("Successfully read Boot from Flash!")
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(WriteBoot)
        Tab(t1).ButtonDisable()
    Prompt = "Choose a Boot to write to Flash"   
    MyData = IO.Open(Prompt,"Boot files (*.bin)|*.bin")
    if (MyData == Nothing)
        goto    Write BootExit
    endif
#    if not (Data.Length(MyData)==  BootSize)
#        Status("Error: File is not the size of the Boot")
#        goto    Write BootExit
#    endif
    Memory(0).Write(MyData,BootBase,BootSize)
    Status("New Boot successfully written!")
 WriteBootExit:
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(ReadImage0)
    Status("Saving the SBG6580's Image0")
        Tab(t1).ButtonDisable()
    MyData = Memory(0).ReadVerify(Img0Base,Img0Size)
        if (MyData == Nothing)
        Status("Error: data read back failed")
            Tab(t1).ButtonEnable()
        Exit Event
    endif
    Prompt = "Choose filename for Image0"
    IO.Save(MyData,Prompt,"Image0.bin")
    Status("Successfully read Image0 from Flash")
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(WriteImage0)
    Status("Programming the SBG6580's Image0")
        Tab(t1).ButtonDisable()
    Prompt = "Choose a firmware to install"   
    MyData = IO.Open(Prompt,"Firmware files (*.bin,*.p7)|*.bin;*.p7")
    if (MyData == Nothing)
        WriteErr = "User cancelled operation"
        goto    ExitWriteFwErr
    endif
    If (Data.HWORD(MyData,0)==12418)        #Remove header if .p7 fw
        Writeline("Removing .p7 firmware header")
        HeadLen = Data.HWORD(MyData,2) + 52    #increases Headlen by 7
        NewLen = Data.Length(MyData) - HeadLen
        Data.Resize(MyData,HeadLen,NewLen)    #Removes the p7 header
    endif
    FwLen = Data.Length(MyData)
    Memory(0).Write(MyData,Img0Base,FwLen)
    Img0Size = FwLen
    Status("New firmware successfully installed")
        Tab(t1).ButtonEnable()
        Exit
  ExitWriteFwErr:
    Status(WriteErr)
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(ReadImage1)
    Status("Saving the SBG6580's Image1")
        Tab(t1).ButtonDisable()
    MyData = Memory(0).ReadVerify(Img1Base,Img1Size)
        if (MyData == Nothing)
        Status("Error: data read back failed")
            Tab(t1).ButtonEnable()
        Exit Event
    endif
    Prompt = "Choose filename for Image1"
    IO.Save(MyData,Prompt,"Image1.bin")
    Status("Successfully read Image1 from Flash")
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(WriteImage1)
    Status("Programming the SBG6580's Image1")
        Tab(t1).ButtonDisable()
    Prompt = "Choose a firmware to install"   
    MyData = IO.Open(Prompt,"Firmware files (*.bin,*.p7)|*.bin;*.p7")
    if (MyData == Nothing)
        WriteErr = "User cancelled operation"
        goto    ExitWriteFwErr
    endif
    If (Data.HWORD(MyData,0)==12418)        #Remove header if .p7 fw
        Writeline("Removing .p7 firmware header")
        HeadLen = Data.HWORD(MyData,2) + 52    #increases Headlen by 7
        NewLen = Data.Length(MyData) - HeadLen
        Data.Resize(MyData,HeadLen,NewLen)    #Removes the p7 header
    endif
    FwLen = Data.Length(MyData)
    Memory(0).Write(MyData,Img1Base,FwLen)
    Img1Size = FwLen
    Status("New firmware successfully installed")
        Tab(t1).ButtonEnable()
        Exit
  ExitWriteFwErr:
    Status(WriteErr)
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(ReadLog)
    Status("Reading the Log")
        Tab(t1).ButtonDisable()
    MyData = Memory(0).ReadVerify(LogBase,LogSize)
        if (MyData == Nothing)
        Status("Error: data read back failed")
            Tab(t1).ButtonEnable()
        Exit Event
    endif
    Prompt = "Choose filename to save Log"
    IO.Save(MyData,Prompt,"Log.bin")
    Status("Successfully read Log from Flash")
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(WriteLog)
        Tab(t1).ButtonDisable()
    Prompt = "Choose a Log to write to Flash"   
    MyData = IO.Open(Prompt,"Log files (*.bin)|*.bin")
    if (MyData == Nothing)
        goto    WriteLogExit
    endif
    if not (Data.Length(MyData)== LogSize)
        Status("Error: File is not the size of the Log")
        goto    WriteLogExit
    endif
    Memory(0).Write(MyData,LogBase,LogSize)
    Status("New Log successfully written")
 WriteLogExit:
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(ReadCFG)
    Status("Reading the cfg")
        Tab(t1).ButtonDisable()
    MyData = Memory(0).ReadVerify(CfgBase,CfgSize)
        if (MyData == Nothing)
        Status("Error: data read back failed")
            Tab(t1).ButtonEnable()
        Exit Event
    endif
    Prompt = "Choose filename to save cfg"
    IO.Save(MyData,Prompt,"cfg.bin")
    Status("Successfully read cfg from Flash")
        Tab(t1).ButtonEnable()
EndEvent

CreateEvent(WriteCFG)
        Tab(t1).ButtonDisable()
    Prompt = "Choose a cfg to write to Flash"   
    MyData = IO.Open(Prompt,"cfg files (*.bin)|*.bin")
    if (MyData == Nothing)
        goto    WriteCFGExit
    endif
    if not (Data.Length(MyData)== CfgSize)
        Status("Error: File is not the size of the cfg")
        goto    WriteCFGExit
    endif
    Memory(0).Write(MyData,CfgBase,CfgSize)
    Status("New cfg successfully written")
 WriteCFGExit:
        Tab(t1).ButtonEnable()
EndEvent
 

Attachments

  • SBG6580_SPI.zip
    1.3 KB · Views: 82
Back
Top