Jump to content

WInterrupts.c error

Recommended Posts

I am having trouble understanding why winterrupts.c thinks my launchpad has a port_2 function.

Launchpad rev 1.4 Msp430g2231

C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\WInterrupts.c: In function 'Port_2':

C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\WInterrupts.c:128:6: error: interrupt vector offset 3 must be even and non-negative


The code:

//Pin connected to OE of 74HC595

int enablePin = 14;

//Pin connected to ST_CP of 74HC595

int latchPin = 7;

//Pin connected to SH_CP of 74HC595

int clockPin = 6;

////Pin connected to DS of 74HC595

int dataPin = 2;

//holders for infromation you're going to pass to shifting function

byte dataRED;

byte dataGREEN;

byte dataBLUE;

byte dataLAYER;

byte dataArrayRED[10];

byte dataArrayGREEN[10];

byte dataArrayBLUE[10];

byte dataArrayLAYER[10];

void setup() {

//set pins to output because they are addressed in the main loop

pinMode(latchPin, OUTPUT);

pinMode(enablePin, OUTPUT);

pinMode(clockPin, OUTPUT);

pinMode(dataPin, OUTPUT);


//Arduino doesn't seem to have a way to write binary straight into the code

//so these values are in HEX. Decimal would have been fine, too.

dataArrayRED[0] = B11111111; //0xFF //11111111

dataArrayRED[1] = B11111110; //0xFE //11111110

dataArrayRED[2] = B11111100; //0xFC //11111100

dataArrayRED[3] = B11111000; //0xF8 //11111000

dataArrayRED[4] = B11110000; //0xF0 //11110000

dataArrayRED[5] = B11100000; //0xE0 //11100000

dataArrayRED[6] = B11000000; //0xC0 //11000000

dataArrayRED[7] = B10000000; //0x80 //10000000

dataArrayRED[8] = B00000000; //0x00 //00000000

//Arduino doesn't seem to have a way to write binary straight into the code

//so these values are in HEX. Decimal would have been fine, too.

dataArrayGREEN[0] = B11111111; //0xFF //11111111

dataArrayGREEN[1] = B11111110; //0xFE //11111110

dataArrayGREEN[2] = B11111100; //0xFC //11111100

dataArrayGREEN[3] = B11111000; //0xF8 //11111000

dataArrayGREEN[4] = B11110000; //0xF0 //11110000

dataArrayGREEN[5] = B11100000; //0xE0 //11100000

dataArrayGREEN[6] = B11000000; //0xC0 //11000000

dataArrayGREEN[7] = B10000000; //0x80 //10000000

dataArrayGREEN[8] = B00000000; //0x00 //00000000


dataArrayBLUE[0] = B11111111; //0xFF //11111111

dataArrayBLUE[1] = B11111110; //0xFE //11111110

dataArrayBLUE[2] = B11111100; //0xFC //11111100

dataArrayBLUE[3] = B11111000; //0xF8 //11111000

dataArrayBLUE[4] = B11110000; //0xF0 //11110000

dataArrayBLUE[5] = B11100000; //0xE0 //11100000

dataArrayBLUE[6] = B11000000; //0xC0 //11000000

dataArrayBLUE[7] = B10000000; //0x80 //10000000

dataArrayBLUE[8] = B00000000; //0x00 //00000000


dataArrayLAYER[0] = B11111111; //0xFF //11111111

dataArrayLAYER[1] = B11111110; //0xFE //11111110

dataArrayLAYER[2] = B11111100; //0xFC //11111100

dataArrayLAYER[3] = B11111000; //0xF8 //11111000

dataArrayLAYER[4] = B11110000; //0xF0 //11110000

dataArrayLAYER[5] = B11100000; //0xE0 //11100000

dataArrayLAYER[6] = B11000000; //0xC0 //11000000

dataArrayLAYER[7] = B10000000; //0x80 //10000000

dataArrayLAYER[8] = B00000000; //0x00 //00000000

//function that blinks all the LEDs

//gets passed the number of blinks and the pause time



void loop() {



for (int j = 0; j < 10; j++) {

digitalWrite(enablePin, 0);

//load the light sequence you want from array

dataRED = dataArrayRED[j];

dataGREEN = dataArrayGREEN[j];

dataBLUE = dataArrayBLUE[j];

dataRED = dataArrayLAYER[j];

//ground latchPin and hold low for as long as you are transmitting

digitalWrite(latchPin, 1);

//move 'em out

shiftOut(dataPin, clockPin, dataGREEN);

shiftOut(dataPin, clockPin, dataRED);

shiftOut(dataPin, clockPin, dataBLUE);

shiftOut(dataPin, clockPin, dataLAYER);

//return the latch pin high to signal chip that it

//no longer needs to listen for information

digitalWrite(latchPin, 0);





// the heart of the program

void shiftOut(int myDataPin, int myClockPin, byte myDataOut) {

// This shifts 8 bits out MSB first,

//on the rising edge of the clock,

//clock idles low

//internal function setup

int i=0;

int pinState;

pinMode(myClockPin, OUTPUT);

pinMode(myDataPin, OUTPUT);

//clear everything out just in case to

//prepare shift register for bit shifting

digitalWrite(myDataPin, 0);

digitalWrite(myClockPin, 0);

//for each bit in the byte myDataOut

Link to post
Share on other sites

I don't have win7 64 bit. I do have Windows XP Profession sp3 32 bit. Compiling works fine on my XP setup. Maybe someone else with win7 can try this and show their results. Windows XP with energia 8 works fine with this code: http://dpaste.com/823777/ The output of my compile is here: http://dpaste.com/824438/


You might have an issue with your install. You might try downloading again. When you unpack, you might try using a short path name like C:\energia. It seems like you have an older or patched version of energia. Is there any chance you ran out of disk space. Did your extract get interrupted maybe and you didn't get all the files? If you still have problems after trying these steps, you might show us the complete verbose compiler output.




Successful compile on win32:


Link to post
Share on other sites

the verbose vindow

C:\USERS\FMFISC~1\DESKTOP\ENERGIA\HARDWARE\TOOLS\MSP430\BIN\msp430-g++ -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\variants\launchpad C:\Users\FMFISC~1\AppData\Local\Temp\build6436281745166855234.tmp\sketch_nov04d.cpp -o C:\Users\FMFISC~1\AppData\Local\Temp\build6436281745166855234.tmp\sketch_nov04d.cpp.o

C:\USERS\FMFISC~1\DESKTOP\ENERGIA\HARDWARE\TOOLS\MSP430\BIN\msp430-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\variants\launchpad C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\random.c -o C:\Users\FMFISC~1\AppData\Local\Temp\build6436281745166855234.tmp\random.c.o

C:\USERS\FMFISC~1\DESKTOP\ENERGIA\HARDWARE\TOOLS\MSP430\BIN\msp430-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\variants\launchpad C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\twi.c -o C:\Users\FMFISC~1\AppData\Local\Temp\build6436281745166855234.tmp\twi.c.o

C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\twi.c:61:16: warning: 'twi_rxBuffer' defined but not used [-Wunused-variable]

C:\USERS\FMFISC~1\DESKTOP\ENERGIA\HARDWARE\TOOLS\MSP430\BIN\msp430-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\variants\launchpad C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\usci_isr_handler.c -o C:\Users\FMFISC~1\AppData\Local\Temp\build6436281745166855234.tmp\usci_isr_handler.c.o

C:\USERS\FMFISC~1\DESKTOP\ENERGIA\HARDWARE\TOOLS\MSP430\BIN\msp430-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430 -IC:\Users\FMFISCHER\Desktop\energia\hardware\msp430\variants\launchpad C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\WInterrupts.c -o C:\Users\FMFISC~1\AppData\Local\Temp\build6436281745166855234.tmp\WInterrupts.c.o

C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\WInterrupts.c: In function 'Port_2':

C:\Users\FMFISCHER\Desktop\energia\hardware\msp430\cores\msp430\WInterrupts.c:128:6: error: interrupt vector offset 3 must be even and non-negative

Link to post
Share on other sites

new install placed in C;| now causes a new set of errors



C:\ENERGI~1\HARDWARE\TOOLS\MSP430\BIN\msp430-g++ -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\energia-0101E0008\hardware\msp430\cores\msp430 -IC:\energia-0101E0008\hardware\msp430\variants\launchpad C:\Users\FMFISC~1\AppData\Local\Temp\build2613738891457747693.tmp\sketch_nov04e.cpp -o C:\Users\FMFISC~1\AppData\Local\Temp\build2613738891457747693.tmp\sketch_nov04e.cpp.o

C:\ENERGI~1\HARDWARE\TOOLS\MSP430\BIN\msp430-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=msp430g2231 -DF_CPU=1000000L -DARDUINO=101 -DENERGIA=8 -IC:\energia-0101E0008\hardware\msp430\cores\msp430 -IC:\energia-0101E0008\hardware\msp430\variants\launchpad C:\energia-0101E0008\hardware\msp430\cores\msp430\random.c -o C:\Users\FMFISC~1\AppData\Local\Temp\build2613738891457747693.tmp\random.c.o

In file included from C:\energia-0101E0008\hardware\msp430\cores\msp430/stdlib.h:33:0,

from C:\energia-0101E0008\hardware\msp430\cores\msp430\random.c:42:

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:55:1: error: unknown type name 'uint8_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:56:1: error: unknown type name 'uint16_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:57:1: error: unknown type name 'uint32_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:58:1: error: unknown type name 'uint64_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:61:1: error: unknown type name 'int64_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:76:1: error: unknown type name 'int32_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:77:1: error: unknown type name 'int32_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:78:1: error: unknown type name 'int32_t'

c:\energi~1\hardware\tools\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/sys/types.h:79:1: error: unknown type name 'int32_t'



did I lose my typedef?

Link to post
Share on other sites

I just got two people on the IRC channel webchat.freenode.net #43oh ( thanks jim940 and r0b- ) to download energia 8, unzip it into c:\energia and compile the link i posted above. It worked without any errors for both of them. One had Windows 7 Ultimate 64 bit and the other had 64 bit Windows 7 Professional.


I can't say what else to try other than to remove all traces of anything you had installed, download a new zip file, unzip it into c:\, rename the c:\energia-0101e0008 to c:\energia and try again.



Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...