我在 Contiki 上的 Cooja 模拟器中运行代码,我收到以下错误消息:
执行 MSP430X 指令但 MCU 不是 MSP430X
我想广播一个名为ReqMsg
. 该structure.h
文件已定义如下:
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;
我给的值ReqMsg r
如下:
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};
为了广播 ReqMsg,我使用了 packetbuffer,如下所示:
const ReqMsg *req = &r;
const void *reqAdd = &req;
packetbuf_copyfrom(reqAdd, 6);
broadcast_send(&broadcast);
我将宏中的buflen
参数更改为packetbuf_copyfrom
8、10、255 和 3512。所有值都相同的错误消息。模拟中的 Contiki 错误日志为:
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
java错误日志是:
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
请帮我解决这个问题。