This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Disassembling MSP430

Other Parts Discussed in Thread: MSP430F5172

Good evening.

My current application inside an MSP430F5172 is misbehaving, and one of the suspects is that the compiler/assembler is not really generating the code that it was expected to be generated, or something was changed "on the fly" (when the circuit was used by third-party people).
One of the checks that I am trying to do is retrieving the code segment from the circuit and checking it . But I haven't found any software solution for this task.

Currently, I am using MSP-FET430UIF, and tried several softwares:
- IAR Embedded Workbench (it has this nice "Disassembly" window feature, but I'm not able to copy the whole memory content. At most, I can copy the current window content (this means if I can see 9 assembly instructions due to this window size, I'll copy 9 lines; if I see 20 assembly instructions, that's what I can get. So getting 10000+ lines is very complicated. It also has a "copy memory" feature, but this gives me only machine code);
- MSP430-GDBproxy (this didn't work well, because it didn't recognize my USB debugger);
- Elprotronic (this was the closest I got from what I wanted, but again, only offers me the machine code).

It's possible that one of the above softwares has what I want to do, but I haven't found how (or maybe it's not very clear how to do it).

Does someone have any suggestion? If more information is necessary, please feel free to ask here.
César. 

  • I relay don't know, but it is hard to believe that IAR is not able to do it on some simple way. Anyway, best disassembler tool AFAIK is IDA.

    https://www.hex-rays.com/products/ida/index.shtml

  • You shall check IDA: https://hex-rays.com/products/ida/index.shtml

    Cesar Augusto Marcelino dos Santos said:
    when the circuit was used by third-party people

    This can be easily verified by comparing your release flash image with one you dump out of microcontroller.

  • To find if the code was changed or not is easy. Just dump the entire memory before and after. Or compute the check-sum or CRC before and after.

    To find if the code generated by the compiler is correct or not is very difficult. Even if you got the assembly listing, how are you going to see that all 1000 lines are correct? For that matter, how do you know the c source code is correct?

    I would use the debugger and try to find what went wrong by divide and conquer. Hopefully, I would not need to check all the code.

  • You can get a memory dump by using the free flashing software from elprotronics.

    However, this is just binary data then. IAR is not designed to disassembly binary data from a file. It can disassemble memory from an attached MSP or from a linker output (simulator mode), but not from other data sources.

  • Actually, my previous concern was that the compiler wasn't generating what it was expected to, like some pointers to unknown positions (despite being very unlikely to happen, it could be a possible bug).

    Ilmars said:

    This can be easily verified by comparing your release flash image with one you dump out of microcontroller.

    For now, I'll keep with it. It's much easier and a reasonable solution.

    Ilmars said:

    About IDA, that also @zrno soli suggested, I could only try the Free version, and only allows x86 assembly.

    Thanks for helping.

  • Cesar Augusto Marcelino dos Santos said:

    About IDA, that also @zrno soli suggested, I could only try the Free version, and only allows x86 assembly.

    Actually you don't need IDA. After comparing memory dumps which most probably will be equal you shall debug, not disassemble your code.

  • Hello All,

    Appears to be Yet Another Unresolved Thread.

    I also found this through the Googler:

    Disassembler for MSP430 ?

    ...

    Not automatically. 

    You can set up [Project] to use "Simulator" (not "FET debugger") so 
    that you are using the PC to simulate the MSP430. And you can use 
    "Restore" to load TI.TXT or Intal-Hex formatted file into the 
    simulated memory. 

    --OCY 

    --- In [hidden email], Raymond Hurst <rhurst2@...> wrote:



    > Will it open a binary or hex file? 

    > old_cow_yellow wrote: 
    > > 
    > > 
    > > After you go into [Project]=>[Debbug], there is one under 
    > > [View]=>[Disassembly] 
    > > 
    > > --- In [hidden email] <mailto:msp430%40yahoogroups.com>,

    Raymond


    > > Hurst <rhurst2@> wrote: 
    > >  > 
    > >  > Raymond Hurst wrote: 
    > >  > 
    > >  > I take it back. IAR doesn't seem to have a built-in disassembler. 
    > >  > I've confused it with the AVR tool set. 
    > >  > 
    > >  > -- 
    > >  > Ray Hurst 
    > >  > 949-202-6037 
    > >  > 
    > > 
    > > 
    >
    I tried what OCY suggested - but I think if the file and the IAR rev are a little far apart - it doesn't work - I kept
    getting this message on some files I tried:

    Thu Feb 06, 2014 20:29:05: Memory Restore: Failed to read C:\temp\dissassembler\memory_430_1.txt. The file may be corrupt or in an unsupported format.

    I did a test from the simulator just to make sure I could load something that was saved - that works OK.

    That Raymond fellow was posting messages all over regarding Visual Disassembler - has anyone had any luck with that?

    Regards,
    johnw

**Attention** This is a public forum