Skip to main content
Zhang Lei
Associate II
October 26, 2017
Question

How could I read out the hex file from SPC560P34L1CEFA?

  • October 26, 2017
  • 2 replies
  • 2164 views
Posted on October 26, 2017 at 09:07

How could I read out the hex file from SPC560P34L1CEFA?

#hex
    This topic has been closed for replies.

    2 replies

    Erwan YVIN
    ST Employee
    October 26, 2017
    Posted on October 26, 2017 at 10:10

    Hello Zhang ,

    Yes , it should be ok for an uncensored chip.

    for a censored one , you need the password.

    You should take the hand with a debugger 

    Example : for PLS , there is a Macro SaveHex <file> <range>

    I have never tested this feature.

                Best Regards

                         Erwan

    Zhang Lei
    Zhang LeiAuthor
    Associate II
    October 27, 2017
    Posted on October 27, 2017 at 03:41

    I got the following information:

    '_______________________________________________________

    '

    '    SaveHEX command line function

    '

    '    generates intel-HEX file

    '

    '    command line SaveHex output-file range1 [range2] [range3] .....

    '    range description:

    '        <startaddress>,<length>

    '_______________________________________________________

    Sub SaveHEX(File,ParameterObj)

        set debugger = workspace.Coredebugger(0)

        set DisASMObj = debugger.DisASMObj

        If Not IsObject(ParameterObj) Then

              MsgBox ''Number of parameters wrong''

            Exit Sub         

        End If

        If IsNumeric(File) Then

              MsgBox ''File parameter wrong - '' & File

            Exit Sub         

        End If

        DisASMObj.OutputPath = CStr(File)

        bRetVal = DisASMObj.CreateStream(True,''UDE generated intel-Hex file of current Program'',False)

        If bRetVal = True Then

            ParmeterCnt = ParameterObj.ParameterCount

            If ParmeterCnt = 0 Then

                  MsgBox ''Number of parameters wrong '' & ParmeterCnt

                Exit Sub         

            End If

            If ( ParmeterCnt Mod 2 ) <> 0 Then

                  MsgBox ''Number of parameters wrong '' & ParmeterCnt

                Exit Sub         

            End If

            RangeCnt = ParmeterCnt/2

            ParamIndex = 0

            For Range = 0 To RangeCnt -1

                Address = CLng(ParameterObj.Parameter(ParamIndex))        

                Length = CLng(ParameterObj.Parameter(ParamIndex +1))

                ParamIndex = ParamIndex +2

                 DisASMObj.AddRange Address,Length,0

            Next

            DisASMObj.HexFileModeFlag = True

            DisASMObj.WriteAllRanges(False)

        End If

    End Sub

    In the following, what should I insert into it? Could I insert something into it like this ''Application.hex 0x0~0x7FFF''?

    0690X00000604AOQAY.jpg
    Tesla DeLorean
    Guru
    October 27, 2017
    Posted on October 27, 2017 at 04:04

    The instructions suggest something more like

    SaveHEX Application.hex 0,0x8000

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Erwan YVIN
    ST Employee
    October 27, 2017
    Posted on October 27, 2017 at 10:39

    Hello Zhang ,

    You have to run the script

    there is a button to do that

    and check the Windows directory

          Best regards

                    Erwan

    Zhang Lei
    Zhang LeiAuthor
    Associate II
    October 27, 2017
    Posted on October 27, 2017 at 10:50

    I use the following buttons and there is no Application.hex in the Windows directory.

    0690X00000604AnQAI.jpg0690X00000604AsQAI.jpg
    Erwan YVIN
    ST Employee
    October 27, 2017
    Posted on October 27, 2017 at 14:01

    Hello Zhang ,

    No , You should run the macro script not the embedded software.

             Best regards

                                Erwan