问题
I want to test the hello world application in a z1 mote
. Unfortunately, when I try to visualize the results in the terminal using this command: make z1-reset & make login
,
I always get an unreadable result:
����������������������������à������������������������������頲��
I run the test in Ubuntu 12.04 using contiki 2.7 and msp430-gcc 4.6.3
Are there any necessary drivers for zolertia z1 motes
that I forgot to install?
Thanks in advance.
Best regards.
回答1:
I faced the same problem a few weeks ago working on the Z1 ...what u should do is update the GCC-version to 4.7.0
You can follow these steps to upgrade the MSP430-gcc:
- Update msp430 to version 4.7.0 follow http://wiki.contiki-os.org/doku.php?id=msp430x
- After finish install msp430 version 4.7.0, move folder mspgccx from /opt/tmp/ to /opt/
- Run export PATH=/opt/mspgccx/bin:$PATH on terminal for temporary, but for permanent need to put in bash_rc or bash_profile.
- Then can compile contiki code.
Someone shared it with me and it did work for me..hope it works for you =) Read the steps carefully, it is a little tricky. Good luck.
回答2:
It is possible the Z1 is already sending data over the USB port before the make login
is finished and ready to receive, resulting in weird data. Try resetting the Z1 mote using a reset button or a on/off switch.
If that resets the login
program, then you could try a LED example.
Or try below example that repeats the hello world message:
#include "contiki.h"
#include <stdio.h> /* For printf() */
PROCESS(hello_world_process, "Hello world process");
AUTOSTART_PROCESSES(&hello_world_process);
PROCESS_THREAD(hello_world_process, ev, data)
{
static struct etimer et;
PROCESS_BEGIN();
printf("First Hello world\n");
while(1){
//wait 1 second
etimer_set(&et, CLOCK_SECOND);
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
printf("Hello world\n\n");
}
PROCESS_END();
}
来源:https://stackoverflow.com/questions/22221267/unreadable-output-results-when-typing-make-login