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.

MSP-EXP430G2ET: Symbol format 'elf32-msp430' unknown in msp430-elf-gdb

Part Number: MSP-EXP430G2ET
Other Parts Discussed in Thread: MSP430-GCC-OPENSOURCE,

Tool/software:

Hi, 

I'm trying to debug a file with the msp430-elf-gdb in the msp430-gcc-opensource toolchain. I have assembled an assembly source file with msp430-elf-as and when I try to load it into msp430-elf-gdb with "file build/program.elf," I get the message "I'm sorry, Dave, I can't do that. Symbol format `elf32-msp430' unknown." What can I do to remedy this situation? 

Let me know if any other information is needed. I am using the MSP-EXP430G2ET development board and communication with the device is functional.

Thanks, 

David

  • I don't get that error so it must be something that you are doing.

    $ /usr/ti/gcc/bin/msp430-elf-gdb eforth.elf
    GNU gdb (Mitto Systems Limited - msp430-gcc 9.3.1.11) 9.1
    Copyright (C) 2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "--host=x86_64-pc-linux-gnu --target=msp430-elf".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
    
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from eforth.elf...
    (No debugging symbols found in eforth.elf)
    (gdb) 
    

  • What is the format of your program "eforth.elf"? Is it elf32?

  • $ /usr/ti/gcc/bin/msp430-elf-readelf -h eforth.elf
    ELF Header:
      Magic:   7f 45 4c 46 01 01 01 ff 00 00 00 00 00 00 00 00 
      Class:                             ELF32
      Data:                              2's complement, little endian
      Version:                           1 (current)
      OS/ABI:                            Standalone App
      ABI Version:                       0
      Type:                              EXEC (Executable file)
      Machine:                           Texas Instruments msp430 microcontroller
      Version:                           0x1
      Entry point address:               0x4402
      Start of program headers:          52 (bytes into file)
      Start of section headers:          33836 (bytes into file)
      Flags:                             0x2d: architecture variant: MSP430X
      Size of this header:               52 (bytes)
      Size of program headers:           32 (bytes)
      Number of program headers:         29
      Size of section headers:           40 (bytes)
      Number of section headers:         45
      Section header string table index: 44
    

  • Hmm, my output of msp430-elf-readelf shows architecture variant of MSP430x14 versus your MSP430X

    msp430-elf-readelf -h build/program.elf
    ELF Header:
      Magic:   7f 45 4c 46 01 01 01 ff 00 00 00 00 00 00 00 00 
      Class:                             ELF32
      Data:                              2's complement, little endian
      Version:                           1 (current)
      OS/ABI:                            Standalone App
      ABI Version:                       0
      Type:                              EXEC (Executable file)
      Machine:                           Texas Instruments msp430 microcontroller
      Version:                           0x1
      Entry point address:               0xc000
      Start of program headers:          52 (bytes into file)
      Start of section headers:          700 (bytes into file)
      Flags:                             0xe: architecture variant: MSP430x14
      Size of this header:               52 (bytes)
      Size of program headers:           32 (bytes)
      Number of program headers:         2
      Size of section headers:           40 (bytes)
      Number of section headers:         9
      Section header string table index: 8

  • That is because I just grabbed the first file that came to hand. For the FR5969. Digging a little deeper I find something for the g2553 and the readelf output is the same as yours. Mostly. It being a bit bigger.

    readelf can show a lot more, including symbols:

    $ /usr/ti/gcc/bin/msp430-elf-readelf --symbols ammeter.elf
    
    Symbol table '.symtab' contains 1084 entries:
       Num:    Value  Size Type    Bind   Vis      Ndx Name
         0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
         1: 0000ffea     0 SECTION LOCAL  DEFAULT    1 
         2: 0000fff2     0 SECTION LOCAL  DEFAULT    2 
         3: 0000fffe     0 SECTION LOCAL  DEFAULT    3 
         4: 0000c000     0 SECTION LOCAL  DEFAULT    4 
         5: 0000c0c1     0 SECTION LOCAL  DEFAULT    5 
         6: 0000c0c2     0 SECTION LOCAL  DEFAULT    6 
         7: 00000200     0 SECTION LOCAL  DEFAULT    7 
    
    etc.

  • I am getting similar results from that command with my program. I discovered that I don't have the issue using the msp430 gcc from the TI website rather than the package from my distro (fedora 42).

  • This is the first I have heard of a copy of the msp430 version being available via a Linux distribution. I can't get dnf to admit that one exists. It would seem that whoever built that package messed it up. (Even my native fc41 version of gdb will load symbols from a msp430 .elf file.) 

  • Interesting. Here is the list of packages installed on my system when running dnf install msp430-elf* for reference: 

    msp430flasher-1.3.16-3.fc42.x86_64
    msp430-elf-toolchain-debuginfo-9.3.1.2-4.fc42.x86_64
    msp430-elf-binutils-9.3.1.2-4.fc42.x86_64
    msp430-elf-gcc-9.3.1.2-4.fc42.x86_64
    msp430-elf-gcc-c++-9.3.1.2-4.fc42.x86_64
    msp430-elf-binutils-debuginfo-9.3.1.2-4.fc42.x86_64
    msp430-elf-gcc-c++-debuginfo-9.3.1.2-4.fc42.x86_64
    msp430-elf-gcc-debuginfo-9.3.1.2-4.fc42.x86_64
    msp430-elf-gdb-debuginfo-9.3.1.2-4.fc42.x86_64
    msp430-elf-toolchain-debugsource-9.3.1.2-4.fc42.x86_64
    msp430-elf-gdb-9.3.1.2-4.fc42.x86_64
    

  • dnf search msp430
    Updating and loading repositories:
    Repositories loaded.
    Matched fields: summary
    mspdebug.x86_64 Debugger and gdb proxy for MSP430 MCUs

**Attention** This is a public forum