I plugged in the USB dongle with the breakout board attached, ran lsusb which showed this entry:
Bus 008 Device 004: ID 0451:f432 Texas Instruments, Inc. eZ430 Development Tool
So far so good. Now I need to install some stuff:
$ yaourt mspdebug-gityaourt is a AUR package manager, you can do this manually by searching aur.archlinux.com and then installing the package with makepkg.
The build fails: make: /bin/install: Command not found
I run these commands to make a soft-link to `which install`:
$ cd /bin
$ sudo ln -s /usr/bin/install install
then select Restart building mspdebug-git? [y/N] y
The build succeeds and the package installs.
I type...
$ sudo mspdebug rf2500because shamwowzow, I'm a frolicking alien and it connects to the device and gives me a prompt, I see the availiable commands and enter:
(mspdebug) runThe light on the breakout board begins flashing, I plugin the other board and the green light turns on... signalling a wireless connection I suppose.
I used sudo because I guess my normal user doesn't have permission to do this kind of magic yet, probably have to add it to some group.
[EDIT]: $ sudo gpasswd -a
NOW TO TRY AND WRITE SOME CODE FOR THIS JOLLY WAG.
I search AUR for mspgcc for a gcc toolchain or whatever, and it shows me a lot of stuff. I dunno what to do so I read this ubuntu guide for some ideas. Then I read this arch linux guide for another MSP430. Seems promising. I search AUR for MSP430, seems like there's a package called `gcc-msp430` I'll try that...
$ yaourt gcc-msp430I type `1-3` to install the 3 packages... I lazily don't edit the PKGBUILDs like a lazy arch user that's prone to blowing off his feet because of silly mistakes. Things compile, things install, things download and repeat, I type `y` and `n` seemingly arbitrarily to get through this maze of discrete choice towards getting code into some carefully crafted silicon hanging in it's bare PCB off the dongle at the front of my PC....
Wow. This takes a long time, I was running BOINC (like SETI for AIDS and malaria and protein folding) and turned it off so my CPU could focus on compiling all this MSP430 junk...
The next patch would create the file ld/emulparams/msp430uni.sh,Uh oh, I'm just going to press enter and hope the god of good defaults saves me.
which already exists! Assume -R? [n]
Apply anyway? [n]Uh oh, now its doing the same thing with `msp430.em`... I'm going to ctrl-c and try putting `y` instead...
Skipping patch.
1 out of 1 hunk ignored
I just ran `yaourt gcc-msp430` again, it's retrieving sources.... I dont think yaourt has a cache >.>
Ugh. That was a mistake.
Ok so I pressed `y` to make it assume -R (which means reversed or something, idk) and now it finally came back with:
make[4]: *** No rule to make target `emulparams/msp430uni.sh', needed by `emsp430.c'. Stop.
make[4]: Leaving directory `/tmp/yaourt-tmp-nak/aur-mspgcc-binutils/src/binutils-2.21.1/ld'
make[3]: *** [all-recursive] Error 1
going to "restart building" again and try just pressing enter like I did the first time... I really don't know what I'm doing at this point, as if I ever did... wow didn't even come to that point.
Targets (1): mspgcc-binutils-20120406-1
Total Installed Size: 9.95 MiB
Proceed with installation? [Y/n]
(1/1) checking package integrity [#######################################] 100%
(1/1) loading package files [#######################################] 100%
(1/1) checking for file conflicts [#######################################] 100%
error: failed to commit transaction (conflicting files)
mspgcc-binutils: /usr/bin/msp430-addr2line exists in filesystem
mspgcc-binutils: /usr/bin/msp430-ar exists in filesystem
...
with a ton more "exists in filesystem" messages, then quits saying no packages were upgraded. I don't know what's happening, I don't think it does either.
Well I guess I'll try and compile some LED blinking code from here and put it on there.
$ msp430-gcc -g -o led.elf led.c
led.c:1:26: fatal error: msp430x20x3.h: No such file or directory
compilation terminated.
Guess I need some headers... or something...
$ yaourt msp430-libcUhh ok its doing mspgcc-binutils again... pray for it.
Wow... I'm just not very good at yaourt, I've been installing crap I don't need by doing stuff like 1-3 ... I need to do a little cleaning after I'm done I think.
$yaourt msp430mcuthis says it installs the headers... getting closer
[nak@arch msp430]$ msp430-gcc -g -o led.elf led.c
/usr/bin/msp430-ld: cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
OKAY THIS IS THE -mmcu FOR THE eZ430-RF2500:
it output an elf without any errors, now to put it on the board...msp430-gcc -mmcu=msp430f2274 -o led.elf led.c
WOOO ROCKSTAR FROM MARS
$ sudo mspdebug rf2500
(mspdebug) erase
Erasing...
(mspdebug) prog led.elf
Erasing...
Programming...
Writing 154 bytes at 8000 [section: .text]...
Writing 32 bytes at ffe0 [section: .vectors]...
Done, 186 bytes total
(mspdebug) run
Running. Press Ctrl+C to interrupt...
And the LED is blinking~
I'll created a compressed version of this sometime.
I'll just add that if you don't fancy adding yourself to the group 'uucp', you can specify a udev rule to handle permission settings like so:
ReplyDelete# file: /etc/udev/rules.d/82-launchpad.rules
SUBSYSTEMS=="usb", ATTRS{product}=="Texas Instruments MSP-FET430UIF", MODE="0660", GROUP="users"
This should set the permissions of /dev/ttyACM0 or whatever serial port the launchpad identifies itself as 660 or rw for root and the users group.
Thanks for the information!
DeleteNeither gcc-msp430 nor msp430mcu build here. I'm glad there's Debian with installable and working packages. This "build theyself" is utter crap... ;(
ReplyDelete