LogiFind MSP430 LCD KIT-C - Part 2

Continue with our discussion with this development kit. In part 1, we've discussed on accessing the device through MSPDebug but with limited success. This post will continue on investigating different drivers used by MSPDebug in trying to identify and use it. The investigation will focus on the `tilib` driver.

$ mspdebug tilib
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer
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

Google results indicates that we need to download the driver file, `libmsp430.so` from the TI own MSP Debug Stack itself. See the screenshot below to get the right file.



Once you've downloaded and extracted the MSP Debug Stack package, looks for the right driver file that match your system, either it's 32-bit or 64-bit. Use the command below to identify that.
$ uname -m
x86_64

Since we're running on 64-bit system, we will need to copy the driver file, `libmsp430_64.so` to its path so `mspdebug` program can detect and use it. Based on the description in SLAU56b,
libmsp430_64.so: This file is the dynamic library for Linux 64 bit and contains the device control functions. This file is normally located in the same directory as your application’s executable file, or in your computer system’s default library search path. This file is used during run-time.
Alternatively, you can compile the `tilib` library on your own.

The next step is to identify where is the default library search path. This is where the `ldd` program will help us.
$ ldd $(which mspdebug)
linux-vdso.so.1 =>  (0x00007ffdc6c98000)
libusb-0.1.so.4 => /lib/x86_64-linux-gnu/libusb-0.1.so.4 (0x00007f9817461000)
libreadline.so.7 => /lib/x86_64-linux-gnu/libreadline.so.7 (0x00007f9817217000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9816ff9000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9816df5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9816a2e000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f9816803000)
/lib64/ld-linux-x86-64.so.2 (0x0000556b71a1a000)

Once we've identified the library search path, copy the dynamic library file and rename it as `libmsp430.so`.
$ sudo cp libmsp430_64.so /lib/x86_64-linux-gnu/libmsp430.so

Rerun MSPDebug program using the `tilib` library and there is no more missing dynamic library error.
$ mspdebug tilib
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer
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_GetNumberOfUsbIfs
No unused FET found.

Again but explicitly the device name. We can see the device and chip ID. Unfortunately, I can't understand why it can't detect the chip as MSP430F413?
$ mspdebug tilib -d /dev/ttyUSB0
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer
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/ttyUSB0
Firmware version is 0
MSP430_VCC: 3000 mV
MSP430_OpenDevice
MSP430_GetFoundDevice
Device:  (id = 0x0000)
0 breakpoints available
MSP430_EEM_Init
Chip ID data: 04 00 55
......

Nevertheless, we're getting somewhere. More investigation in coming post.

No comments:

Post a Comment