I am running a code in Cooja simulator on Contiki and I got the following error message:
Executing MSP430X instruction but MCU is not a MSP430X
I want to broadcast a structure named ReqMsg
. The structure.h
file has been defined as below:
typedef struct {
int id ;
int t1 ;
int t2 ;
char op[4];
char E[2][2][4];
char S[2][2][4];
char type[20];
}EventPattern;
typedef struct {
int id;
EventPattern epin;
EventPattern epout;
EventPattern epresolved;
int remainEnergy;
}ReqMsg;
I gave values to ReqMsg r
as below :
EventPattern ep1 = {1, 1, 20,{{"a"} , {"b"}} ,{"seq"},{{"seq","a"},{"seq", "b"}}, "re"};
EventPattern ep2 = {2, 1, 20,{{"a"} , {"b"}} ,{"seq"},{{"seq","a"},{"seq", "b"}}, "re"};
EventPattern ep3 = {3, 1, 20,{{"a"} , {"b"}} ,{"seq"},{{"seq","a"},{"seq", "b"}}, "re"};
ReqMsg r = {1, ep1, ep2, ep3, 5};
and to broadcast the ReqMsg I used packetbuffer as below :
const ReqMsg *req = &r;
const void *reqAdd = &req;
packetbuf_copyfrom(reqAdd, 6);
broadcast_send(&broadcast);
I changed the buflen
parameter in packetbuf_copyfrom
macro to 8, 10, 255 and 3512. the error message for all the values where the same. The Contiki error log in the simulation is :
Executing MSP430X instruction but MCU is not a MSP430X
Stack Trace: number of calls: 2 PC: $00002
InterruptVectors (memset.c) called from PC: $062ca (elapsed: 5)
rtimer_run_next (memset.c) called from PC: $05b38 (elapsed: 24)
*** Interrupt 6 from PC: $042b8
and the java error log is :
org.contikios.cooja.ContikiError
at org.contikios.cooja.mspmote.MspMote.execute(MspMote.java:341)
at org.contikios.cooja.mspmote.MspMote.execute(MspMote.java:298)
at org.contikios.cooja.motes.AbstractWakeupMote$1.execute(AbstractWakeupMote.java:47)
at org.contikios.cooja.Simulation.run(Simulation.java:280)
at java.lang.Thread.run(Thread.java:745)
Caused by: se.sics.mspsim.core.EmulationException: Executing MSP430X
instruction but MCU is not a MSP430X
at se.sics.mspsim.core.MSP430Core.emulateOP(MSP430Core.java:1079)
at se.sics.mspsim.core.MSP430.stepMicros(MSP430.java:253)
at org.contikios.cooja.mspmote.MspMote.execute(MspMote.java:337)
... 4 more
Please help me to solve this problem.