diff --git a/atusb/fw/Makefile b/atusb/fw/Makefile index 653cc56..fb7d9a4 100644 --- a/atusb/fw/Makefile +++ b/atusb/fw/Makefile @@ -28,7 +28,12 @@ OBJCOPY = $(AVR_PREFIX)objcopy #OBJDUMP = $(AVR_PREFIX)objdump SIZE = $(AVR_PREFIX)size -USB_ID = 20b7:1540 +# BCD notion is 0xJJMM with JJ being major and MM being minor. Thus 0x0020 is +# version 0.2 */ +USB_BCD_VERSION = 0020 +USB_VENDOR_ID = 20b7 +USB_PRODUCT_ID = 1540 +USB_ID = $(USB_VENDOR_ID):$(USB_PRODUCT_ID) OBJS = atusb.o board.o board_app.o sernum.o spi.o descr.o ep0.o \ dfu_common.o usb.o app-atu2.o mac.o @@ -80,6 +85,11 @@ boot.elf: $(BOOT_OBJS) $(BUILD) $(OBJCOPY) -j .text -j .data -O binary $< $@ @echo "build #`cat .version`, `ls -l $@`" +%.dfu: %.bin + cp $(NAME).bin $(NAME).dfu + dfu-suffix -a $(NAME).dfu -d 0x$(USB_BCD_VERSION) \ + -p 0x$(USB_PRODUCT_ID) -v 0x$(USB_VENDOR_ID) + %.hex: %.elf $(BUILD) $(OBJCOPY) -j .text -j .data -O ihex $< $@ @echo "Size: `$(SIZE) -A boot.hex | sed '/Total */s///p;d'` B" @@ -87,7 +97,7 @@ boot.elf: $(BOOT_OBJS) # ----- Cleanup --------------------------------------------------------------- clean: - rm -f $(NAME).bin $(NAME).elf + rm -f $(NAME).bin $(NAME).elf $(NAME).dfu rm -f $(OBJS) $(OBJS:.o=.d) rm -f boot.hex boot.elf rm -f $(BOOT_OBJS) $(BOOT_OBJS:.o=.d) @@ -177,8 +187,8 @@ prog-read: ssh $(HOST) avrdude -F -p $(CHIP) -c nanonote_atusb \ -U flash:r:mcu.bin:r -dfu: $(NAME).bin - dfu-util -d $(USB_ID) -D $(NAME).bin +dfu: $(NAME).dfu + dfu-util -d $(USB_ID) -D $(NAME).dfu update: $(NAME).bin -atrf-reset -a diff --git a/atusb/fw/include/atusb/ep0.h b/atusb/fw/include/atusb/ep0.h index d21878f..8b0ab9a 100644 --- a/atusb/fw/include/atusb/ep0.h +++ b/atusb/fw/include/atusb/ep0.h @@ -22,10 +22,11 @@ * * 0.0 initial release * 0.1 addition of ATUSB_TEST + * 0.2 First public release */ #define EP0ATUSB_MAJOR 0 /* EP0 protocol, major revision */ -#define EP0ATUSB_MINOR 1 /* EP0 protocol, minor revision */ +#define EP0ATUSB_MINOR 2 /* EP0 protocol, minor revision */ #define HW_TYPE_100813 0 /* 2010-08-13 */ #define HW_TYPE_101216 1 /* 2010-12-16 */ diff --git a/atusb/fw/mac.c b/atusb/fw/mac.c index 2344b99..08ed00a 100644 --- a/atusb/fw/mac.c +++ b/atusb/fw/mac.c @@ -182,7 +182,7 @@ bool mac_rx(int on) if (on) { mac_irq = handle_irq; reg_read(REG_IRQ_STATUS); - change_state(TRX_CMD_RX_ON); + change_state(TRX_CMD_RX_AACK_ON); } else { mac_irq = NULL; change_state(TRX_CMD_FORCE_TRX_OFF); @@ -232,9 +232,9 @@ static void do_tx(void *user) /* * Wait until we reach BUSY_TX, so that we command the transition to - * RX_ON which will be executed upon TX completion. + * RX_AACK_ON which will be executed upon TX completion. */ - change_state(TRX_CMD_RX_ON); + change_state(TRX_CMD_RX_AACK_ON); } diff --git a/atusb/fw/usb/atu2.c b/atusb/fw/usb/atu2.c index 409b8e0..e030bfa 100644 --- a/atusb/fw/usb/atu2.c +++ b/atusb/fw/usb/atu2.c @@ -247,12 +247,6 @@ void usb_reset(void) } -void usb_enable_bus_reset(void) -{ - UDCON |= 1 << RSTCPU; /* reset CPU on bus reset */ -} - - void usb_init(void) { USBCON |= 1 << FRZCLK; /* freeze the clock */ @@ -269,6 +263,7 @@ void usb_init(void) UDCON &= ~(1 << DETACH); /* attach the pull-up */ UDIEN = 1 << EORSTE; /* enable device interrupts */ +// UDCON |= 1 << RSTCPU; /* reset CPU on bus reset */ ep_init(); } diff --git a/atusb/fw/usb/usb.c b/atusb/fw/usb/usb.c index 4ced2a0..543d8c2 100644 --- a/atusb/fw/usb/usb.c +++ b/atusb/fw/usb/usb.c @@ -119,7 +119,6 @@ bool handle_setup(const struct setup_request *setup) case TO_DEVICE(SET_CONFIGURATION): if (setup->wValue != config_descriptor[5]) return 0; - usb_enable_bus_reset(); break; /* diff --git a/atusb/fw/usb/usb.h b/atusb/fw/usb/usb.h index 32d8ad7..6428ccd 100644 --- a/atusb/fw/usb/usb.h +++ b/atusb/fw/usb/usb.h @@ -182,7 +182,6 @@ bool handle_setup(const struct setup_request *setup); void set_addr(uint8_t addr); void usb_ep_change(struct ep_descr *ep); void usb_reset(void); -void usb_enable_bus_reset(void); void usb_init(void); #endif /* !USB_H */ diff --git a/web/Makefile b/web/Makefile index a37275d..67124fc 100644 --- a/web/Makefile +++ b/web/Makefile @@ -8,7 +8,7 @@ GEN=atben-pcba-small.jpg atusb-pcba-small.jpg \ all: $(GEN) upload: index.html zoom.html $(GEN) $(DL) - rsync -e ssh index.html zoom.html $(DL) $(GEN) \ + rsync -e ssh -av index.html zoom.html releases/ $(DL) $(GEN) \ www-data@downloads.qi-hardware.com:werner/wpan/web/ 800px-Atben_atusb_prod_03.jpg: diff --git a/web/index.html b/web/index.html index b2ca0d6..7a24797 100644 --- a/web/index.html +++ b/web/index.html @@ -142,18 +142,17 @@ Here is an overview of the status of the various project elements: SMT Firmware Finishing - source + source, + 0.2 release Device driver - In progress - linux-zigbee project, - ben-wpan kernel branch - + Finishing + mainlining through linux-wpan (bluetooh-next tree) MAC layer In progress - linux-zigbee project + linux-wpan project IPv4 hackDone dirtpan - 6LoWPAN stackTo do + 6LoWPAN stackIn progress

@@ -181,8 +180,9 @@ Shop links at Pulster:


-Last update: 2013-05-07   -Werner Almesberger +Last update: 2015-05-21   +Werner Almesberger, +Stefan Schmidt
diff --git a/web/releases/atusb-0.2.dfu b/web/releases/atusb-0.2.dfu new file mode 100755 index 0000000..a5cd383 Binary files /dev/null and b/web/releases/atusb-0.2.dfu differ