1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-22 19:38:59 +02:00

Merge branch 'master' of projects.qi-hardware.com:ben-wpan

This commit is contained in:
Werner Almesberger 2015-05-22 04:52:35 -03:00
commit 9e9f65992c
9 changed files with 30 additions and 26 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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;
/*

View File

@ -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 */

View File

@ -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:

View File

@ -142,18 +142,17 @@ Here is an overview of the status of the various project elements:
<A href="http://downloads.qi-hardware.com/people/werner/wpan/fab/atben-smt-110330.tar.gz">SMT</A>
<TR><TH align="left">Firmware<TD bgcolor="#ffff00" align="center">
Finishing
<TD><A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/atusb/fw">source</A>
<TD><A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/atusb/fw">source</A>,
<A href="atusb-0.2.dfu">0.2 release</A>
<TR><TH align="left">Device driver<TD bgcolor="#ffff00" align="center">
In progress
<TD><A href="http://sourceforge.net/apps/trac/linux-zigbee/">linux-zigbee project</A>,
<A href="https://github.com/wpwrak/ben-wpan-linux">ben-wpan kernel branch</A>
<!--<A href="http://projects.qi-hardware.com/index.php/p/qi-kernel/source/tree/ben-wpan/drivers/ieee802154">ben-wpan kernel branch</A>-->
Finishing
<TD><A href="https://git.kernel.org/cgit/linux/kernel/git/bluetooth/bluetooth-next.git/">mainlining through linux-wpan (bluetooh-next tree)</A>
<TR><TH align="left">MAC layer<TD bgcolor="#ffff00" align="center">
In progress
<TD><A href="http://sourceforge.net/apps/trac/linux-zigbee/">linux-zigbee project
<TD><A href="http://wpan.cakelab.org/">linux-wpan project
<TR><TH align="left">IPv4 hack<TD bgcolor="#80ff80" align="center">Done
<TD><A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/tools/dirtpan">dirtpan</A>
<TR><TH align="left">6LoWPAN stack<TD bgcolor="#ff8080" align="center">To do
<TR><TH align="left">6LoWPAN stack<TD bgcolor="#ffff00" align="center">In progress
</TABLE>
<P>
@ -181,8 +180,9 @@ Shop links at Pulster:
<P>
<HR>
Last update: 2013-05-07&nbsp;&nbsp;
<A href="mailto:werner@almesberger.net"><I>Werner Almesberger</I></A>
Last update: 2015-05-21&nbsp;&nbsp;
<A href="mailto:werner@almesberger.net"><I>Werner Almesberger</I></A>,
<A href="mailto:stefan@datenfreihafen.org"><I>Stefan Schmidt</I></A>
<HR>
</BODY>
</HTML>

BIN
web/releases/atusb-0.2.dfu Executable file

Binary file not shown.