2014年3月14日 星期五

Step 5 build "mspdebug"

最後一的步驟 , 開始編譯 mspdebug utility .
mspdebug 會使用到 readline 的功能, 所以不要忘記安裝 readline
su -c ' yum install readline-devel'

接著開始 build 了, 不過會出現一些 bug  , 經過修改終於可以完整的 build 出來了. 
Patch  的內容如下 , 不過好像有比較新的版本 , any way 先使用看看 ,屆時有需要
在來更新 mspdebug 的版本.


diff -Nura mspdebug-0.19-orignal/formats/elf32.c mspdebug-0.19/formats/elf32.c
--- mspdebug-0.19-orignal/formats/elf32.c    2012-03-03 06:56:26.000000000 +0800
+++ mspdebug-0.19/formats/elf32.c    2014-03-14 02:38:55.910362847 +0800
@@ -180,7 +180,8 @@

 static int read_all(struct elf32_info *info, FILE *in)
 {
-    memset(info, 0, sizeof(info));
+//    memset(info, 0, sizeof(info));
+    memset(info, 0, sizeof(struct elf32_info));

     if (read_ehdr(info, in) < 0)
         return -1;
diff -Nura mspdebug-0.19-orignal/util/sport.c mspdebug-0.19/util/sport.c
--- mspdebug-0.19-orignal/util/sport.c    2012-03-03 06:56:26.000000000 +0800
+++ mspdebug-0.19/util/sport.c    2014-03-14 02:34:50.919397478 +0800
@@ -20,6 +20,8 @@
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
+#include <sys/time.h>
+

 #include "sport.h"
 #include "util.h"


看看 mspdebug  的 help 吧 :

[jeff@localhost msp430-toolchain]$ pwd
/home/jeff/msp430-toolchain
[jeff@localhost msp430-toolchain]$ll ./out/bin
total 24168
-rwxr-xr-x 1 jeff jeff  764332 Mar 14 02:53 msp430-addr2line
-rwxr-xr-x 2 jeff jeff  797937 Mar 14 02:53 msp430-ar
-rwxr-xr-x 2 jeff jeff 1078674 Mar 14 02:53 msp430-as
-rwxr-xr-x 1 jeff jeff  759142 Mar 14 02:53 msp430-c++filt
-rwxr-xr-x 1 jeff jeff  379404 Mar 14 02:57 msp430-cpp
-rwxr-xr-x 1 jeff jeff   38462 Mar 14 02:53 msp430-elfedit
-rwxr-xr-x 2 jeff jeff  379365 Mar 14 02:57 msp430-gcc
-rwxr-xr-x 2 jeff jeff  379365 Mar 14 02:57 msp430-gcc-4.6.3
-rwxr-xr-x 1 jeff jeff   53027 Mar 14 02:57 msp430-gcov
-rwxr-xr-x 1 jeff jeff 4495367 Mar 14 03:00 msp430-gdb
-rwxr-xr-x 1 jeff jeff 4495372 Mar 14 03:00 msp430-gdbtui
-rwxr-xr-x 1 jeff jeff  849775 Mar 14 02:53 msp430-gprof
-rwxr-xr-x 4 jeff jeff 1056501 Mar 14 02:53 msp430-ld
-rwxr-xr-x 4 jeff jeff 1056501 Mar 14 02:53 msp430-ld.bfd
-rwxr-xr-x 1 jeff jeff     948 Mar 14 03:00 msp430mcu-config
-rwxr-xr-x 2 jeff jeff  779744 Mar 14 02:53 msp430-nm
-rwxr-xr-x 2 jeff jeff 1016702 Mar 14 02:53 msp430-objcopy
-rwxr-xr-x 2 jeff jeff 1117648 Mar 14 02:53 msp430-objdump
-rwxr-xr-x 2 jeff jeff  797936 Mar 14 02:53 msp430-ranlib
-rwxr-xr-x 1 jeff jeff  414502 Mar 14 02:53 msp430-readelf
-rwxr-xr-x 1 jeff jeff  783274 Mar 14 03:00 msp430-run
-rwxr-xr-x 1 jeff jeff  765075 Mar 14 02:53 msp430-size
-rwxr-xr-x 1 jeff jeff  764091 Mar 14 02:53 msp430-strings
-rwxr-xr-x 2 jeff jeff 1016733 Mar 14 02:53 msp430-strip
-rwxr-xr-x 1 jeff jeff  660938 Mar 14 03:04 mspdebug

[jeff@localhost msp430-toolchain]$ ./out/bin/mspdebug --help
Usage: ./out/bin/mspdebug [options] <driver> [command ...]

    -q
        Start in quiet mode.
    -d device
        Connect via the given tty device, rather than USB.
    -U bus:dev
        Specify a particular USB device to connect to.
    -s serial
        Specify a particular device serial number to connect to.
    -j
        Use JTAG, rather than Spy-Bi-Wire (UIF devices only).
    -v voltage
        Set the supply voltage, in millivolts.
    -n
        Do not read ~/.mspdebug on startup.
    --long-password
        Send 32-byte IVT as BSL password (flash-bsl only)
    --help
        Show this help text.
    --fet-list
        Show a list of devices supported by the FET driver.
    --fet-force-id string
        Override the device ID returned by the FET.
    --usb-list
        Show a list of available USB devices.
    --force-reset
        Force target reset in initialization sequence.
    --allow-fw-update
        Update FET firmware (tilib only) if necessary.
    --require-fw-update <image.txt>
        Require FET firmware update (tilib only). The image must be
        a TI Text file.
    --version
        Show copyright and version information.

Most drivers connect by default via USB, unless told otherwise via the
-d option. By default, the first USB device found is opened.

If commands are given, they will be executed. Otherwise, an interactive
command reader is started.

Available drivers are:
    rf2500
        eZ430-RF2500 devices. Only USB connection is supported.
    olimex
        Olimex MSP-JTAG-TINY.
    olimex-v1
        Olimex MSP-JTAG-TINY (V1).
    olimex-iso
        Olimex MSP-JTAG-ISO.
    sim
        Simulation mode.
    uif
        TI FET430UIF and compatible devices (e.g. eZ430).
    uif-bsl
        TI FET430UIF bootloader.
    flash-bsl
        TI generic flash-based bootloader via RS-232
    gdbc
        GDB client mode
    tilib
        TI MSP430 library
[jeff@localhost msp430-toolchain]$


沒有留言:

張貼留言