Hello,
I need some guidance on Programming MSP-EXP430G2 Launchpad using Energia on Linux OS.
This is the first time I am using energia.
The main objective for using energia is to be able to program/debug MSP-EXP430G2 Launchpad in Linux environment (as CCS 6.0 does not support MSP-EXP430G2 Launchpad on linux)
Guidance needed for:
Kindly guide me on how can I get things working in usermode.
Specially, I would like to be able to
1. pass any argument while my code is running in the device (equivalent to scanf/getc/getchar in C programming).
2. Print information while my code is running in the device (equivalent to printf/putc/putchar in C programming).
System Information:
Launchpad: MS-EXP430G2 Rev 1.5
$ uname -a
Linux Home 3.2.0-60-generic #91-Ubuntu SMP Wed Feb 19 03:54:44 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ lsusb
Bus 002 Device 008: ID 0451:f432 Texas Instruments, Inc. eZ430 Development Tool
$ dmesg
[ 2652.200025] usb 2-9: new full-speed USB device number 9 using ohci_hcd
[ 2652.445202] cdc_acm 2-9:1.0: This device cannot do calls on its own. It is not a modem.
[ 2652.445207] cdc_acm 2-9:1.0: No union descriptor, testing for castrated device
[ 2652.445231] cdc_acm 2-9:1.0: ttyACM0: USB ACM device
[ 2662.504177] generic-usb 0003:0451:F432.0005: usb_submit_urb(ctrl) failed
[ 2662.504188] generic-usb 0003:0451:F432.0005: timeout initializing reports
[ 2662.504371] generic-usb 0003:0451:F432.0005: hiddev0,hidraw3: USB HID v1.01 Device [Texas Instruments Texas Instruments MSP-FET430UIF] on usb-0000:00:02.0-9/input1
$ more /etc/udev/rules.d/46-TI_launchpad.rules
#MSP 430 Launchpad
#Bus 002 Device 005: ID 0451:f432 Texas Instruments, Inc. eZ430 Development Tool
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f430", MODE="0660", GROUP="plugdev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0660", GROUP="plugdev"
$ ls -al /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 May 3 10:14 /dev/ttyACM0
$ sudo service udev restart
udev stop/waiting
udev start/running, process 7856
$ ls -al /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 May 3 10:14 /dev/ttyACM0
$ groups
adm tty cdrom sudo dip plugdev lpadmin sambashare home
$ /opt/energia-0101E0012/energia
IDE comes-up in usermode as well as sudo mode
Current Status:
In sudo mode
Tools->Serial Port is active ans shows /dev/ttyACM0 selected
Blink example can be loaded succesfully with following log:-
Binary sketch size: 2,623 bytes (of a 16,384 byte maximum)
Trying to open interface 1 on 009
rf2500: warning: can't detach kernel driver: No data available
Device: MSP430G2553/G2403
Erasing...
Programming...
Done, 2624 bytes total
In Usermode
Tools->Serial Port is Greyed out
Blink example can be loaded succesfully with following log:-
Binary sketch size: 2,623 bytes (of a 16,384 byte maximum)
Trying to open interface 1 on 009
Device: MSP430G2553/G2403
Erasing...
Programming...
Done, 2624 bytes total
Current Issues:
In sudo mode
Serial Monitor window shows up without any error
Following code does not show any output in Serial Monitor window or in status window of energia.
void setup () {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
// Initialize the digital pin as output.
// Pin 2:14 leds have connected:
pinMode (14, OUTPUT);
pinMode (2, OUTPUT);
}
void loop () {
digitalWrite (14, HIGH); // Led on
delay (600); // Wait 1 sec.
digitalWrite (14, LOW); // LED off
delay (1000); // Wait 1 second.
digitalWrite (2, HIGH); // Led on
delay (300); // Wait 1 second
digitalWrite (2, LOW); // LED off
delay (1000); // Wait 1 sec.
Serial.print("Hi Abhaya");
Serial.println(300);
}
In Usermode
Gives following error when Serial Monitor is invoked
processing.app.SerialNotFoundException: Serial port '/dev/ttyACM0' not found. Did you select the right one from the Tools > Serial Port menu?
at processing.app.Serial.<init>(Serial.java:165)
at processing.app.Serial.<init>(Serial.java:92)
at processing.app.SerialMonitor.openSerialPort(SerialMonitor.java:209)
at processing.app.Editor.handleSerial(Editor.java:2630)
at processing.app.Editor$20.actionPerformed(Editor.java:777)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3311)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)