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.

MSP430F2112 thinks it's a MSP4302122!

Other Parts Discussed in Thread: MSP430F2112, MSP430F2122, MSP430F2132, MSP430F5438A

I'm having problems working with a MSP430F2112 MCU. I'm using a MSP-FET430UIF + mspdebug utility to program and debug it. The problem is it gets detected as a MSP430F2122!. Upon reset, it goes to 0xF000 address, and of course there is no code (code in 2112 is at 0xF800), so the program never executes. I have another board with a 2132, and this gets properly detected and works fine.

mspdebug output when I plug the emulator to the working 2132 MCU:

$ mspdebug -jd /dev/ttyUSB0 uif
MSPDebug version 0.19 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying to open UIF on /dev/ttyUSB0...
Initializing FET...
FET protocol version is 20305000
Configured for JTAG (2)
Set Vcc: 3000 mV
Device ID: 0xf213
Device: MSP430F2132
Code memory starts at 0xe000
Number of breakpoints: 2

mspdebug output when I plug the emulator to the non-working 2112:

$ mspdebug -jd /dev/ttyUSB0 uif
MSPDebug version 0.19 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Trying to open UIF on /dev/ttyUSB0...
Initializing FET...
FET protocol version is 20305000
Configured for JTAG (2)
Set Vcc: 3000 mV
Device ID: 0xf213
Device: MSP430F2122
Code memory starts at 0xf000
Number of breakpoints: 2

Is the MCU damaged? What else can I try?

  •  Initial comment is that I am confused about the device types.

    The title of this thread is "MSP430F2112 thinks it's a MSP4302122!", but based upon the output from mspdebug do you actually mean "MSP430F2132 thinks it's a MSP430F2122!" ?

    I am currently trying to determine how MSP-FET430UIF / MSP430.dll determine the device type to understand what the cause is....

     

  • 1. Which MSP430 chip do you intend to use?

    2. Which MSP430 chip is being used?

    3. Which MSP430 chip is the source code intended for? How is this intention conveyed to the compiler?

    4. Which MSP430 chip is the "project" set up for?

    MSP430 chips cannot "think". Some of us can think so of the time.

  • OK, I'll clarify a bit more:

    1.- The chip I intend to use is a MSP430F2112

    2.- The chip I'm using is also a MSP430F2112

    3.- The source code is made for a MSP430F2112. msp430f2112.h is included in the sources, and the project is compiled and linked using -mmcu=msp430f2112

    4.- I think this is explained in 3. I'll just add I'm using open source tools, and I'm building the code using mspgcc.

    The project is (as far as I know) properly built. I have browsed the .map file and .text section is where it shoud (at 0xF800). The problem is mspdebug tool detects the device as a MSP430F2122, and *it looks like* the problem is chip related (i.e. not mspdebug related), because the code, when flashed, is not working. When I try to debug it, upon reset, address 0xF000 is loaded to the program counter. At 0xF000 there is nothing. That address is the reset vector for MSP430F2122. For MSP430F2112 it should be 0xF800.

    As I wrote in the first post, I have tested mspdebug also with other board I have, that has a MSP430F2132, and this MCU is properly detected. But the MCU I want to use in my actual project is a MSP430F2112.

  • OK, it's working right now. It looks like the problem was in the emulator after all. I was using an old firmware version, and it looks like MSP430F2112 was not supported in that version. Updated it to the latest version and it's working now:

    $ mspdebug tilib -jd /dev/ttyACM0
    MSPDebug version 0.19 - debugging tool for MSP430 MCUs
    Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    MSP430_Initialize: /dev/ttyACM0
    Firmware version is 30203015
    MSP430_VCC: 3000 mV
    MSP430_OpenDevice
    MSP430_GetFoundDevice
    Device: MSP430F2112 (id = 0x000a)
    2 breakpoints available
    MSP430_EEM_Init

  • Jesus Alonso said:
    When I try to debug it, upon reset, address 0xF000 is loaded to the program counter. At 0xF000 there is nothing. That address is the reset vector for MSP430F2122. For MSP430F2112 it should be 0xF800.

    No. The address stored in 0xFFFE (the reset vector, from which PC is loaded on startup) is the address of the program start. And it is set by the linker based on where it has put the code. It may be the start of flash or somewhere else.

    However, MSPDEBUG doesn't change this. If the linker output file contains the info that the value 0xf800 has to be written to address 0xfffe, then it will be. No matter what the 'detected' target device is.

    Also, if MSPDEBUG detects a wrong device, it will either do its job as if it were the right one (failing to write to non-existent flash memory) or complain that the binary file contains data where the (apparent) target device has no writable memory. In no case it should alter any content based on any assumption about the target device.

    So both, your problem and your solution, appear a bit strange to me. (I'm using MSPGCC myself, but still the 3.23 version, and not MSPDEBUG)

  • I don't really know what was causing the problem, but now it's gone, and the only two things I have updated are the FET firmware and the library mspdebug uses to communicate with the emulator (libmsp430.so). I did not change neither mspgcc version nor the source code.

    Anyway, it's working now!

    A bit off topic: Are you developing under Linux? What software do you use for debugging?

  • Jesus Alonso said:
    Are you developing under Linux?

    No, Windows.

    Jesus Alonso said:
    What software do you use for debugging

    A terminal program for the UART output. AND/OR scope, logic analyzer or external precision timer. I don't use a debugger at all, as a debugger won't help if you deal with external realtime events.

  • I'm developing under Linux and can't find out how to debug MSP-EXP430F5438A over MSP-FET430UIF. I've tried different variants of this command:

    mspdebug -j -d  /dev/ttyACM0 tilib (After having read that 'tilib' is driver in a case like this.)

    The result : MSPDebug version 0.20 - debugging tool for MSP430 MCUs
    Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    tilib: can't find libmsp430.so: libmsp430.so: cannot open shared object file: No such file or directory.

    I also tried this just to have something to compare to (After having read that ttySx is for serial connection):
    sudo mspdebug -j -d /dev/ttyS0 uif
    MSPDebug version 0.20 - debugging tool for MSP430 MCUs
    Copyright (C) 2009-2012 Daniel Beer <dlbeer@gmail.com>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Trying to open UIF on /dev/ttyS0...
    Initializing FET...
    uif: read error: Connection timed out
    fet: open failed
    Trying again...
    Initializing FET...
    uif: read error: Connection timed out
    fet: open failed

    lsusb command with MSP-EXP430F5438 alone ,and together with LaunchPad connected shows following:

    Bus 002 Device 010: ID 0409:0059 NEC Corp. HighSpeed Hub
    Bus 002 Device 013: ID 2047:0010 Texas Instruments

    and with Launchpad connect too,shows:
    Bus 002 Device 010: ID 0409:0059 NEC Corp. HighSpeed Hub
    Bus 002 Device 015: ID 0451:f432 Texas Instruments, Inc. eZ430 Development Tool
    Bus 002 Device 013: ID 2047:0010 Texas Instruments

    I interpret this as they both are recognized and the result of having added my username to /udev/Groups and in /etc/udev/rule.d, I have added following files with contlike this: 46-TI_launchpad.rules

    ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE='0660", GROUP=plugdev
    ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f430", MODE='0660", GROUP=plugdev

            61-msp430uif.rules

    #TI MSP430UIF
    ATTRS{idVendor}=="2047",ATTRS{idProduct}=="0010",MODE="0666",GROUP="plugdev"
    ATTRS{idVendor}=="2047",ATTRS{idProduct}=="0010",MODE="0660",GROUP="plugdev"

    So what more should I do to be able to load an elf/out file into MSP430F5438A?

    Regards Bo






  • To be able to use tilib, you have to install it first, and it looks like it's not properly installed (tilib: can't find libmsp430.so: libmsp430.so: cannot open shared object file: No such file or directory.). You can find source code and isntructions to build the library here: http://processors.wiki.ti.com/index.php/MSPDS_Open_Source_Package

    You will also need to upgrade the firmware in your FET. Read carefully this: http://processors.wiki.ti.com/index.php/MSPDS_Debugger_Up-_and_Downgrade

**Attention** This is a public forum