diff --git a/apps/powertrace/powertrace.c b/apps/powertrace/powertrace.c index a7de02bfb..fcbdffa84 100644 --- a/apps/powertrace/powertrace.c +++ b/apps/powertrace/powertrace.c @@ -90,8 +90,8 @@ powertrace_print(char *str) all_lpm = energest_type_time(ENERGEST_TYPE_LPM); all_transmit = energest_type_time(ENERGEST_TYPE_TRANSMIT); all_listen = energest_type_time(ENERGEST_TYPE_LISTEN); - all_idle_transmit = compower_idle_activity.transmit - last_idle_transmit; - all_idle_listen = compower_idle_activity.listen - last_idle_listen; + all_idle_transmit = compower_idle_activity.transmit; + all_idle_listen = compower_idle_activity.listen; cpu = all_cpu - last_cpu; lpm = all_lpm - last_lpm; @@ -267,7 +267,7 @@ input_sniffer(void) } /*---------------------------------------------------------------------------*/ static void -output_sniffer(void) +output_sniffer(int mac_status) { add_packet_stats(OUTPUT); } @@ -293,7 +293,7 @@ input_printsniffer(void) } /*---------------------------------------------------------------------------*/ static void -output_printsniffer(void) +output_printsniffer(int mac_status) { static int seqno = 0; sniffprint("O", seqno++); diff --git a/apps/shell/shell-rime-sniff.c b/apps/shell/shell-rime-sniff.c index 277ce26da..aa2d9cf75 100644 --- a/apps/shell/shell-rime-sniff.c +++ b/apps/shell/shell-rime-sniff.c @@ -114,7 +114,7 @@ input_sniffer(void) } /*---------------------------------------------------------------------------*/ static void -output_sniffer(void) +output_sniffer(int mac_status) { if(sniff_for_attributes) { sniff_attributes_output(SNIFFER_ATTRIBUTES_OUTPUT); diff --git a/core/net/mac/contikimac.c b/core/net/mac/contikimac.c index 82c027b07..7e4c3deb5 100644 --- a/core/net/mac/contikimac.c +++ b/core/net/mac/contikimac.c @@ -329,7 +329,10 @@ schedule_powercycle_fixed(struct rtimer *t, rtimer_clock_t fixed_time) static void powercycle_turn_radio_off(void) { +#if CONTIKIMAC_CONF_COMPOWER uint8_t was_on = radio_is_on; +#endif /* CONTIKIMAC_CONF_COMPOWER */ + if(we_are_sending == 0) { off(); #if CONTIKIMAC_CONF_COMPOWER @@ -633,35 +636,35 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr) } packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1); - if(WITH_CONTIKIMAC_HEADER) { - hdrlen = packetbuf_totlen(); - if(packetbuf_hdralloc(sizeof(struct hdr)) == 0) { - /* Failed to allocate space for contikimac header */ - PRINTF("contikimac: send failed, too large header\n"); - return MAC_TX_ERR_FATAL; - } - chdr = packetbuf_hdrptr(); - chdr->id = CONTIKIMAC_ID; - chdr->len = hdrlen; - - /* Create the MAC header for the data packet. */ - hdrlen = NETSTACK_FRAMER.create(); - if(hdrlen == 0) { - /* Failed to send */ - PRINTF("contikimac: send failed, too large header\n"); - packetbuf_hdr_remove(sizeof(struct hdr)); - return MAC_TX_ERR_FATAL; - } - hdrlen += sizeof(struct hdr); - } else { - /* Create the MAC header for the data packet. */ - hdrlen = NETSTACK_FRAMER.create(); - if(hdrlen == 0) { - /* Failed to send */ - PRINTF("contikimac: send failed, too large header\n"); - return MAC_TX_ERR_FATAL; - } +#if WITH_CONTIKIMAC_HEADER + hdrlen = packetbuf_totlen(); + if(packetbuf_hdralloc(sizeof(struct hdr)) == 0) { + /* Failed to allocate space for contikimac header */ + PRINTF("contikimac: send failed, too large header\n"); + return MAC_TX_ERR_FATAL; } + chdr = packetbuf_hdrptr(); + chdr->id = CONTIKIMAC_ID; + chdr->len = hdrlen; + + /* Create the MAC header for the data packet. */ + hdrlen = NETSTACK_FRAMER.create(); + if(hdrlen == 0) { + /* Failed to send */ + PRINTF("contikimac: send failed, too large header\n"); + packetbuf_hdr_remove(sizeof(struct hdr)); + return MAC_TX_ERR_FATAL; + } + hdrlen += sizeof(struct hdr); +#else + /* Create the MAC header for the data packet. */ + hdrlen = NETSTACK_FRAMER.create(); + if(hdrlen == 0) { + /* Failed to send */ + PRINTF("contikimac: send failed, too large header\n"); + return MAC_TX_ERR_FATAL; + } +#endif /* Make sure that the packet is longer or equal to the shortest diff --git a/core/net/sicslowpan.c b/core/net/sicslowpan.c index 74c0de07e..9bf349a4c 100644 --- a/core/net/sicslowpan.c +++ b/core/net/sicslowpan.c @@ -765,7 +765,7 @@ uncompress_hdr_hc06(uint16_t ip_len) SICSLOWPAN_IP_BUF->vtc = 0x60 | ((*hc06_ptr >> 2) & 0x0f); SICSLOWPAN_IP_BUF->tcflow = ((*hc06_ptr << 6) & 0xC0) | ((*hc06_ptr >> 2) & 0x30); SICSLOWPAN_IP_BUF->flow = 0; - hc06_ptr += 3; + hc06_ptr += 1; } else { /* Traffic class is compressed */ SICSLOWPAN_IP_BUF->vtc = 0x60; diff --git a/core/net/uip6.c b/core/net/uip6.c index b79005d38..1ae674b3b 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -474,6 +474,11 @@ uip_connect(uip_ipaddr_t *ripaddr, u16_t rport) conn->snd_nxt[2] = iss[2]; conn->snd_nxt[3] = iss[3]; + conn->rcv_nxt[0] = 0; + conn->rcv_nxt[1] = 0; + conn->rcv_nxt[2] = 0; + conn->rcv_nxt[3] = 0; + conn->initialmss = conn->mss = UIP_TCP_MSS; conn->len = 1; /* TCP length of the SYN is one. */ diff --git a/core/sys/compower.c b/core/sys/compower.c index dc465b80e..0872d6b39 100644 --- a/core/sys/compower.c +++ b/core/sys/compower.c @@ -63,6 +63,8 @@ compower_accumulate(struct compower_activity *e) static uint32_t last_listen, last_transmit; uint32_t listen, transmit; + energest_flush(); + listen = energest_type_time(ENERGEST_TYPE_LISTEN); e->listen += listen - last_listen; last_listen = listen; diff --git a/cpu/mc1322x/board/freescale-ncb.h b/cpu/mc1322x/board/freescale-ncb.h index d1b7b2f8d..5de8c8ef1 100644 --- a/cpu/mc1322x/board/freescale-ncb.h +++ b/cpu/mc1322x/board/freescale-ncb.h @@ -36,6 +36,10 @@ #ifndef BOARD_FREESCALE_NCB_H #define BOARD_FREESCALE_NCB_H +#define GPIO_LED_RED GPIO_23 +#define GPIO_LED_GREEN GPIO_24 +#define GPIO_LED_BLUE GPIO_25 + #define LED_RED 23 #define LED_GREEN 24 #define LED_BLUE 25 diff --git a/cpu/mc1322x/board/quahogcon.h b/cpu/mc1322x/board/quahogcon.h index 6de1ec76d..182e22c06 100644 --- a/cpu/mc1322x/board/quahogcon.h +++ b/cpu/mc1322x/board/quahogcon.h @@ -55,6 +55,10 @@ #define BUTTON2_OUT (0x1ULL << 22) #define BUTTON2_IN (0x1ULL << 26) +#define GPIO_LED_RED GPIO_12 +#define GPIO_LED_GREEN GPIO_21 +#define GPIO_LED_BLUE GPIO_35 + #define LED_RED 12 #define LED_GREEN 21 #define LED_BLUE 35 diff --git a/cpu/mc1322x/board/redbee-dev.h b/cpu/mc1322x/board/redbee-dev.h index c54488a14..d961ac081 100644 --- a/cpu/mc1322x/board/redbee-dev.h +++ b/cpu/mc1322x/board/redbee-dev.h @@ -36,6 +36,10 @@ #ifndef BOARD_REDBEE_DEV_H #define BOARD_REDBEE_DEV_H +#define GPIO_LED_RED GPIO_23 +#define GPIO_LED_GREEN GPIO_24 +#define GPIO_LED_BLUE GPIO_25 + #define LED_RED 23 #define LED_GREEN 24 #define LED_BLUE 25 diff --git a/cpu/mc1322x/board/redbee-r1.h b/cpu/mc1322x/board/redbee-r1.h index f63e3ea54..0bc6ef0c9 100644 --- a/cpu/mc1322x/board/redbee-r1.h +++ b/cpu/mc1322x/board/redbee-r1.h @@ -36,6 +36,10 @@ #ifndef BOARD_REDBEE_R1_H #define BOARD_REDBEE_R1_H +#define GPIO_LED_RED GPIO_08 +#define GPIO_LED_GREEN GPIO_09 +#define GPIO_LED_BLUE GPIO_10 + #define LED_RED 8 #define LED_GREEN 9 #define LED_BLUE 10 diff --git a/cpu/mc1322x/board/redbee-usb.h b/cpu/mc1322x/board/redbee-usb.h index 6ddb372b8..88ee4e8cf 100644 --- a/cpu/mc1322x/board/redbee-usb.h +++ b/cpu/mc1322x/board/redbee-usb.h @@ -36,6 +36,10 @@ #ifndef BOARD_REDBEE_USB_H #define BOARD_REDBEE_USB_H +#define GPIO_LED_RED GPIO_23 +#define GPIO_LED_GREEN GPIO_24 +#define GPIO_LED_BLUE GPIO_25 + #define LED_RED 23 #define LED_GREEN 24 #define LED_BLUE 25 diff --git a/cpu/mc1322x/lib/maca.c b/cpu/mc1322x/lib/maca.c index 46c882463..00735bc6a 100644 --- a/cpu/mc1322x/lib/maca.c +++ b/cpu/mc1322x/lib/maca.c @@ -72,6 +72,10 @@ #define CPL_TIMEOUT (2*128*CLK_PER_BYTE) #endif +#ifndef MACA_INSERT_ACK +#define MACA_INSERT_ACK 1 +#endif + #define reg(x) (*(volatile uint32_t *)(x)) int count_packets(void); @@ -534,6 +538,32 @@ void add_to_rx(volatile packet_t *p) { return; } +void insert_at_rx_head(volatile packet_t *p) { + safe_irq_disable(MACA); + + BOUND_CHECK(p); + + if(!p) { PRINTF("insert_at_rx_head passed packet 0\n\r"); return; } + p->offset = 1; /* first byte is the length */ + if(rx_head == 0) { + /* start a new queue if empty */ + rx_end = p; + rx_end->left = 0; rx_end->right = 0; + rx_head = rx_end; + } else { + rx_head->right = p; + p->left = rx_head; + rx_head = p; rx_head->left = 0; + } + +// print_packets("insert at rx head"); + irq_restore(); + if(bit_is_set(*NIPEND, INT_NUM_MACA)) { *INTFRC = (1 << INT_NUM_MACA); } + + return; +} + + void decode_status(void) { volatile uint32_t code; @@ -620,7 +650,7 @@ void maca_isr(void) { dma_rx->rx_time = *MACA_TIMESTAMP; /* check if received packet needs an ack */ - if(dma_rx->data[1] & 0x20) { + if(prm_mode == AUTOACK && (dma_rx->data[1] & 0x20)) { /* this wait is necessary to auto-ack */ volatile uint32_t wait_clk; wait_clk = *MACA_CLK + 200; @@ -652,6 +682,21 @@ void maca_isr(void) { /* PRINTF("maca action complete %d\n\r", get_field(*MACA_CONTROL,SEQUENCE)); */ if(last_post == TX_POST) { tx_head->status = get_field(*MACA_STATUS,CODE); +#if MACA_INSERT_ACK + if(tx_head->status == SUCCESS) { + static volatile packet_t *ack_p; + if(ack_p = get_free_packet()) { + ack_p->length = 3; + ack_p->offset = 1; + ack_p->data[0] = 3; + ack_p->data[1] = 0x02; + ack_p->data[2] = 0; + ack_p->data[3] = *MACA_TXSEQNR; + insert_at_rx_head(ack_p); + } + } +#endif + if(maca_tx_callback != 0) { maca_tx_callback(tx_head); } dma_tx = 0; free_tx_head(); diff --git a/cpu/mc1322x/src/default_lowlevel.c b/cpu/mc1322x/src/default_lowlevel.c index 27b35a889..8412663cb 100644 --- a/cpu/mc1322x/src/default_lowlevel.c +++ b/cpu/mc1322x/src/default_lowlevel.c @@ -78,11 +78,14 @@ void uart1_init(uint16_t inc, uint16_t mod, uint8_t samp) { if(samp == UCON_SAMP_16X) set_bit(*UART1_UCON,UCON_SAMP); - *GPIO_FUNC_SEL0 = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/ + + /* set GPIO15-14 to UART (UART1 TX and RX)*/ + GPIO->FUNC_SEL.GPIO_14 = 1; + GPIO->FUNC_SEL.GPIO_15 = 1; /* interrupt when there are this number or more bytes free in the TX buffer*/ *UART1_UTXCON = 16; - u1_tx_head = 0; u1_tx_tail = 0; + u1_tx_head = 0; u1_tx_tail = 0; /* enable UART1 interrupts in the interrupt controller */ enable_irq(UART1); diff --git a/cpu/mc1322x/tools/mc1322x-load.pl b/cpu/mc1322x/tools/mc1322x-load.pl index 40a171b9a..bfc1d1ffc 100755 --- a/cpu/mc1322x/tools/mc1322x-load.pl +++ b/cpu/mc1322x/tools/mc1322x-load.pl @@ -127,8 +127,8 @@ while(1) { my $i = 1; while(read(FILE, $c, 1)) { $i++; - usleep($first_delay) if ( $s == 0 ); - usleep($second_delay) if ( $s == 1 ); + usleep($first_delay) if ( $s == 0 ) && ($first_delay != 0); + usleep($second_delay) if ( $s == 1 ) && ($second_delay != 0); $ob->write($c); } } diff --git a/cpu/msp430/slip_uart0.c b/cpu/msp430/slip_uart0.c index 63afd3835..cf91913a0 100644 --- a/cpu/msp430/slip_uart0.c +++ b/cpu/msp430/slip_uart0.c @@ -33,10 +33,14 @@ * Machine dependent MSP430 SLIP routines for UART0. */ +#include "contiki-conf.h" + +#ifdef __IAR_SYSTEMS_ICC__ +#include +#else #include #include - -#include "contiki.h" +#endif #include "dev/slip.h" #include "dev/uart0.h" diff --git a/cpu/stm32w108/Makefile.stm32w108 b/cpu/stm32w108/Makefile.stm32w108 index 1f27653a1..494de3a31 100644 --- a/cpu/stm32w108/Makefile.stm32w108 +++ b/cpu/stm32w108/Makefile.stm32w108 @@ -163,13 +163,12 @@ endif - -FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/linux/stm32w_flasher +FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/stm32w_flasher # Check if we are running under Windows ifdef OS ifneq (,$(findstring Windows,$(OS))) - FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/win/stm32w_flasher + FLASHER = $(CONTIKI)/tools/stm32w/stm32w_flasher/stm32w_flasher.exe endif endif diff --git a/examples/rime/example-meshconn.c b/examples/rime/example-meshconn.c deleted file mode 100644 index c46d393ec..000000000 --- a/examples/rime/example-meshconn.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2007, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - * - * $Id: example-meshconn.c,v 1.3 2010/01/14 14:32:22 joxe Exp $ - */ - -/** - * \file - * A brief description of what this file is. - * \author - * Adam Dunkels - */ - -#include "contiki.h" -#include "net/rime.h" -#include "net/rime/meshconn.h" - -#include "dev/button-sensor.h" - -#include "dev/leds.h" - -#include - -static struct meshconn_conn meshconn; -/*---------------------------------------------------------------------------*/ -PROCESS(test_meshconn_process, "Meshconnconn test"); -AUTOSTART_PROCESSES(&test_meshconn_process); -/*---------------------------------------------------------------------------*/ -static void -connected(struct meshconn_conn *c) -{ - printf("connected\n"); -} -static void -closed(struct meshconn_conn *c) -{ - printf("closed\n"); -} -static void -reset(struct meshconn_conn *c) -{ - printf("reset\n"); -} -static void -timedout(struct meshconn_conn *c) -{ - printf("timedout\n"); -} -static void -recv(struct meshconn_conn *c) -{ - printf("Data received from %.*s (%d)\n", - packetbuf_datalen(), (char *)packetbuf_dataptr(), packetbuf_datalen()); - - /* meshconn_send(&meshconn, from);*/ -} - -const static struct meshconn_callbacks callbacks = { connected, - recv, - closed, - timedout, - reset }; -/*---------------------------------------------------------------------------*/ -PROCESS_THREAD(test_meshconn_process, ev, data) -{ - PROCESS_EXITHANDLER(meshconn_close(&meshconn);) - PROCESS_BEGIN(); - - meshconn_open(&meshconn, 128, &callbacks); - - while(1) { - rimeaddr_t addr; - static struct etimer et; - - etimer_set(&et, CLOCK_SECOND * 4); - PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et) || - (ev == sensors_event && data == &button_sensor)); - - printf("Button\n"); - - /* - * Send a message containing "Hej" (3 characters) to node number - * 6. - */ - - addr.u8[0] = 53; - addr.u8[1] = 0; - meshconn_connect(&meshconn, addr); - - packetbuf_copyfrom("Hej", 3); - meshconn_send(&meshconn, &addr); - } - PROCESS_END(); -} -/*---------------------------------------------------------------------------*/ diff --git a/platform/avr-atmega128rfa1/contiki-main.c b/platform/avr-atmega128rfa1/contiki-main.c index b20608adc..562a53855 100644 --- a/platform/avr-atmega128rfa1/contiki-main.c +++ b/platform/avr-atmega128rfa1/contiki-main.c @@ -473,7 +473,7 @@ if ((rtime%STAMPS)==0) { #endif rtime+=1; -#if PINGS +#if PINGS && UIP_CONF_IPV6 extern void raven_ping6(void); if ((rtime%PINGS)==1) { PRINTA("**Ping\n"); @@ -481,7 +481,7 @@ if ((rtime%PINGS)==1) { } #endif -#if ROUTES +#if ROUTES && UIP_CONF_IPV6 if ((rtime%ROUTES)==2) { extern uip_ds6_nbr_t uip_ds6_nbr_cache[]; diff --git a/platform/msb430/apps/acc-test.c b/platform/msb430/apps/acc-test.c index 17438afd2..fe5be0ab8 100644 --- a/platform/msb430/apps/acc-test.c +++ b/platform/msb430/apps/acc-test.c @@ -33,8 +33,9 @@ #include "contiki.h" #include "net/rime.h" -#include "dev/sd/sd.h" +#include "dev/sd.h" +#include #include /*---------------------------------------------------------------------------*/ diff --git a/platform/msb430/dev/sd-arch.c b/platform/msb430/dev/sd-arch.c index 02f5666f0..c3a2d8160 100644 --- a/platform/msb430/dev/sd-arch.c +++ b/platform/msb430/dev/sd-arch.c @@ -40,6 +40,7 @@ #include "contiki.h" #include "msb430-uart1.h" #include "sd-arch.h" +#include #define SPI_IDLE 0xff diff --git a/platform/msb430/dev/sd.c b/platform/msb430/dev/sd.c index b1ef4c21b..408659642 100644 --- a/platform/msb430/dev/sd.c +++ b/platform/msb430/dev/sd.c @@ -41,6 +41,7 @@ #include "sd.h" #include "sd-arch.h" +#include #include #define DEBUG 0 diff --git a/platform/redbee-econotag/contiki-conf.h b/platform/redbee-econotag/contiki-conf.h index 92c2ef1b3..1a04ba49a 100644 --- a/platform/redbee-econotag/contiki-conf.h +++ b/platform/redbee-econotag/contiki-conf.h @@ -85,6 +85,7 @@ #define USE_32KHZ_XTAL 0 #define BLOCKING_TX 1 +#define MACA_AUTOACK 1 #define NULLRDC_CONF_802154_AUTOACK_HW 1 #define USE_WDT 0 diff --git a/platform/redbee-econotag/contiki-mc1322x-main.c b/platform/redbee-econotag/contiki-mc1322x-main.c index e49282d65..09c6630b5 100644 --- a/platform/redbee-econotag/contiki-mc1322x-main.c +++ b/platform/redbee-econotag/contiki-mc1322x-main.c @@ -436,7 +436,7 @@ main(void) PRINTF("setting short mac 0x%04x\n\r", *MACA_MAC16ADDR); PRINTF("setting long mac 0x%08x_%08x\n\r", *MACA_MAC64HI, *MACA_MAC64LO); -#if NULLRDC_CONF_802154_AUTOACK_HW +#if MACA_AUTOACK set_prm_mode(AUTOACK); #endif diff --git a/platform/sky/platform-conf.h b/platform/sky/platform-conf.h index 8ab7fdc23..5ddb30cb0 100644 --- a/platform/sky/platform-conf.h +++ b/platform/sky/platform-conf.h @@ -47,6 +47,9 @@ /* Platform TMOTE_SKY */ #define TMOTE_SKY 1 +#define PLATFORM_HAS_LEDS 1 +#define PLATFORM_HAS_BUTTON 1 + /* CPU target speed in Hz */ #define F_CPU 3900000uL /*2457600uL*/ diff --git a/tools/stm32w/stm32w_flasher/CompositeForSTM32W.bin b/tools/stm32w/stm32w_flasher/CompositeForSTM32W.bin new file mode 100644 index 000000000..9548d9c26 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/CompositeForSTM32W.bin differ diff --git a/tools/stm32w/stm32w_flasher/win/FTD2XX.dll b/tools/stm32w/stm32w_flasher/FTD2XX.dll similarity index 100% rename from tools/stm32w/stm32w_flasher/win/FTD2XX.dll rename to tools/stm32w/stm32w_flasher/FTD2XX.dll diff --git a/tools/stm32w/stm32w_flasher/JlinkARM.DLL b/tools/stm32w/stm32w_flasher/JlinkARM.DLL new file mode 100644 index 000000000..e3495631d Binary files /dev/null and b/tools/stm32w/stm32w_flasher/JlinkARM.DLL differ diff --git a/tools/stm32w/stm32w_flasher/README b/tools/stm32w/stm32w_flasher/README new file mode 100644 index 000000000..9eeb8c654 --- /dev/null +++ b/tools/stm32w/stm32w_flasher/README @@ -0,0 +1,26 @@ +STM32W Flasher 2.0.0b2 for Linux + +A programmer for development boards based on STM32W108 microcontroller. +It works with the following boards (with FT232R or STM32F103 as USB-serial converter): +MB850, MB851, MB950, MB951, MB954 + + +- Installation + + Installation is not required. + Hal package has to be present in your system. + + +- Usage + + Run the program with -h option for usage info. + + +- Notes + + This program may require root privileges when programming boards with + FT232R chip. + In Ubuntu, if you want to flash using Make, type 'sudo -s' before that. + + This version of STM32W Flasher does not support jlink yet. + diff --git a/tools/stm32w/stm32w_flasher/_ctypes.pyd b/tools/stm32w/stm32w_flasher/_ctypes.pyd new file mode 100644 index 000000000..8eb8847f1 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/_ctypes.pyd differ diff --git a/tools/stm32w/stm32w_flasher/_socket.pyd b/tools/stm32w/stm32w_flasher/_socket.pyd new file mode 100644 index 000000000..ef1aab213 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/_socket.pyd differ diff --git a/tools/stm32w/stm32w_flasher/_ssl.pyd b/tools/stm32w/stm32w_flasher/_ssl.pyd new file mode 100644 index 000000000..01a9c6033 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/_ssl.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/bz2.pyd b/tools/stm32w/stm32w_flasher/bz2.pyd similarity index 68% rename from tools/stm32w/stm32w_flasher/win/bz2.pyd rename to tools/stm32w/stm32w_flasher/bz2.pyd index 7ab1cbb6e..3879840e0 100644 Binary files a/tools/stm32w/stm32w_flasher/win/bz2.pyd and b/tools/stm32w/stm32w_flasher/bz2.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/d2xx._d2xx.pyd b/tools/stm32w/stm32w_flasher/d2xx._d2xx.pyd similarity index 100% rename from tools/stm32w/stm32w_flasher/win/d2xx._d2xx.pyd rename to tools/stm32w/stm32w_flasher/d2xx._d2xx.pyd diff --git a/tools/stm32w/stm32w_flasher/linux/README b/tools/stm32w/stm32w_flasher/linux/README deleted file mode 100644 index 3c4a0844a..000000000 --- a/tools/stm32w/stm32w_flasher/linux/README +++ /dev/null @@ -1,22 +0,0 @@ -STM32W Flasher 1.1.0b1 for Linux - -A programmer for MB851 development boards based on STM32W108 microcontroller. - -- Installation - - Installation is not required. - Hal package has to be present in your system. - - -- Usage - - Run the program with -h option for usage info. - - -- Notes - - This program may require root privileges. - In Ubuntu, if you want to flash using Make, type 'sudo -s' before that. - - This version of STM32W Flasher does not support jlink yet. - diff --git a/tools/stm32w/stm32w_flasher/linux/stm32w_flasher b/tools/stm32w/stm32w_flasher/linux/stm32w_flasher deleted file mode 100644 index 42d38d681..000000000 Binary files a/tools/stm32w/stm32w_flasher/linux/stm32w_flasher and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/main_rfbl.s37 b/tools/stm32w/stm32w_flasher/main_rfbl.s37 new file mode 100644 index 000000000..9a2f6ea11 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/main_rfbl.s37 differ diff --git a/tools/stm32w/stm32w_flasher/pyexpat.pyd b/tools/stm32w/stm32w_flasher/pyexpat.pyd new file mode 100644 index 000000000..4857c0479 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/pyexpat.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/python26.dll b/tools/stm32w/stm32w_flasher/python26.dll similarity index 51% rename from tools/stm32w/stm32w_flasher/win/python26.dll rename to tools/stm32w/stm32w_flasher/python26.dll index 16b929681..d3533b542 100644 Binary files a/tools/stm32w/stm32w_flasher/win/python26.dll and b/tools/stm32w/stm32w_flasher/python26.dll differ diff --git a/tools/stm32w/stm32w_flasher/win/pywintypes26.dll b/tools/stm32w/stm32w_flasher/pywintypes26.dll similarity index 100% rename from tools/stm32w/stm32w_flasher/win/pywintypes26.dll rename to tools/stm32w/stm32w_flasher/pywintypes26.dll diff --git a/tools/stm32w/stm32w_flasher/select.pyd b/tools/stm32w/stm32w_flasher/select.pyd new file mode 100644 index 000000000..2b90ceadc Binary files /dev/null and b/tools/stm32w/stm32w_flasher/select.pyd differ diff --git a/tools/stm32w/stm32w_flasher/stm32w_flasher b/tools/stm32w/stm32w_flasher/stm32w_flasher new file mode 100755 index 000000000..883f9d60a Binary files /dev/null and b/tools/stm32w/stm32w_flasher/stm32w_flasher differ diff --git a/tools/stm32w/stm32w_flasher/win/stm32w_flasher.exe b/tools/stm32w/stm32w_flasher/stm32w_flasher.exe similarity index 77% rename from tools/stm32w/stm32w_flasher/win/stm32w_flasher.exe rename to tools/stm32w/stm32w_flasher/stm32w_flasher.exe index b3c5096ce..21ce02820 100644 Binary files a/tools/stm32w/stm32w_flasher/win/stm32w_flasher.exe and b/tools/stm32w/stm32w_flasher/stm32w_flasher.exe differ diff --git a/tools/stm32w/stm32w_flasher/win/unicodedata.pyd b/tools/stm32w/stm32w_flasher/unicodedata.pyd similarity index 99% rename from tools/stm32w/stm32w_flasher/win/unicodedata.pyd rename to tools/stm32w/stm32w_flasher/unicodedata.pyd index 4e4632535..18a996f55 100644 Binary files a/tools/stm32w/stm32w_flasher/win/unicodedata.pyd and b/tools/stm32w/stm32w_flasher/unicodedata.pyd differ diff --git a/tools/stm32w/stm32w_flasher/win/w9xpopen.exe b/tools/stm32w/stm32w_flasher/w9xpopen.exe similarity index 99% rename from tools/stm32w/stm32w_flasher/win/w9xpopen.exe rename to tools/stm32w/stm32w_flasher/w9xpopen.exe index 139f6dd1d..233538ff7 100644 Binary files a/tools/stm32w/stm32w_flasher/win/w9xpopen.exe and b/tools/stm32w/stm32w_flasher/w9xpopen.exe differ diff --git a/tools/stm32w/stm32w_flasher/win/JlinkARM.DLL b/tools/stm32w/stm32w_flasher/win/JlinkARM.DLL deleted file mode 100644 index aab92aa21..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/JlinkARM.DLL and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/_ctypes.pyd b/tools/stm32w/stm32w_flasher/win/_ctypes.pyd deleted file mode 100644 index c7743c75f..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/_ctypes.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/_socket.pyd b/tools/stm32w/stm32w_flasher/win/_socket.pyd deleted file mode 100644 index 4d07b365d..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/_socket.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/_ssl.pyd b/tools/stm32w/stm32w_flasher/win/_ssl.pyd deleted file mode 100644 index f1c538f5e..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/_ssl.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/select.pyd b/tools/stm32w/stm32w_flasher/win/select.pyd deleted file mode 100644 index 192197429..000000000 Binary files a/tools/stm32w/stm32w_flasher/win/select.pyd and /dev/null differ diff --git a/tools/stm32w/stm32w_flasher/win/win32api.pyd b/tools/stm32w/stm32w_flasher/win32api.pyd similarity index 100% rename from tools/stm32w/stm32w_flasher/win/win32api.pyd rename to tools/stm32w/stm32w_flasher/win32api.pyd diff --git a/tools/stm32w/stm32w_flasher/win32pipe.pyd b/tools/stm32w/stm32w_flasher/win32pipe.pyd new file mode 100644 index 000000000..580809803 Binary files /dev/null and b/tools/stm32w/stm32w_flasher/win32pipe.pyd differ diff --git a/tools/stm32w/wpcapslip6/wpcapslip6.c b/tools/stm32w/wpcapslip6/wpcapslip6.c index 730ec3a26..a0f22ce65 100755 --- a/tools/stm32w/wpcapslip6/wpcapslip6.c +++ b/tools/stm32w/wpcapslip6/wpcapslip6.c @@ -938,7 +938,7 @@ bool validIPAddr(const char * ip_addr, int prefix_len) char tmp_addr[INET6_ADDRSTRLEN], tmp2_addr[INET6_ADDRSTRLEN]; char * substr; - strncpy(tmp_addr, br_prefix, INET6_ADDRSTRLEN); + strncpy(tmp_addr, ip_addr, INET6_ADDRSTRLEN); strtok(tmp_addr,"/"); @@ -985,7 +985,7 @@ main(int argc, char **argv) osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&osVersionInfo); - while((c = getopt(argc, argv, "B:D:hs:c:ra:p:v:tb:")) != -1) { + while((c = getopt(argc, argv, "B:D:hs:c:ra:p:vtb:")) != -1) { switch (c) { case 'B': baudrate = atoi(optarg); diff --git a/tools/stm32w/wpcapslip6/wpcapslip6.exe b/tools/stm32w/wpcapslip6/wpcapslip6.exe index 84dbcc768..80fed7ae8 100755 Binary files a/tools/stm32w/wpcapslip6/wpcapslip6.exe and b/tools/stm32w/wpcapslip6/wpcapslip6.exe differ diff --git a/tools/tunslip6.c b/tools/tunslip6.c index 2b1c28acf..0dd6c37d0 100644 --- a/tools/tunslip6.c +++ b/tools/tunslip6.c @@ -33,6 +33,9 @@ * */ + /* Below define allows importing saved output into Wireshark as "Raw IP" packet type */ +#define WIRESHARK_IMPORT_FORMAT 1 + #include #include #include @@ -250,15 +253,17 @@ serial_to_tun(FILE *inslip, int outfd) if (timestamp) stamptime(); printf("Packet from SLIP of length %d - write TUN\n", inbufptr); if (verbose>4) { +#if WIRESHARK_IMPORT_FORMAT + printf("0000"); + for(i = 0; i < inbufptr; i++) printf(" %02x",uip.inbuf[i]); +#else printf(" "); for(i = 0; i < inbufptr; i++) { printf("%02x", uip.inbuf[i]); - if((i & 3) == 3) { - printf(" "); - } - if((i & 15) == 15) - printf("\n "); + if((i & 3) == 3) printf(" "); + if((i & 15) == 15) printf("\n "); } +#endif printf("\n"); } } @@ -383,15 +388,17 @@ write_to_serial(int outfd, void *inbuf, int len) if (timestamp) stamptime(); printf("Packet from TUN of length %d - write SLIP\n", len); if (verbose>4) { +#if WIRESHARK_IMPORT_FORMAT + printf("0000"); + for(i = 0; i < len; i++) printf(" %02x", p[i]); +#else printf(" "); for(i = 0; i < len; i++) { printf("%02x", p[i]); - if((i & 3) == 3) { - printf(" "); - } - if((i & 15) == 15) - printf("\n "); + if((i & 3) == 3) printf(" "); + if((i & 15) == 15) printf("\n "); } +#endif printf("\n"); } }