Friday, November 30, 2007

TI EZ430 in Linux with IAR Kickstart

by Travis Goodspeed [travis at utk.edu]
at the Extreme Measurement Communications Center
of the Oak Ridge National Laboratory


What follows are instructions for running the free version of IAR's C compiler for the MSP430 with Texas Instruments' EZ430 development tool in Linux under Wine. This will not work for Mac OS X until msp430-gdbproxy is made available for that platform. Also, this might not work with the full version of the compiler.

These instructions assume that you've installed wine, mspgcc, and msp430-gdbproxy. The assumption is also made that you've purchased the EZ430-F2013 development tool from Texas Instruments.

IAR Embedded Workbench



First, download slac050q.zip from the EZ430-F2013 page. Unzip it to get FET_R510.exe. Running wine FET_R510.exe installs the compiler to your C: drive under wine.



Next, you must find the executable and run it.

karen% find ~/.wine/drive_c -name icc\*.exe
/home/travis/.wine/drive_c/Program Files/IAR Systems/Embedded Workbench 4.0/430/bin/icc430.exe
karen% wine "C:\Program Files\IAR Systems\Embedded Workbench 4.0\430\bin\icc430.exe"
IAR MSP430 C/C++ Compiler V4.09A/W32 [Kickstart]
Copyright 1996-2007 IAR Systems. All rights reserved.

Available command line options:
--char_is_signed
'Plain' char is treated as signed char
--core {430|430X}
The processor core
430 (default)
430X
--data_model {small|medium|large}
Select data model (only for 430X core)
small Small model
16 bit registers. __data16 default. (default)
medium Medium model
20 bit registers. __data16 default. __data20 allowed.
large Large model
20 bit registers. __data20 default. __data16 allowed.
--debug
-r Insert debug info in object file
--dependencies=[i][m] file|directory
List file dependencies
i Include filename only (default)
m Makefile style
--diagnostics_tables file|directory
Dump diagnostic message tables to file
--diag_error tag,tag,...
Treat the list of tags as error diagnostics
--diag_remark tag,tag,...
Treat the list of tags as remark diagnostics
--diag_suppress tag,tag,...
Suppress the list of tags as diagnostics
--diag_warning tag,tag,...
Treat the list of tags as warning diagnostics
--discard_unused_publics
Discard unused public functions and variables (experimental)
--dlib_config pathname
Specify DLib library configuration file
--double {32|64}
The size of the double floating point type
32 32 bits (default)
64 64 bits
--ec++ Embedded C++
--eec++ Extended EC++ (EC++ with templates/namespaces/mutable/casts)
--enable_multibytes
Enable multibyte support
--error_limit limit
Stop after this many errors (0 = no limit)
--header_context
Adds include file context to diagnostics
--library_module
Make a library module
--lock_r4 Exclude register R4 from use by the compiler
--lock_r5 Exclude register R5 from use by the compiler
--mfc Enable multiple file compilation (experimental)
--migration_preprocessor_extensions
Enable IAR migration preprocessor extensions
--misrac Enable MISRA C diagnostics (not available)
--misrac_verbose
Enable verbose MISRA C messages (not available)
--module_name name
Set module name
--no_code_motion
Disable code motion
--no_cse Disable common sub-expression elimination
--no_fragments Do not generate section fragments
--no_inline Disable function inlining
--no_path_in_file_macros
Strip path from __FILE__ and __BASE_FILE__ macros
--no_tbaa Disable type based alias analysis
--no_typedefs_in_diagnostics
Don't use typedefs when printing types
--no_unroll Disable loop unrolling
--no_warnings Disable generation of warnings
--no_wrap_diagnostics
Don't wrap long lines in diagnostic messages
--omit_types Omit function/variable type info in object output
--only_stdout Use stdout only (no console output on stderr)
--output file|path
-o file|path Specify object file
--pic Generate position independent code
--preinclude filename
Include file before normal source
--preprocess=[c][n][l] file|directory
Preprocessor output
c Include comments
n Preprocess only
l Include #line directives
--public_equ symbol[=value]
Define public assembler symbol (EQU)
--reduce_stack_usage
Reduce usage of stack at the cost of larger and slower code
--regvar_r4 Allow register R4 to be used as a global register variable
--regvar_r5 Allow register R5 to be used as a global register variable
--remarks Enable generation of remarks
--require_prototypes
Require prototypes for all called or public functions
--save_reg20 Save 20-bit registers in interrupt functions
--silent Silent operation
--strict_ansi Strict ANSI rules
--warnings_affect_exit_code
Warnings affect exit code
--warnings_are_errors
All warnings are errors
-D symbol[=value]
Define macro (same as #define symbol [value])
-e Enable IAR C/C++ language extensions
-f file Read command line options from file
-I directory Add #include search directory
-l[c|C|D|E|a|A|b|B][N][H] file|directory
Output list file
c C source listing
C with assembly code
D with pure assembly code
E with non-sequential assembly code
a Assembler file
A with C source
b Basic assembler file
B with C source
N Don't include diagnostics
H Include header file source lines
-O[n|l|m|h|hs|hz]
Select level of optimization:
n No optimizations
l Low optimizations (default)
m Medium optimizations
h High optimizations
hz High optimizations, tuned for small code size
hs High optimizations, tuned for high speed
(-O without argument) The same setting as -Oh
-s{0-9} Optimize for speed:
0-2 Debug
3 Low
4-6 Medium
7-9 High
-z{0-9} Optimize for size:
0-2 Debug
3 Low (default)
4-6 Medium
7-9 High
karen%


The usage information will be valuable, but is too long to scroll through. Pipe it to a textfile for later reference. Also, make some symlinks to more easily get at include files and the documentation:

karen% sudo ln -s /home/travis/.wine/drive_c/Program\ Files/IAR\ Systems/Embedded\ Workbench\ 4.0 /opt/IAR
karen% ls /opt/IAR/430/doc/
EW430_AssemblerReference.pdf HelpMISRAC.chm embOS_IAR_plugin.pdf
EW430_CompilerReference.pdf IAR_Systems.jpg ew430.htm
EW430_MigrationGuide.pdf MSP-FET430 Users Guide.pdf htm.gif
EW430_UserGuide.pdf a430.htm icc430.htm
EW_MisraCReference.pdf a430_msg.htm icc430_msg.htm
Help430Compiler.chm appnotes migration.htm
Help430Contents.ENU.chm clib.pdf pdf.gif
Help430IDE1.chm cs430.htm readme.htm
Help430IDE2.chm embOSRelease.htm uC-OS-II-KA-CSPY-UserGuide.pdf
karen%


Make scripts for both the compiler and the assembler. I'm uninterested in the IDE.

#!/bin/sh
#/usr/local/bin/a430
wine "C:\Program Files\IAR Systems\Embedded Workbench 4.0\430\bin\a430.exe" $*

#!/bin/sh
#/usr/local/bin/icc430
wine "C:\Program Files\IAR Systems\Embedded Workbench 4.0\430\bin\icc430.exe" $*



The compiler's options are very different from those of GCC, and you must remember (or update your script) to include the IAR include directory if you intend to use its headers. A test compile of the LED blinker from slac080b.zip follows.

karen% icc430 -I "Z:\opt\IAR\430\inc" msp430x20x3_1.c --output blink.exe

IAR MSP430 C/C++ Compiler V4.09A/W32 [Kickstart]
Copyright 1996-2007 IAR Systems. All rights reserved.

34 bytes of CODE memory
0 bytes of DATA memory (+ 4 bytes shared)

Errors: none
Warnings: none
karen%


Now that the compiler is working, you'll need a linker. I use the following script:

#!/bin/sh
opts="-f Z:\opt\IAR\430\config\lnk430F2013.xcl -Fintel-standard Z:\opt\IAR\430\LIB\CLIB\cl430f.r43 -s __program_start "
xlink="C:\Program Files\IAR Systems\Embedded Workbench 4.0\common\bin\xlink.exe"
wine "$xlink" $* $opts

msp430-objcopy aout.a43 aout.exe


The format switch, -Fintel-standard, makes the output file in the ihex format, one which msp430-objcopy can handle. This will let us program the board using msp430-gdb, so the GNU tools may be used to load the executable. Also note that you'll need to uncomment lines 76 and 77 of /opt/IAR/430/config/lnk430F2013.xcl to define the stack and heap sizes. This script is called as xlink msp430x20x3_1.r43.

The following is a functional, if inelegant, Makefile:

ALL=msp430x20x3_1.exe

all: $(ALL)

msp430x20x3_1.r43: msp430x20x3_1.c
icc430 -I "Z:\opt\IAR\430\inc" msp430x20x3_1.c
msp430x20x3_1.exe: msp430x20x3_1.r43
xlink msp430x20x3_1.r43
cp aout.exe msp430x20x3_1.exe



GDB



Assuming that msp430-gdb and the USB-FET drivers have been properly installed, the GDB server can be loaded as

karen% msp430-gdbproxy msp430 --spy-bi-wire /dev/ttyUSB0

Remote proxy for GDB, v0.7.1, Copyright (C) 1999 Quality Quorum Inc.
MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood

GDBproxy comes with ABSOLUTELY NO WARRANTY; for details
use `--warranty' option. This is Open Source software. You are
welcome to redistribute it under certain conditions. Use the
'--copying' option for details.

debug: MSP430_Initialize()
debug: MSP430_Configure()
debug: MSP430_VCC(3000)
debug: MSP430_Identify()
info: msp430: Target device is a 'MSP430F20x3' (type 52)
debug: MSP430_Configure()
notice: msp430-gdbproxy: waiting on TCP port 2000


Your ~/.gdbinit file should be

set remoteaddresssize 16
set remotetimeout 999999
target remote localhost:2000
monitor interface spy-bi-wire


msp430-gdb runs with no options. Use load foo.exe to load an executable that has been made by msp430-objcopy.


karen% msp430-gdb
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=msp430".notice: msp430-gdbproxy: connected
debug: MSP430_Registers(READ)
0x0000f800 in ?? ()

(gdb) load aout.exe
Loading section .sec1, size 0x38 lma 0xf800
debug: MSP430_Memory(WRITE)
Loading section .sec2, size 0x2 lma 0xfffe
debug: MSP430_Memory(WRITE)
Start address 0xf800, load size 58
Transfer rate: 464 bits in <1>


Note that without "monitor interface spy-bi-wire" in .gdbinit and "--spy-bi-wire" to msp430-gdbproxy, load will still work but many debugging functions will not. Also note that the run command seems to have issues with spy-bi-wire; use continue instead.

You should now be able to play around with the MSP430. Grab the msp430f2013 datasheet and family guide if you'll be doing anything fancy.

55 comments:

  1. Note that you'll probably want to use the '-e' switch when building complicated scripts to prevent the following error:
    keyword "__interrupt" used with IAR extended language disabled

    ReplyDelete
  2. your text gets cut off by the right column in Firefox on Ubuntu 8.10

    ReplyDelete
  3. Thanks for great tutorial!

    1)Is this is applicable to EZ430-RF2500 to get it working under Linux?
    2)What kind of driver did you use? The one which comes with linux?

    ReplyDelete
  4. Ansis,

    The USB/serial chip in the RF2500 kit is not compatible with Linux. To make it work, you need to remove the CAT24C EEPROM and reflash the MSP430 with firmware from a blue/green EZ430F2013 kit.

    Also note that the EZ430F2013 and MSP430 FET UIF devices only work with considerable difficulty in Linux. In Ubuntu 9.04, for example, I need to boot kernel 2.6.27 as 2.6.28 has broken TUSB3410 support.

    --Travis

    ReplyDelete
  5. Travis,

    1. I want to ask same questions as Ansis said,
    2. I don't know how to remove the CAT24C EEPROM and reflash the MSP430 with firmware from a blue/green EZ430F2013 kit.

    Please please help me to work with
    EZ430-RF2500 in Linux comfortably.

    My OS is_
    Linux Mandriva 2008 i586.

    Thanks and regards
    Basavaraj Tambur

    ReplyDelete
  6. Travis Goodspeed,

    Please help me....

    Thanks and regards
    Basavaraj Tambur

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. Thanks for the great HOW-TO. I used it to get the IAR Embedded Workbench 6.0 Kickstart working from the command line in Debian Squeeze. (I built and used wine-1.3.34 because the version in the repo is ancient and does not work with the current version of IAR.)

    FYI, the GUI is working, too. You need to symbolic link the correct tty (/dev/ttyUSB0 on my machine) to com1: in wine's dosdevices directory and configure IAR to use the FET Debugger on COM1: for the magic to happen.

    It's nice to have a choice.

    ReplyDelete
  9. How did you get to activate your copy of IAR? I'm trying to activate the 4KB license on wine-based IAR installation but always get this error:

    Failed to request licenses
    Could not get the right locking code
    Failed to get the machine ID for lock selection 0x2000.
    No available machine id for specified lock selector. Status code 0x97.

    ReplyDelete
  10. The information you have posted is very useful. I really enjoy reading and also appreciate your work. Please keep inspiring more readers!
    mobile app developers in india
    mobile app development india
    Hire Net Developer

    ReplyDelete
  11. Great Research Solutions Pvt. Ltd. ( GRSoft ) is an IT company with no geographical boundaries and provides all that you can think of around IT including consulting, solutions, applications and outsourcing services.

    We are a combination of unmatched capabilities, experiences and jobs that serve across the industries. We knit closely with the clients to deliver high quality solutions with latest technologies and every growing business model approach. With the solutions provided by our professional staff our vision is to help our clients always reach new heights.

    Software Development Company India | Software Development Company | Software Development Company usa | Software Development Consulting Services India

    ReplyDelete
  12. GRSoft Gaming is an honor winning, Live Casino game advancement organization of India. We offer curiosity and inventive game development with an exceptionally talented group of developer. Our bleeding edge gaming innovation creates esteem included gaming arrangements. Quality is our real worry for club game development. We offer tweaked Casino game development benefits over the globe and help you furnish with customized development. With our Casino game, individuals couldn't imagine anything better than to chance their gaining and appreciate the advantages. We have created numerous effective games like the video poker game, Sports wagering game, online club game, lottery games, and numerous other common games.

    Casino Game Development Companies in India | Hire Poker Game Developers | Casino Game Developer | Casino Games Development Companies | Hire Poker Developers | Gaming Software Companies in India Rummy Game Software | Rummy Game Development

    ReplyDelete
  13. Ik ben erg onder de indruk van het lezen van je blog. Blijf deze waardevolle blogs delen Bellen Instagram nummer

    ReplyDelete
  14. Thank you for this information here i found something similar to this. It was very helpful and informative.
    For details visit here PayPal Nederland

    ReplyDelete
  15. You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part.office.com/setup

    ReplyDelete
  16. this blog is regarding how to run free version of IAR's C compiler for MSP430 with Texas Instruments' EZ430 development tool in Linux under Wine...


    office.com/setup

    ReplyDelete
  17. Wow, Great information shared. I appreciate the persistence you put into your website and detailed information you provided.
    mobile app development india
    web design and development india

    ReplyDelete
  18. Nice website, Love it. Great work done.

    ReplyDelete
  19. Thanks for sharing the article, enhance real time productivity with Desklog

    ReplyDelete
  20. Hi, I want to express my gratitude to you for sharing this fascinating information. It's wonderful that we now have the ability to share our thoughts. through blogs and internet services, I felt the same way, keep sharing more posts on this side with us in the future.
    ebay bellen

    ReplyDelete
  21. Amazing write-up...keep writing things like this every now and then, I hope that you continue to embrace your creativity and utilize it in your work for as long as possible
    Facebook bellen

    ReplyDelete
  22. This is useful information. Thank you for your post. Really helpful. Visit Site

    ReplyDelete
  23. Hi...
    IAR Embedded Workbench delivers a complete development toolchain for building and debugging embedded applications for your selected target microcontroller. The included IAR C/C++ Compiler generates highly optimized code for your application, and the C-SPY Debugger is a fully integrated debugger for source and disassembly level debugging with support for complex code and data breakpoints.
    You are more information then click here Microsoft Bellen

    ReplyDelete
  24. Standaard groepeert Gmail een e-mail en de bijbehorende antwoorden in één gespreksweergave. Dit maakt het gemakkelijker om meerdere berichten te zien en de antwoorden in te halen. Niet iedereen zal echter van de nieuwe aanpak houden. Als je wilt dat berichten afzonderlijk worden weergegeven, kun je de gespreksweergave in Gmail uitschakelen. Hier is hoe het te doen. om welke reden dan ook, je kunt Gmail-assistenten bellen door hun nummer te bellen zoals gespecificeerd in Gmail Bellen.

    ReplyDelete
  25. Thank you for sharing a piece of useful information. If you want more information about your issues click here
    ------------------------------ Google Bellen

    ReplyDelete
  26. Wondering “ why is my computer so slow?” Running too many programs altogether can be one of the causes of this issue, making your life troublesome and too slow.

    ReplyDelete
  27. As a last step in buying a mobile phone, you should compare the selected top models. To do this, you can easily put their specifications together and look for a better model in a completely professional and specialized way. In this step, remember not to make a choice based on appearance and personal interest, and only consider comparisons and numbers.https://ofoghnews.ir/344928/%D8%AE%D8%B1%DB%8C%D8%AF-%D9%85%D9%88%D8%A8%D8%A7%DB%8C%D9%84-%D8%AF%D8%B1-%DA%86%D9%86%D8%AF-%DA%AF%D8%A7%D9%85-%D8%B3%D8%A7%D8%AF%D9%87-%D9%88-%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1%D8%AF%DB%8C/

    ReplyDelete
  28. https://cutt.ly/eTiTX5T Respiratory infections, chronic ulcers infections (such as diabetic wounds, bed ulcers, surgical wounds and ...), uterine infections and women's pelvis, AIDS, hepatitis, tuberculosis, malaria, cholera, rubber, measles, rabies, tetanus, botulism , Diseases caused by the weakness of immune system, sinusitis and frequent colds due to low level of immunity, respiratory and administrative infections, cerebellical infections, fungal infections, common diseases between humans and livestock, chronic digestive infections, emergencies Infectious, such as meningitis and encephalitis, skin and fungal diseases and ...

    ReplyDelete
  29. Bazisell is the best board game buying reference in Iran, which in addition to high quality, reasonable price and immediate delivery, also offers good advice and support so that its customers can experience the best purchases of their lives. So we conclude that if you are looking for a suitable and useful entertainment, the best choice of board game and the best center for preparing it is Bazisell.
    https://myreportage.ir/reportage/33-%D8%A8%D8%B1%D8%AF%DA%AF%DB%8C%D9%85.html

    ReplyDelete
  30. The Omicron variant likely will spread more easily than the original SARS-CoV-2 virus and how easily Omicron spreads compared to Delta remains unknown.
    I have perused different web journals that are posted here and they are altogether worth a read. Omicron Virus Variant

    ReplyDelete

  31. Hi, I want to thank you for sharing this interesting information.
    it's great that nowadays we have an opportunity to share our thoughts. it seems to me, blogs and online services are our future. One and good example
    nice post
    please keep sharing more posts like this
    --------------------------
    if you want to contact a technician for any query or support go to PayPal Bellen

    ReplyDelete
  32. Thanks For related my informations and pls visit my website - air aisa flight change rules

    ReplyDelete
  33. I am glad to discover this page. I have to thank you for the time I spent on this especially great reading !! I really liked each part and also bookmarked you for new information on your site. Feel free to visit my website;
    Sports Toto Zone is Toto , Sports Toto , Proto , Private Toto, Powerball , Safety Playground , Eat Validation ,Topics , Toto Web , Major Sites | 스포츠토토존 | Toto site ranking.

    ReplyDelete
  34. How do you increase website traffic with LinkedIn? We have provided all the information in the content of the blog and also explained to you step by step how to use it. If there is still a technical problem, you can contact us via Linkedin Calling.
    Linkedin Bellen

    ReplyDelete
  35. CafecrackAcunetix Crack regulator approves and finds potentially dangerous HTTP technologies that can be dynamic on the target web worker. Port scanning is another activity that you can try with this app becausefitpcgames

    ReplyDelete
  36. nice share , And we do understand we need you to appreciate for this.
    Most of the illustrations you made, the easy web site menu.
    harga emas hari ini

    ReplyDelete
  37. The website style is great, the articles is really excellent
    Thanks for sharing an informative blog keep rocking bring more details.I like the helpful info you provide in your articles.
    This info very good its really very very informative great stuff post i appreciate your work.

    for any query support related to any software and hardware you can go to
    Outlook Nederland

    ReplyDelete
  38. this information is very helpful and great words. I learned so much from it. we hope you share this information future and also. thanks for sharing
    visit site

    ReplyDelete
  39. Synthesize because it identifies the voice of singers and other related people who want to create a beautiful sound in the field of music.nexus crack It can produce high-quality sound waves for better battery performance. fx sound enhancer crack you can find a better ringtone and share it with complete confidence. valhalla vintage verb crack All in all, it gives you a more charming and fast tone. keep african american hair It has high-quality characteristics that produce great sound. how to fix ghosting on monitor

    ReplyDelete
  40. amazing slow downer crack Amazing Slow Downer Crack is an easy-to-use Windows utility designed to help you play audio files in slow mode.renee passnow crack It has a clean and intuitive GUI that gives users the beecut crack ability to add files to the list using the built-in navigation function or “drag and drop” support.macbooster crack Amazing Slow Downer works with the following file formats

    ReplyDelete
  41. Actually, this information is very helpful. There are many powerful words in this blog. And it was great to read it. and I have learned a lot from it. we hope you keep sharing such information also in the future thank you for sharing.
    Youtube bellen nederland

    ReplyDelete
  42. It really amazing. for more information about disney visit here
    Disneyplus.com/Begin
    Disneyplus.com/Begin

    ReplyDelete
  43. Great blog! Thanks for your excellent post and it was really helpful for me. Good work keep doing!
    how to file for uncontested divorce in virginia
    quick uncontested divorce in virginia

    ReplyDelete
  44. Excellent blog! Such clever work and exposure! Keep up the very good work. Eddie Munson Vest

    ReplyDelete
  45. Osh University stands out with its comprehensive mbbs doctor course , providing a solid foundation for future healthcare leaders. Immerse yourself in a curriculum that combines theoretical rigor with practical expertise, ensuring a well-rounded medical education.

    ReplyDelete
  46. Shalamar Hospital boasts the best nephrologist in Lahore . Our expert nephrologist specializes in kidney care, offering comprehensive diagnostic and treatment services for your renal health.

    ReplyDelete
  47. Jewelgalore features a stunning selection of stud earrings . Explore our collection to find elegantly designed pieces that add a touch of sophistication and charm to your style.

    ReplyDelete