49 #include PLATFORM_HEADER
50 #include "hal/error.h"
60 #include "dev/watchdog.h"
62 #include "dev/button-sensor.h"
63 #include "dev/temperature-sensor.h"
64 #include "dev/acc-sensor.h"
66 #include "dev/uart1.h"
76 #include "net/ipv6/uip-ds6.h"
82 #define PRINTF(...) printf(__VA_ARGS__)
83 #define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
84 #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",lladdr.u8[0], lladdr.u8[1], lladdr.u8[2], lladdr.u8[3],lladdr.u8[4], lladdr.u8[5], lladdr.u8[6], lladdr.u8[7])
87 #define PRINT6ADDR(addr)
88 #define PRINTLLADDR(addr)
93 PROCINIT(&tcpip_process, &sensors_process);
95 PROCINIT(&sensors_process);
96 #warning "No TCP/IP process!"
103 #define DEFAULT_RADIO_CCA_THRESHOLD -77
114 uint8_t *stm32w_eui64 = ST_RadioGetEui64();
119 for(c = 0; c < 8; c++) {
120 eui64.u8[c] = stm32w_eui64[7 - c];
134 printf(
"Rime started with address ");
135 for(i = 0; i <
sizeof(linkaddr_t) - 1; i++) {
158 PRINTF(
"\r\nStarting ");
159 PRINTF(CONTIKI_VERSION_STRING);
160 PRINTF(
" on %s\r\n", boardDescription->name);
161 boardPrintStringDescription();
171 #if WITH_SERIAL_LINE_INPUT
172 uart1_set_input(serial_line_input_byte);
186 printf(
"%s %s, channel check rate %lu Hz\n",
187 NETSTACK_MAC.name, NETSTACK_RDC.name,
188 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
189 NETSTACK_RDC.channel_check_interval()));
190 printf(
"802.15.4 PAN ID 0x%x, EUI-%d:",
193 printf(
", radio channel %u\n", RF_CHANNEL);
198 ENERGEST_ON(ENERGEST_TYPE_CPU);
207 ST_RadioSetEdCcaThreshold(DEFAULT_RADIO_CCA_THRESHOLD);
209 autostart_start(autostart_processes);
211 printf(
"Tentative link-local IPv6 address ");
215 lladdr = uip_ds6_get_link_local(-1);
216 for(i = 0; i < 7; ++i) {
217 printf(
"%02x%02x:", lladdr->ipaddr.u8[i * 2],
218 lladdr->ipaddr.u8[i * 2 + 1]);
220 printf(
"%02x%02x\n", lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
224 if(!UIP_CONF_IPV6_RPL) {
229 uip_ds6_addr_add(&ipaddr, 0, ADDR_TENTATIVE);
230 printf(
"Tentative global IPv6 address ");
231 for(i = 0; i < 7; ++i) {
233 ipaddr.u8[i * 2], ipaddr.u8[i * 2 + 1]);
236 ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
254 ENERGEST_OFF(ENERGEST_TYPE_CPU);
256 ENERGEST_ON(ENERGEST_TYPE_LPM);
261 ENERGEST_OFF(ENERGEST_TYPE_LPM);
262 ENERGEST_ON(ENERGEST_TYPE_CPU);