【问题标题】:MSP430 toolchain in linuxlinux中的MSP430工具链
【发布时间】:2014-09-28 13:59:40
【问题描述】:

任何人都可以指导在 Linux(尤其是 Ubuntu)中为 MSP430 设置工具链的过程吗?我正在使用 MSP430 启动板 (MSP-EXP430G2),我需要设置编译器/构建工具和调试器驱动程序。

【问题讨论】:

  • apt-cache search msp430 提供 gcc-msp430、binutils-msp430(将自动与 gcc 一起引入),mspdebug 还可以让您将 hex/binary 文件加载到启动板中。
  • 检查这些链接:1) eliaselectronics.com/installing-the-msp430-toolchain-on-ubuntu 2) elabz.com/msp430-in-64-bit-ubuntu-12-04-linux -the-arduino-way
  • 不要使用 Debian mspgcc 软件包!它陈旧且无人维护,并且存在一些严重的错误,这些错误可能会导致某些 MSP430 设备变砖。 (在某些配置中,它会在闪存熔丝上编写代码并使您的设备无法启动。)去获取 TI 的编译器吧。

标签: embedded ubuntu-14.04 msp430 toolchain


【解决方案1】:

如果您安装 Texas Instruments 的 CCS IDE,Linux 版本,它将安装工具链。然而,在 Linux 中为 MSP430 开发还存在其他问题。错误和修复在我的帖子中有详细说明:

MSP430 / eZ430-RF2500 Linux support Guide

"Compile code using Code Composer Studio (CCS)

Download CCS for Linux.
Create a new CCS project with a Custom MSP430 Device or any other.
Compile the code. The result binary image will be in the workspace. The workspace path can be found in “File” / “Switch workspace”.
The file that should be programmed to the device is the project-name.out file.
Program and run device using mspdebug

Download and Install mspdebug
From the directory with the file project-name.out run:
$ sudo mspdebug rf2500
Now you are in mspdebug’s command line shell. Run the following to program and run the device:
(mspdebug) prog project-name.out
(mspdebug) run
Use Ctrl+c to pause run and get command line back.
Fix a Linux Kernel bug that prevents Minicom to communicate with device

The device path in /dev is /dev/ttyACM0. Currently, connecting to it
serially using utilities such as minicom is not possible, and you get the message “/dev/ttyACM0: No such file or directory”.

The bug is in Kernel module “cdc_acm”. The solution is to fix the bug in the source code, recompile the module and plug it instead of the existing one.

Find out Linux version:
$ uname -r
cdc_acm’s source is the files cdc-acm.c and cdc-acm.h. They are under the Linux path drivers/usb/class/.
Download these two files from a repository that matches your Linux version. Such repos are available in lxr.free-electrons.com and www.kernel.org.
Create a new directory and move the files to it.There are two code segments need to be removed or commented out:
The next lines appear in function “acm_port_activate()” on newer versions and in “acm_tty_open()” in older ones:
// if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS) &&
// (acm->ctrl_caps & USB_CDC_CAP_LINE))
// goto bail_out;
The next line appears in function “acm_port_shutdown()” on newer versions “acm_port_down()” in older ones:
// acm_set_control(acm, acm->ctrlout = 0);
Create a Makefile and compile:
$ echo 'obj-m += cdc-acm.o' > Makefile
$ make -C /lib/modules/`uname -r`/build M=$PWD modules
You should have a new cdc-acm.ko file in the directory
Replace the existing module (This change will be discarded after boot):
$ sudo rmmod cdc-acm
$ sudo insmod ./cdc-acm.ko
Communicate via the serial port using Minicom

Launch minicom setup from command line:
$ minicom -s
In the menu, choose:
Serial port setup
Press ‘A’ (for “Serial Device”).
Replace Current device path with:
/dev/ttyACM0
Press ‘E’ (for “Bps/Par/Bits”).
Set the correct data rate for your device.To lower the rate (to 1200, for instance), keep pressing ‘B’ (for “previous”) until the top line shows:
Current: 1200 8N1
Press “Enter” until returning to main menu, there, press “Exit”.This will exit the setup menu and start running on the device. From now on you should see messages over the serial connection: It is up to you to program the device with such messages."

【讨论】:

    【解决方案2】:
    1. 下载预编译工具链(.run文件)表单http://www.ti.com/tool/msp430-gcc-opensource
    2. 解压
    3. 执行chmod +x <downloaded file>
    4. 运行安装程序

    享受吧!

    【讨论】:

      猜你喜欢
      • 2014-05-09
      • 1970-01-01
      • 2015-10-06
      • 2017-12-23
      • 1970-01-01
      • 2010-11-20
      • 2019-05-14
      • 2023-03-02
      • 2023-03-23
      相关资源
      最近更新 更多