Fixed mbxxx platform

This commit is contained in:
stefano pascali 2013-07-11 17:50:15 +02:00 committed by ismb-pert
parent 10f64c0ce8
commit fcb09d5d30
107 changed files with 2018 additions and 2760 deletions

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1,49 +0,0 @@
ELFloader and shell command 'exec' example for MB851 (STM32W) platform
-----------------------------------------------------------
Compiles the Contiki hello-world application as a Contiki executable (.ce).
The Contiki executable is then uploaded to the MB851 platform via serial, and
is stored in the filesystem. Finally, the executable is loaded via the shell
command 'exec'.
NOTE:
You may have to reduce the ELF loader memory usage (/platform/sky/contiki-conf.h).
Since hello-world uses very little memory:
#define ELFLOADER_CONF_DATAMEMORY_SIZE 0x100
#define ELFLOADER_CONF_TEXTMEMORY_SIZE 0x100
1. Upload Sky shell with 'exec' command and symbols (requires several
recompilations to generate correct symbols):
make
make CORE=shell-exec-test.mb851
make shell-exec-test.flash CORE=shell-exec-test.mb851 PORT=AUTO
2. Verify access to the shell and the filesystem:
> make login DEV=/dev/comX
SHELL> echo hello shell
SHELL> echo test | write mytest.txt
SHELL> ls
SHELL> read mytest.txt
[CTRL-C] to exit the shell
3. Upload Contiki executable hello-world.ce:
> make upload-executable DEV=/dev/comX
[CTRL-C] to exit the shell when the entire file has been uploaded (after ~30 sec)
4. Verify that hello-world.ce exists in CFS:
> make login DEV=/dev/comX
SHELL> ls
SHELL> read hello-world.ce | size
The last command output should equal the size of hello-world.ce in this
directory!
5. Load and start hello world:
SHELL> exec hello-world.ce
The program should now start: the output 'Hello, World' appears.

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1,10 +0,0 @@
UDP IPV6 sleep
==============
Thi is an example based on the UDP-IPv6 example. A client periodically sends
UDP packets to a fixed server. The client will also go in a deep sleep state
during which all system peripherals are turned off to save as more energy as
possible.
To avoid blocking the entire OS for too long time, the system periodically
wakes up to let the OS poll processes and dispatch events.

View file

@ -1 +0,0 @@
TARGET = mb851

View file

@ -1,37 +0,0 @@
Compile with WITH_RIME 1 for neighbor discovery and with ENERGEST_CONF_ON for
energy estimation.
Estimated consumption with batteries (2.4 V):
<table>
<tr>
<td></td>
<td>Curr</td>
<td>Power</td>
</tr>
<tr>
<td>ENERGEST_TYPE_CPU</td>
<td>7.5 mA</td>
<td>18 mW</td>
</tr>
<tr>
<td>ENERGEST_TYPE_LPM</td>
<td>3 mA</td>
<td>7.2 mW</td>
</tr>
<tr>
<td>ENERGEST_TYPE_TRANSMIT</td>
<td>21 mA</td>
<td>50.4 mW</td>
</tr>
<tr>
<td>ENERGEST_TYPE_LISTEN</td>
<td>19 mA</td>
<td>45.6 mW</td>
</tr>
</table>

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -41,6 +41,7 @@
#include "contiki.h"
#include "dev/acc-sensor.h"
#include "board.h"
#include <stdio.h> /* For printf() */
/*---------------------------------------------------------------------------*/
@ -54,7 +55,7 @@ PROCESS_THREAD(acc_process, ev, data)
PROCESS_BEGIN();
printf("Starting measuring acceleration\r\n");
boardPrintStringDescription();
SENSORS_ACTIVATE(acc_sensor);
// Enable High Range.
@ -63,7 +64,7 @@ PROCESS_THREAD(acc_process, ev, data)
// Enable High Pass Filter.
//acc_sensor.configure(ACC_HPF, ACC_1HZ);
while(1) {
etimer_set(&etimer, CLOCK_SECOND/2);

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -42,6 +42,8 @@
#include "dev/button-sensor.h"
#include "dev/leds.h"
#include <stdio.h>
#include "board.h"
/*---------------------------------------------------------------------------*/
PROCESS(test_button_process, "Test button");
@ -52,7 +54,7 @@ PROCESS_THREAD(test_button_process, ev, data)
PROCESS_BEGIN();
SENSORS_ACTIVATE(button_sensor);
boardPrintStringDescription();
printf("Press the button to toggle the leds.");
while(1) {

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -40,6 +40,7 @@
#include "contiki.h"
#include "cfs-coffee-arch.h"
#include "cfs-coffee.h"
#include "board.h"
#include <stdio.h>
@ -50,7 +51,8 @@ AUTOSTART_PROCESSES(&coffee_test_process);
PROCESS_THREAD(coffee_test_process, ev, data)
{
PROCESS_BEGIN();
boardPrintStringDescription();
printf("Testing coffee...\n");
cfs_coffee_format();

View file

@ -1,6 +1,6 @@
CONTIKI_PROJECT = mb851-shell
CONTIKI_PROJECT = mbxxx-shell
PROJECTDIRS = $(CONTIKI)/platform/mb851/apps
PROJECTDIRS = $(CONTIKI)/platform/mbxxx/apps
APPS = serial-shell

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -32,7 +32,7 @@
/**
* \file
* MB851-specific Contiki shell
* mbxxx-specific Contiki shell
* \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net>
*
@ -44,10 +44,10 @@
#include "shell-sensors.h"
/*---------------------------------------------------------------------------*/
PROCESS(mb851_shell_process, "MB851 Contiki shell");
AUTOSTART_PROCESSES(&mb851_shell_process);
PROCESS(mbxxx_shell_process, "MBXXX Contiki shell");
AUTOSTART_PROCESSES(&mbxxx_shell_process);
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(mb851_shell_process, ev, data)
PROCESS_THREAD(mbxxx_shell_process, ev, data)
{
PROCESS_BEGIN();

View file

@ -1,4 +1,4 @@
all: mb851-websense
all: mbxxx-websense
CONTIKI=../../..
@ -14,11 +14,11 @@ PROJECT_SOURCEFILES += httpd-simple.c
include $(CONTIKI)/Makefile.include
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
(cd $(CONTIKI)/tools && $(MAKE) tunslip6)
connect-router: $(CONTIKI)/tools/tunslip6
connect-router: $(CONTIKI)/tools/tunslip6
sudo $(CONTIKI)/tools/tunslip6 aaaa::1/64
connect-router-cooja: $(CONTIKI)/tools/tunslip6
connect-router-cooja: $(CONTIKI)/tools/tunslip6
sudo $(CONTIKI)/tools/tunslip6 -a 127.0.0.1 aaaa::1/64

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -1 +1,4 @@
webserver IPv6
==============
See sky-websense example for more info.

View file

@ -1,7 +1,7 @@
CONTIKI_PROJECT = shell-exec-test
all: $(CONTIKI_PROJECT)
TARGET=mb851
TARGET=mbxxx
COFFEE=1
ELF_LOADER=1

View file

@ -0,0 +1,47 @@
ELFloader and shell command 'exec' example for mbxxx (STM32W) platform
======================================================================
Compiles the Contiki hello-world application as a Contiki executable (.ce).
The Contiki executable is then uploaded to the mbxxx platform via serial, and
is stored in the filesystem.
Finally, the executable is loaded via the shell command 'exec'.
NOTE:
You may have to reduce the ELF loader memory usage (/platform/sky/contiki-conf.h).
Since hello-world uses very little memory:
#define ELFLOADER_CONF_DATAMEMORY_SIZE 0x100
#define ELFLOADER_CONF_TEXTMEMORY_SIZE 0x100
1. Upload Sky shell with 'exec' command and symbols (requires several recompilations to generate correct symbols):
> make
> make CORE=shell-exec-test.mbxxx
> make shell-exec-test.flash CORE=shell-exec-test.mbxxx PORT=AUTO
2. Verify access to the shell and the filesystem:
> make login DEV=/dev/comX
SHELL> echo hello shell
SHELL> echo test | write mytest.txt
SHELL> ls
SHELL> read mytest.txt
[CTRL-C] to exit the shell
3. Upload Contiki executable hello-world.ce:
> make upload-executable DEV=/dev/comX
[CTRL-C] to exit the shell when the entire file has been uploaded (after ~30 sec)
4. Verify that hello-world.ce exists in CFS:
> make login DEV=/dev/comX
SHELL> ls
SHELL> read hello-world.ce | size
The last command output should equal the size of hello-world.ce in this directory!
5. Load and start hello world:
SHELL> exec hello-world.ce
The program should now start: the output 'Hello, World' appears.

View file

@ -4,7 +4,7 @@ UIP_CONF_IPV6=1
APPS = telnetd
PROJECTDIRS = $(CONTIKI)/platform/mb851/apps
PROJECTDIRS = $(CONTIKI)/platform/mbxxx/apps
PROJECT_SOURCEFILES = shell-sensors.c

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -42,6 +42,7 @@
#include "contiki.h"
#include "dev/temperature-sensor.h"
#include "board.h"
#include <stdio.h> /* For printf() */
/*---------------------------------------------------------------------------*/
@ -53,9 +54,10 @@ PROCESS_THREAD(temp_process, ev, data)
static struct etimer etimer;
PROCESS_BEGIN();
printf("Starting measuring temperature\r\n");
boardPrintStringDescription();
printf("Starting measuring temperature\r\n");
while(1) {
etimer_set(&etimer, CLOCK_SECOND);
@ -63,7 +65,6 @@ PROCESS_THREAD(temp_process, ev, data)
unsigned int temp = temperature_sensor.value(0);
printf("Temp: %d.%d °C \r",temp/10,temp-(temp/10)*10);
}

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -0,0 +1,10 @@
UDP-IPv6 Client and Server
=========================
This is an example based on the udp-ipv6 example. A client periodically sends
UDP packets to a fixed server. The client will also go in a deep sleep state
during wich all system peripherals are turned off to save as more energy as
possible.
To avoid blocking the entire OS for too long time, the system periocally
wakes up to let the OS poll processes and dispatch events.

View file

@ -33,6 +33,7 @@
#include "sleep.h"
#include "board-sensors.h"
#include "board.h"
#include <string.h>
@ -165,9 +166,9 @@ PROCESS_THREAD(udp_client_process, ev, data)
PROCESS_YIELD();
if(etimer_expired(&wake_timer)){ // if timer hasn't expired do not go in deep sleep, in order to receive a response.
printf("Sleeping...\r\n");
sensorsPowerDown();
halBoardPowerDown();//sensorsPowerDown();
sleep_seconds(SLEEP_INTERVAL_SECONDS); // Put system in deep sleep mode for a while.
sensorsPowerUp();
halBoardPowerUp();//sensorsPowerUp();
printf("Awake\r\n");
}
if(etimer_expired(&et)) {

View file

@ -1,4 +1,4 @@
CONTIKI_PROJECT = mb851-webserver
CONTIKI_PROJECT = mbxxx-webserver
all: $(CONTIKI_PROJECT)
DEFINES=PROJECT_CONF_H=\"webserver-ajax-conf.h\"

View file

@ -0,0 +1 @@
TARGET = mbxxx

View file

@ -0,0 +1,12 @@
webserver ajax
==============
Compile with WITH_RIME 1 for neighbor discovery and with ENERGEST_CONF_ON
for energy estimation.
Estimated consumption with batteries (2.4 V):
Curr Power
ENERGEST_TYPE_CPU: 7.5 mA 18 mW
ENERGEST_TYPE_LPM: 3 mA 7.2 mW
ENERGEST_TYPE_TRANSMIT: 21 mA 50.4 mW
ENERGEST_TYPE_LISTEN: 19 mA 45.6 mW

View file

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 496 B

Before After
Before After

View file

@ -37,7 +37,7 @@
* Adam Dunkels <adam@sics.se>
*/
/*
* salvopitru: example adapted to MB851.
* salvopitru: example adapted to mbxxx.
*/

View file

@ -0,0 +1,4 @@
#include "symbols.h"
const int symbols_nelts = 0;
const struct symbols symbols[] = {{0,0}};

View file

@ -0,0 +1,3 @@
#include "loader/symbols.h"
extern const struct symbols symbols[1];