fx2lib-devel Mailing List for fx2lib (Page 6)
Status: Beta
Brought to you by:
mulicheng
This list is closed, nobody may subscribe to it.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(16) |
Feb
(2) |
Mar
(35) |
Apr
(4) |
May
(9) |
Jun
(5) |
Jul
(20) |
Aug
(2) |
Sep
(10) |
Oct
(14) |
Nov
(12) |
Dec
(11) |
2010 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(4) |
Feb
(10) |
Mar
(25) |
Apr
|
May
|
Jun
(4) |
Jul
(11) |
Aug
(2) |
Sep
(11) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
(10) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Dennis M. <de...@ub...> - 2009-12-01 13:24:16
|
The latest git version is close to a 0.2 release. I have a few website updates and documentation things I'm going to change before a final 0.2 release but it is definitely worth upgrading. We're using 0.2 in a number of released firmwares in our products and it is working quite well for us. -Dennis On Dec 1, 2009, at 2:36 AM, S S wrote: > Hi Dennis, > > No I am still using the 0.1 version. Is the version in git ready? > I have installed Python 2.5 but still get the same error. > My device doesn't have a matching Vid/Pid so I'll try that too. > > Thanks, > > Sébastien > > > From: de...@ub... > > To: fx2...@li... > > Date: Mon, 30 Nov 2009 17:49:48 -0700 > > Subject: Re: [Fx2lib-devel] Error running load.py > > > > I'll have to debug on python 2.6 and see if there is an issue. Are > > you using the latest version from git? There are a lot of changes > > since the release 0.1. > > > > -Dennis > > > > On Nov 30, 2009, at 11:52 AM, S S wrote: > > > > > Hi Dennis & Al, > > > > > > When I try to run load.py on linux I get the following error: > > > > > > sebastien@sebastien-laptop:~/workspace/OpenSourceFx2/fx2lib/ > examples/ > > > i2c$ python load.py > > > Traceback (most recent call last): > > > File "load.py", line 17, in <module> > > > from fx2load import * > > > File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", > > > line 21, in <module> > > > f=fx2.fx2() > > > AttributeError: type object 'fx2' has no attribute 'fx2' > > > > > > I have no idea if I am doing something stupid or if my setup is > > > wrong somehow. > > > I am using python 2.6 rather than 2.5 but I assume the setup > script > > > has detected that as the path for the __init__.py file seems to > > > imply (I didn't get any complaint about it). > > > I get the same error if I try to import fx2load from the python > > > terminal window: > > > > > > >> from fx2load import * > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", > > > line 21, in <module> > > > f=fx2.fx2() > > > AttributeError: type object 'fx2' has no attribute 'fx2' > > > > > > > > > Any clue would be much appreciated. > > > > > > Thanks, > > > > > > Sébastien > > > > > > View your other email accounts from your Hotmail inbox. Add them > > > now. > > > > ------------------------------------------------------------------------------ > > > Let Crystal Reports handle the reporting - Free Crystal Reports > 2008 > > > 30-Day > > > trial. Simplify your report design, integration and deployment - > and > > > focus on > > > what you do best, core application coding. Discover what's new > with > > > Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________ > > > Fx2lib-devel mailing list > > > Fx2...@li... > > > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > > > > > > > ------------------------------------------------------------------------------ > > Join us December 9, 2009 for the Red Hat Virtual Experience, > > a free event focused on virtualization and cloud computing. > > Attend in-depth sessions from your desk. Your couch. Anywhere. > > http://p.sf.net/sfu/redhat-sfdev2dev > > _______________________________________________ > > Fx2lib-devel mailing list > > Fx2...@li... > > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > > Use Hotmail to send and receive mail from your different email > accounts. Find out how. > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev_______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel |
From: S S <ss...@ho...> - 2009-12-01 09:36:40
|
Hi Dennis, No I am still using the 0.1 version. Is the version in git ready? I have installed Python 2.5 but still get the same error. My device doesn't have a matching Vid/Pid so I'll try that too. Thanks, Sébastien > From: de...@ub... > To: fx2...@li... > Date: Mon, 30 Nov 2009 17:49:48 -0700 > Subject: Re: [Fx2lib-devel] Error running load.py > > I'll have to debug on python 2.6 and see if there is an issue. Are > you using the latest version from git? There are a lot of changes > since the release 0.1. > > -Dennis > > On Nov 30, 2009, at 11:52 AM, S S wrote: > > > Hi Dennis & Al, > > > > When I try to run load.py on linux I get the following error: > > > > sebastien@sebastien-laptop:~/workspace/OpenSourceFx2/fx2lib/examples/ > > i2c$ python load.py > > Traceback (most recent call last): > > File "load.py", line 17, in <module> > > from fx2load import * > > File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", > > line 21, in <module> > > f=fx2.fx2() > > AttributeError: type object 'fx2' has no attribute 'fx2' > > > > I have no idea if I am doing something stupid or if my setup is > > wrong somehow. > > I am using python 2.6 rather than 2.5 but I assume the setup script > > has detected that as the path for the __init__.py file seems to > > imply (I didn't get any complaint about it). > > I get the same error if I try to import fx2load from the python > > terminal window: > > > > >> from fx2load import * > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", > > line 21, in <module> > > f=fx2.fx2() > > AttributeError: type object 'fx2' has no attribute 'fx2' > > > > > > Any clue would be much appreciated. > > > > Thanks, > > > > Sébastien > > > > View your other email accounts from your Hotmail inbox. Add them > > now. > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > > 30-Day > > trial. Simplify your report design, integration and deployment - and > > focus on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________ > > Fx2lib-devel mailing list > > Fx2...@li... > > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel _________________________________________________________________ Use Hotmail to send and receive mail from your different email accounts http://clk.atdmt.com/UKM/go/186394592/direct/01/ |
From: Steve C. <nos...@ya...> - 2009-12-01 03:46:08
|
Here is a simple example that runs on a keyspan usa 19 serial adapter. Two patches, one that adds the app, one that adds the fx1.mk to the lib directory. I think the fx[1-2].mk should go there to make library building simple and simplify the makefiles. Note, I used a heavily modified version of the cypress ezregs.h file which is in the include directory. This Makefile/fx1.mk combination uses SDCCFLAGS to not-add jump tables and the descriptors to this simple example. >From 269f20c7708dffea325d8fd9d1989d17ae011a40 Mon Sep 17 00:00:00 2001 From: Steve Calfee <nos...@ya...> Date: Mon, 30 Nov 2009 19:05:42 -0800 Subject: [PATCH 1/4] Add simplest example of fx1/ezusb led blinking demo This works on my keyspan ezusb model usa-19. It does no usb activity, just starts and blinks its one led. See NOTES on how to use linux fxload, I could not get the python stuff to work yet, so not fx2lib fxload, yet. Note I put fx1.mk in the lib directory, so all apps that want it can find it. I use SDCCFLAGS for app specific issues, so no problem not having descriptors or interrupt jump tables. --- examples/fx1/lights/Makefile | 7 + examples/fx1/lights/NOTES | 14 ++ examples/fx1/lights/lights.c | 65 +++++++ include/ezregs.h | 430 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 516 insertions(+), 0 deletions(-) create mode 100644 examples/fx1/lights/Makefile create mode 100644 examples/fx1/lights/NOTES create mode 100644 examples/fx1/lights/lights.c create mode 100644 include/ezregs.h diff --git a/examples/fx1/lights/Makefile b/examples/fx1/lights/Makefile new file mode 100644 index 0000000..1322801 --- /dev/null +++ b/examples/fx1/lights/Makefile @@ -0,0 +1,7 @@ +BASEDIR = ../../.. +LIBS = +BASENAME = lights +SOURCES = lights.c +SDCCFLAGS += --code-loc 0x00 --code-size 0x1b00 +include $(BASEDIR)/lib/fx1.mk + diff --git a/examples/fx1/lights/NOTES b/examples/fx1/lights/NOTES new file mode 100644 index 0000000..7fdffb9 --- /dev/null +++ b/examples/fx1/lights/NOTES @@ -0,0 +1,14 @@ +To actually load and run the program - install the linux fxload. + +You have to unbind the keyspan driver: +first find the devices unique number: +tree /sys/bus/usb/drivers/keyspan/ +Use its bus,port number to unbind: +sudo chmod a+w /sys/bus/usb/drivers/keyspan/unbind +sudo echo -n "5-1:1.0" >/sys/bus/usb/drivers/keyspan/unbind + +You have to mount the usbfs on Ubuntu +sudo mount -t usbfs u /proc/bus/usb/ + +Once you find the usb device, this loads the program. +sudo fxload -D /proc/bus/usb/005/002 -I lights.ihx \ No newline at end of file diff --git a/examples/fx1/lights/lights.c b/examples/fx1/lights/lights.c new file mode 100644 index 0000000..7ba7743 --- /dev/null +++ b/examples/fx1/lights/lights.c @@ -0,0 +1,65 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + + /* + * Minimal sample to flash the LED on the keyspan USA19 + */ + +#include <ezregs.h> + +/* + * USA 19 unique port A led bit + */ +#define bmMYLED 0x20 + +void delay1ms(void) +{ + /* + * 24MHz clock => 166.6ns/cycle + * + * 10 cycles in a loop, 602 loops in a millisecond + */ + _asm + mov dptr,#(0xffff - 602); + loop: + inc dptr ; 3 cycles + mov a,dpl ; 2 cycles + orl a,dph ; 2 cycles + jnz loop ; 3 cycles + _endasm; +} +void mdelay(u16_t ms) +{ + u16_t i; + + for(i=0; i < ms; i++) { + delay1ms(); + } +} + +void main(void) +{ + + // loop endlessly + for(;;) { + OUTA &= ~bmMYLED; + mdelay(500); + OUTA |= bmMYLED; + mdelay(50); + } +} diff --git a/include/ezregs.h b/include/ezregs.h new file mode 100644 index 0000000..cb76c01 --- /dev/null +++ b/include/ezregs.h @@ -0,0 +1,430 @@ +//----------------------------------------------------------------------------- +// File: ezregs.h +// Contents: EZ-USB register declarations and bit mask definitions. +// +// Copyright (c) 1997 AnchorChips, Inc. All rights reserved +//----------------------------------------------------------------------------- +#ifndef EZREGS_H /* Header Sentry */ +#define EZREGS_H + +/*----------------------------------------------------------------------------- + Global Variables +-----------------------------------------------------------------------------*/ + +#define NEWEZREG(_name,_where,_size) volatile xdata at _where _size _name + +typedef unsigned char u8_t; +typedef unsigned short u16_t; +typedef struct { + u8_t cntrl; // End point control register + u8_t bytes; // End point buffer byte count +} EPIOC; + + +/* Register Assignments 3/18/99 TPM */ +NEWEZREG(OUT7BUF[64],0x7B40,u8_t); +NEWEZREG(IN7BUF[64],0x7B80,u8_t); +NEWEZREG(OUT6BUF[64],0x7BC0,u8_t); +NEWEZREG(IN6BUF[64],0x7C00,u8_t); +NEWEZREG(OUT5BUF[64],0x7C40,u8_t); +NEWEZREG(IN5BUF[64],0x7C80,u8_t); +NEWEZREG(OUT4BUF[64],0x7CC0,u8_t); +NEWEZREG(IN4BUF[64],0x7D00,u8_t); +NEWEZREG(OUT3BUF[64],0x7D40,u8_t); +NEWEZREG(IN3BUF[64],0x7D80,u8_t); +NEWEZREG(OUT2BUF[64],0x7DC0,u8_t); +NEWEZREG(IN2BUF[64],0x7E00,u8_t); +NEWEZREG(OUT1BUF[64],0x7E40,u8_t); +NEWEZREG(IN1BUF[64],0x7E80,u8_t); +NEWEZREG(OUT0BUF[64],0x7EC0,u8_t); +NEWEZREG(IN0BUF[64],0x7F00,u8_t); +NEWEZREG(OUT8DATA,0x7F60,u8_t); +NEWEZREG(OUT9DATA,0x7F61,u8_t); +NEWEZREG(OUT10DATA,0x7F62,u8_t); +NEWEZREG(OUT11DATA,0x7F63,u8_t); +NEWEZREG(OUT12DATA,0x7F64,u8_t); +NEWEZREG(OUT13DATA,0x7F65,u8_t); +NEWEZREG(OUT14DATA,0x7F66,u8_t); +NEWEZREG(OUT15DATA,0x7F67,u8_t); +NEWEZREG(IN8DATA,0x7F68,u8_t); +NEWEZREG(IN9DATA,0x7F69,u8_t); +NEWEZREG(IN10DATA,0x7F6A,u8_t); +NEWEZREG(IN11DATA,0x7F6B,u8_t); +NEWEZREG(IN12DATA,0x7F6C,u8_t); +NEWEZREG(IN13DATA,0x7F6D,u8_t); +NEWEZREG(IN14DATA,0x7F6E,u8_t); +NEWEZREG(IN15DATA,0x7F6F,u8_t); +NEWEZREG(OUT8BCH,0x7F70,u8_t); +NEWEZREG(OUT8BCL,0x7F71,u8_t); +NEWEZREG(OUT9BCH,0x7F72,u8_t); +NEWEZREG(OUT9BCL,0x7F73,u8_t); +NEWEZREG(OUT10BCH,0x7F74,u8_t); +NEWEZREG(OUT10BCL,0x7F75,u8_t); +NEWEZREG(OUT11BCH,0x7F76,u8_t); +NEWEZREG(OUT11BCL,0x7F77,u8_t); +NEWEZREG(OUT12BCH,0x7F78,u8_t); +NEWEZREG(OUT12BCL,0x7F79,u8_t); +NEWEZREG(OUT13BCH,0x7F7A,u8_t); +NEWEZREG(OUT13BCL,0x7F7B,u8_t); +NEWEZREG(OUT14BCH,0x7F7C,u8_t); +NEWEZREG(OUT14BCL,0x7F7D,u8_t); +NEWEZREG(OUT15BCH,0x7F7E,u8_t); +NEWEZREG(OUT15BCL,0x7F7F,u8_t); +NEWEZREG(CPUCS,0x7F92,u8_t); +NEWEZREG(PORTACFG,0x7F93,u8_t); +NEWEZREG(PORTBCFG,0x7F94,u8_t); +NEWEZREG(PORTCCFG,0x7F95,u8_t); +NEWEZREG(OUTA,0x7F96,u8_t); +NEWEZREG(OUTB,0x7F97,u8_t); +NEWEZREG(OUTC,0x7F98,u8_t); +NEWEZREG(PINSA,0x7F99,u8_t); +NEWEZREG(PINSB,0x7F9A,u8_t); +NEWEZREG(PINSC,0x7F9B,u8_t); +NEWEZREG(OEA,0x7F9C,u8_t); +NEWEZREG(OEB,0x7F9D,u8_t); +NEWEZREG(OEC,0x7F9E,u8_t); +NEWEZREG(UART230,0x7F9F,u8_t); +NEWEZREG(ISOERR,0x7FA0,u8_t); +NEWEZREG(ISOCTL,0x7FA1,u8_t); +NEWEZREG(ZBCOUT,0x7FA2,u8_t); +NEWEZREG(ZBCIN,0x7FA3,u8_t); +NEWEZREG(I2CS,0x7FA5,u8_t); +NEWEZREG(I2DAT,0x7FA6,u8_t); +NEWEZREG(IVEC,0x7FA8,u8_t); +NEWEZREG(IN07IRQ,0x7FA9,u8_t); +NEWEZREG(OUT07IRQ,0x7FAA,u8_t); +NEWEZREG(USBIRQ,0x7FAB,u8_t); +NEWEZREG(IN07IEN,0x7FAC,u8_t); +NEWEZREG(OUT07IEN,0x7FAD,u8_t); +NEWEZREG(USBIEN,0x7FAE,u8_t); +NEWEZREG(USBBAV,0x7FAF,u8_t); +NEWEZREG(BPADDR,0x7FB2,u16_t); +NEWEZREG(EPIO[16],0x7FB4,EPIOC); +NEWEZREG(SUDPTRH,0x7FD4,u8_t); +NEWEZREG(SUDPTRL,0x7FD5,u8_t); +NEWEZREG(USBCS,0x7FD6,u8_t); +NEWEZREG(TOGCTL,0x7FD7,u8_t); +NEWEZREG(USBFRAMEL,0x7FD8,u8_t); +NEWEZREG(USBFRAMEH,0x7FD9,u8_t); +NEWEZREG(FNADDR,0x7FDB,u8_t); +NEWEZREG(USBPAIR,0x7FDD,u8_t); +NEWEZREG(IN07VAL,0x7FDE,u8_t); +NEWEZREG(OUT07VAL,0x7FDF,u8_t); +NEWEZREG(INISOVAL,0x7FE0,u8_t); +NEWEZREG(OUTISOVAL,0x7FE1,u8_t); +NEWEZREG(FASTXFR,0x7FE2,u8_t); +NEWEZREG(AUTOPTRH,0x7FE3,u8_t); +NEWEZREG(AUTOPTRL,0x7FE4,u8_t); +NEWEZREG(AUTODATA,0x7FE5,u8_t); +NEWEZREG(SETUPDAT[8],0x7FE8,u8_t); +NEWEZREG(OUT8ADDR,0x7FF0,u8_t); +NEWEZREG(OUT9ADDR,0x7FF1,u8_t); +NEWEZREG(OUT10ADDR,0x7FF2,u8_t); +NEWEZREG(OUT11ADDR,0x7FF3,u8_t); +NEWEZREG(OUT12ADDR,0x7FF4,u8_t); +NEWEZREG(OUT13ADDR,0x7FF5,u8_t); +NEWEZREG(OUT14ADDR,0x7FF6,u8_t); +NEWEZREG(OUT15ADDR,0x7FF7,u8_t); +NEWEZREG(IN8ADDR,0x7FF8,u8_t); +NEWEZREG(IN9ADDR,0x7FF9,u8_t); +NEWEZREG(IN10ADDR,0x7FFA,u8_t); +NEWEZREG(IN11ADDR,0x7FFB,u8_t); +NEWEZREG(IN12ADDR,0x7FFC,u8_t); +NEWEZREG(IN13ADDR,0x7FFD,u8_t); +NEWEZREG(IN14ADDR,0x7FFE,u8_t); +NEWEZREG(IN15ADDR,0x7FFF,u8_t); + + +/*----------------------------------------------------------------------------- + Special Function Registers (SFRs) +-----------------------------------------------------------------------------*/ +sfr at 0x81 SP; +sfr at 0x82 DPL; +sfr at 0x83 DPH; +sfr at 0x84 DPL1; +sfr at 0x85 DPH1; +sfr at 0x86 DPS; + + /* DPS */ +sfr at 0x87 PCON; +sfr at 0x88 TCON; + + /* TCON */ +sbit at 0x88+0 IT0; +sbit at 0x88+1 IE0; +sbit at 0x88+2 IT1; +sbit at 0x88+3 IE1; +sbit at 0x88+4 TR0; +sbit at 0x88+5 TF0; +sbit at 0x88+6 TR1; +sbit at 0x88+7 TF1; +sfr at 0x89 TMOD; + + /* TMOD */ +sfr at 0x8A TL0; +sfr at 0x8B TL1; +sfr at 0x8C TH0; +sfr at 0x8D TH1; +sfr at 0x8E CKCON; + + /* CKCON */ +sfr at 0x8F SPC_FNC; // Was WRS in Reg320 + +sfr at 0x91 EXIF; // EXIF Bit Values differ from Reg320 +sfr at 0x92 MPAGE; +sfr at 0x98 SCON0; + + /* SCON0 */ +sbit at 0x98+0 RI; +sbit at 0x98+1 TI; +sbit at 0x98+2 RB8; +sbit at 0x98+3 TB8; +sbit at 0x98+4 REN; +sbit at 0x98+5 SM2; +sbit at 0x98+6 SM1; +sbit at 0x98+7 SM0; +sfr at 0x99 SBUF0; +sfr at 0xA8 IE; + + /* IE */ +sbit at 0xA8+0 EX0; +sbit at 0xA8+1 ET0; +sbit at 0xA8+2 EX1; +sbit at 0xA8+3 ET1; +sbit at 0xA8+4 ES0; +sbit at 0xA8+5 ET2; +sbit at 0xA8+6 ES1; +sbit at 0xA8+7 EA; +sfr at 0xB8 IP; + + /* IP */ +sbit at 0xB8+0 PX0; +sbit at 0xB8+1 PT0; +sbit at 0xB8+2 PX1; +sbit at 0xB8+3 PT1; +sbit at 0xB8+4 PS0; +sbit at 0xB8+5 PT2; +sbit at 0xB8+6 PS1; +sfr at 0xC0 SCON1; + + /* SCON1 */ +sbit at 0xC0+0 RI1; +sbit at 0xC0+1 TI1; +sbit at 0xC0+2 RB81; +sbit at 0xC0+3 TB81; +sbit at 0xC0+4 REN1; +sbit at 0xC0+5 SM21; +sbit at 0xC0+6 SM11; +sbit at 0xC0+7 SM01; +sfr at 0xC1 SBUF1; +sfr at 0xC8 T2CON; + + /* T2CON */ +sbit at 0xC8+0 CP_RL2; +sbit at 0xC8+1 C_T2; +sbit at 0xC8+2 TR2; +sbit at 0xC8+3 EXEN2; +sbit at 0xC8+4 TCLK; +sbit at 0xC8+5 RCLK; +sbit at 0xC8+6 EXF2; +sbit at 0xC8+7 TF2; +sfr at 0xCA RCAP2L; +sfr at 0xCB RCAP2H; +sfr at 0xCC TL2; +sfr at 0xCD TH2; +sfr at 0xD0 PSW; + + /* PSW */ +sbit at 0xD0+0 P; +sbit at 0xD0+1 FL; +sbit at 0xD0+2 OV; +sbit at 0xD0+3 RS0; +sbit at 0xD0+4 RS1; +sbit at 0xD0+5 F0; +sbit at 0xD0+6 AC; +sbit at 0xD0+7 CY; +sfr at 0xD8 EICON; // Was WDCON in DS80C320; Bit Values differ from Reg320 +sbit at 0xD8+3 INT6; +sbit at 0xD8+4 RESI; +sbit at 0xD8+5 ERESI; +sbit at 0xD8+7 SMOD1; +sfr at 0xE0 ACC; +sfr at 0xE8 EIE; // EIE Bit Values differ from Reg320 +sbit at 0xE8+0 EUSB; +sbit at 0xE8+1 EI2C; +sbit at 0xE8+2 EIEX4; +sbit at 0xE8+3 EIEX5; +sbit at 0xE8+4 EIEX6; +sfr at 0xF0 B; +sfr at 0xF8 EIP; // EIP Bit Values differ from Reg320 +sbit at 0xF8+0 PUSB; +sbit at 0xF8+1 PI2C; +sbit at 0xF8+2 EIPX4; +sbit at 0xF8+3 EIPX5; +sbit at 0xF8+4 EIPX6; + +/*----------------------------------------------------------------------------- + Bit Masks +-----------------------------------------------------------------------------*/ + +/* CPU Control & Status Register */ +#define bmCHIPREV (bmBIT7 | bmBIT6 | bmBIT5 | bmBIT4) +#define bmCLK24OE bmBIT1 +#define bm8052RES bmBIT0 +/* Port Configuration Registers */ +/* Port A */ +#define bmRXD1OUT bmBIT7 +#define bmRXD0OUT bmBIT6 +#define bmFRD bmBIT5 +#define bmFWR bmBIT4 +#define bmCS bmBIT3 +#define bmOE bmBIT2 +#define bmT1OUT bmBIT1 +#define bmT0OUT bmBIT0 +/* Port B */ +#define bmT2OUT bmBIT7 +#define bmINT6 bmBIT6 +#define bmINT5 bmBIT5 +#define bmINT4 bmBIT4 +#define bmTXD1 bmBIT3 +#define bmRXD1 bmBIT2 +#define bmT2EX bmBIT1 +#define bmT2 bmBIT0 +/* Port C */ +#define bmRD bmBIT7 +#define bmWR bmBIT6 +#define bmT1 bmBIT5 +#define bmT0 bmBIT4 +#define bmINT1 bmBIT3 +#define bmINT0 bmBIT2 +#define bmTXD0 bmBIT1 +#define bmRXD0 bmBIT0 +/* Isochronous Status & End Point Valid Registers */ +#define bmEP15 bmBIT7 +#define bmEP14 bmBIT6 +#define bmEP13 bmBIT5 +#define bmEP12 bmBIT4 +#define bmEP11 bmBIT3 +#define bmEP10 bmBIT2 +#define bmEP9 bmBIT1 +#define bmEP8 bmBIT0 +/* I2C Control & Status Register */ +#define bmSTART bmBIT7 +#define bmSTOP bmBIT6 +#define bmLASTRD bmBIT5 +#define bmID (bmBIT4 | bmBIT3) +#define bmBERR bmBIT2 +#define bmACK bmBIT1 +#define bmDONE bmBIT0 +/* Interrupt Vector Register */ +#define bmIV4 bmBIT6 +#define bmIV3 bmBIT5 +#define bmIV2 bmBIT4 +#define bmIV1 bmBIT3 +#define bmIV0 bmBIT2 +/* End point Interrupt Request, End Point Interrupt Enable */ +/* And End Point Valid Registers */ +#define bmEP7 bmBIT7 +#define bmEP6 bmBIT6 +#define bmEP5 bmBIT5 +#define bmEP4 bmBIT4 +#define bmEP3 bmBIT3 +#define bmEP2 bmBIT2 +#define bmEP1 bmBIT1 +#define bmEP0 bmBIT0 +/* Global Interrupt Request & Enable Registers */ +#define bmIBN bmBIT5 +#define bmURES bmBIT4 +#define bmSUSP bmBIT3 +#define bmSUTOK bmBIT2 +#define bmSOF bmBIT1 +#define bmSUDAV bmBIT0 +/* Global Control */ +#define bmBREAK bmBIT3 +#define bmBPPULSE bmBIT2 +#define bmBPEN bmBIT1 +#define bmAVEN bmBIT0 +/* USB Control & Status Register */ +#define bmRWAKEUP bmBIT7 +#define bmDISCON bmBIT3 +#define bmDISCOE bmBIT2 +#define bmRENUM bmBIT1 +#define bmSIGRESUME bmBIT0 +/* End Point 0 Control & Status Register */ +#define bmOUT bmBIT3 +#define bmIN bmBIT2 +#define bmHS bmBIT1 +#define bmHSSTALL bmBIT0 +/* End Point Control & Status Registers */ +#define bmEPSTALL bmBIT0 +#define bmEPBUSY bmBIT1 +/* Fast Transfer Register */ +#define bmFISO bmBIT7 +#define bmFBLK bmBIT6 +#define bmRPOL bmBIT5 +#define bmRMOD1 bmBIT4 +#define bmRMOD0 bmBIT3 +#define bmWPOL bmBIT2 +#define bmWMOD1 bmBIT1 +#define bmWMOD0 bmBIT0 +/* Endpoint Pairing Register */ +#define bmISOSEND0 bmBIT7 +#define bmPR6OUT bmBIT5 +#define bmPR4OUT bmBIT4 +#define bmPR2OUT bmBIT3 +#define bmPR6IN bmBIT2 +#define bmPR4IN bmBIT1 +#define bmPR2IN bmBIT0 +/* End point control offsets */ +enum { IN0BUF_ID, + IN1BUF_ID, + IN2BUF_ID, + IN3BUF_ID, + IN4BUF_ID, + IN5BUF_ID, + IN6BUF_ID, + IN7BUF_ID, + OUT0BUF_ID, + OUT1BUF_ID, + OUT2BUF_ID, + OUT3BUF_ID, + OUT4BUF_ID, + OUT5BUF_ID, + OUT6BUF_ID, + OUT7BUF_ID +}; + +#define EP0CS EPIO[0].cntrl +#define IN0BC EPIO[0].bytes +#define IN1CS EPIO[1].cntrl +#define IN1BC EPIO[1].bytes +#define IN2CS EPIO[2].cntrl +#define IN2BC EPIO[2].bytes +#define IN3CS EPIO[3].cntrl +#define IN3BC EPIO[3].bytes +#define IN4CS EPIO[4].cntrl +#define IN4BC EPIO[4].bytes +#define IN5CS EPIO[5].cntrl +#define IN5BC EPIO[5].bytes +#define IN6CS EPIO[6].cntrl +#define IN6BC EPIO[6].bytes +#define IN7CS EPIO[7].cntrl +#define IN7BC EPIO[7].bytes +#define OUT0CS EPIO[8].cntrl +#define OUT0BC EPIO[8].bytes +#define OUT1CS EPIO[9].cntrl +#define OUT1BC EPIO[9].bytes +#define OUT2CS EPIO[10].cntrl +#define OUT2BC EPIO[10].bytes +#define OUT3CS EPIO[11].cntrl +#define OUT3BC EPIO[11].bytes +#define OUT4CS EPIO[12].cntrl +#define OUT4BC EPIO[12].bytes +#define OUT5CS EPIO[13].cntrl +#define OUT5BC EPIO[13].bytes +#define OUT6CS EPIO[14].cntrl +#define OUT6BC EPIO[14].bytes +#define OUT7CS EPIO[15].cntrl +#define OUT7BC EPIO[15].bytes + +#endif /* EZREGS_H */ -- 1.6.3.3 >From a1c215188bf504dfa2fe5bdfb9f10795187b98c4 Mon Sep 17 00:00:00 2001 From: Steve Calfee <nos...@ya...> Date: Mon, 30 Nov 2009 19:29:31 -0800 Subject: [PATCH 3/4] Add the fx1/ezusb global make helper file. Note this allows app specific files to add build options with SDCCFLAGS. --- lib/fx1.mk | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-) create mode 100644 lib/fx1.mk diff --git a/lib/fx1.mk b/lib/fx1.mk new file mode 100644 index 0000000..df4e220 --- /dev/null +++ b/lib/fx1.mk @@ -0,0 +1,61 @@ +# common make targets for compiling fx1 firmware +# +# In your Makefile, define: +# SOURCES: list of c files to compile +# A51_SOURCES: list of any a51 files. +# BASENAME: name of your firmware file, i.e., myfirmware, but not myfirmware.c +# BASEDIR: top directory of fx2lib. Contains lib and include dirs +# +# Provided targets: +# +# default target: creates $(BASENAME).ihx +# bix: creates $(BASENAME).bix +# iic: creates $(BASENAME).iic +# load: uses fx2load to load firmware.bix onto the development board +# (You can customize VID/PID if you need to load the firmware onto a device that has different vendor and product id +# The default is 0x04b4, 0x8613 +# clean: delete all the temp files. +# +# +# + +ifndef VID +VID=0x04b4 +endif +ifndef PID +PID=0x8613 +endif + +RELS=$(SOURCES:.c=.rel) $(A51_SOURCES:.a51=.rel) +# these are pretty good settings for most firmwares. +# Have to be careful with memory locations for +# firmwares that require more xram etc. +CC = sdcc -mmcs51 $(SDCCFLAGS) + +.PHONY: ihx iic bix load clean + + +ihx: $(BASENAME).ihx +bix: $(BASENAME).bix +iic: $(BASENAME).iic + +# can't use default target %.rel because there is no way +# to differentiate the dependency. (Is it %.rel: %.c or %.a51) +$(BASENAME).ihx: $(SOURCES) $(A51_SOURCES) + for a in $(A51_SOURCES); do \ + asx8051 -logs $$a; done + for s in $(SOURCES); do \ + $(CC) -c -I $(BASEDIR)/include $$s; done + $(CC) -o $(BASENAME).ihx $(RELS) $(LIB) -L $(BASEDIR)/lib + + +$(BASENAME).bix: $(BASENAME).ihx + objcopy -I ihex -O binary $< $@ +$(BASENAME).iic: $(BASENAME).ihx + $(BASEDIR)/utils/ihx2iic.py -v $(VID) -p $(PID) $< $@ + +load: $(BASENAME).bix + fx2load -v $(VID) -p $(PID) $(BASENAME).bix + +clean: + rm -f *.{asm,ihx,lnk,lst,map,mem,rel,rst,sym,adb,cdb,bix} -- 1.6.3.3 |
From: Dennis M. <de...@ub...> - 2009-12-01 00:50:08
|
I'll have to debug on python 2.6 and see if there is an issue. Are you using the latest version from git? There are a lot of changes since the release 0.1. -Dennis On Nov 30, 2009, at 11:52 AM, S S wrote: > Hi Dennis & Al, > > When I try to run load.py on linux I get the following error: > > sebastien@sebastien-laptop:~/workspace/OpenSourceFx2/fx2lib/examples/ > i2c$ python load.py > Traceback (most recent call last): > File "load.py", line 17, in <module> > from fx2load import * > File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", > line 21, in <module> > f=fx2.fx2() > AttributeError: type object 'fx2' has no attribute 'fx2' > > I have no idea if I am doing something stupid or if my setup is > wrong somehow. > I am using python 2.6 rather than 2.5 but I assume the setup script > has detected that as the path for the __init__.py file seems to > imply (I didn't get any complaint about it). > I get the same error if I try to import fx2load from the python > terminal window: > > >> from fx2load import * > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", > line 21, in <module> > f=fx2.fx2() > AttributeError: type object 'fx2' has no attribute 'fx2' > > > Any clue would be much appreciated. > > Thanks, > > Sébastien > > View your other email accounts from your Hotmail inbox. Add them > now. > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july_______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel |
From: S S <ss...@ho...> - 2009-11-30 18:52:16
|
Hi Dennis & Al, When I try to run load.py on linux I get the following error: sebastien@sebastien-laptop:~/workspace/OpenSourceFx2/fx2lib/examples/i2c$ python load.py Traceback (most recent call last): File "load.py", line 17, in <module> from fx2load import * File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", line 21, in <module> f=fx2.fx2() AttributeError: type object 'fx2' has no attribute 'fx2' I have no idea if I am doing something stupid or if my setup is wrong somehow. I am using python 2.6 rather than 2.5 but I assume the setup script has detected that as the path for the __init__.py file seems to imply (I didn't get any complaint about it). I get the same error if I try to import fx2load from the python terminal window: >> from fx2load import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.6/dist-packages/fx2load/__init__.py", line 21, in <module> f=fx2.fx2() AttributeError: type object 'fx2' has no attribute 'fx2' Any clue would be much appreciated. Thanks, Sébastien _________________________________________________________________ View your other email accounts from your Hotmail inbox. Add them now. http://clk.atdmt.com/UKM/go/186394592/direct/01/ |
From: Dennis M. <de...@ub...> - 2009-11-25 19:43:48
|
> Please consider the benefits of putting default interrupt routines in the library. That way each app doesn't have to have the same no-op irqs patched into them. Each app would only need to define the irqs that it needs and the linker will add the default (noop) irqs for the other entries. > > I do like this actually. I've disliked having to copy/paste a bunch of empty functions around. I'll look at this some more when I get a second. Thanks Dennis |
From: Steve C. <nos...@ya...> - 2009-11-25 19:39:25
|
Hi Dennis, Fine, don't make the changes to lights.c - it was just to test my lib changes anyway. Please consider the benefits of putting default interrupt routines in the library. That way each app doesn't have to have the same no-op irqs patched into them. Each app would only need to define the irqs that it needs and the linker will add the default (noop) irqs for the other entries. Regards, Steve --- On Wed, 11/25/09, Dennis Muhlestein <de...@ub...> wrote: > From: Dennis Muhlestein <de...@ub...> > Subject: Re: [Fx2lib-devel] fix linker and example build errors. > To: "fx2lib developer mailing list" <fx2...@li...> > Date: Wednesday, November 25, 2009, 8:29 AM > Hi Steve, > > I'd rather leave lights, serial, and a couple of the > examples very > simple projects that don't include the usb jump table, and > require > re-enumeration to use. Those are concepts > that take a bit to get your > head around and I want fx2lib to be approachable for > someone who is just > beginning to learn to develop > firmware. I've been in the process of > porting the examples to a new common Makefile, but haven't > finished that > completely yet, hence the build warning. A couple of > the more complex > examples (bulkloop, eeprom, et al) build correctly with the > Makefile > already, I just haven't modified the Makefile to exclude > the portions > the more simple examples don't need. All that is > needed really, is to > not add the DSCR_AREA AND INT2JT defines to the linker > arguments in the > Makefile. Perhaps I'll make the modification and push > that change. > > -Dennis > > Steve Calfee wrote: > > Hi Dennis, > > > > I don't really know how to do this. I am sure Yahoo > will mess up the patch file, so I will both include it in > this message and attach it. > > > > Note, I don't have hardware to test this, I have built > the example light program to test my hypothetical build > fixes. > > > > If you don't want to adopt this fine, or if you want > me to change things let me know. Eventually I would like to > submit ezusb/fx1 code to this library. > > > > ==================================== > > >From b09aaa448599e5acca0bec5fbf465f05bb7adade Mon > Sep 17 00:00:00 2001 > > From: Steve Calfee <nos...@ya...> > > Date: Tue, 24 Nov 2009 21:03:08 -0800 > > Subject: [PATCH] Simplify examples to fix link errors > and provide default interrupt routines > > > > A linker first resolves the symbols in the project > objects and then looks in > > libraries for unresolved symbols. A good linker only > adds functions that are > > referenced, the as51 linker includes the entire object > module that contains > > a referenced function. So every default routine should > be in its own > > source module. I only did the most commonly used > modules, as an example. > > A program that wants to use any symbol defined in > def_ints.c must define > > all the entries their or multiple definition errors > will happen. > > > > However, a simple example that does not use interrupts > will not need to > > include them in the example source code. I show this > in lights.c where > > a few interrupt routines are used, but most are not, > and the defaults > > from the library are used. > > > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal > Reports 2008 30-Day > trial. Simplify your report design, integration and > deployment - and focus on > what you do best, core application coding. Discover what's > new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > |
From: Dennis M. <de...@ub...> - 2009-11-25 16:29:18
|
Hi Steve, I'd rather leave lights, serial, and a couple of the examples very simple projects that don't include the usb jump table, and require re-enumeration to use. Those are concepts that take a bit to get your head around and I want fx2lib to be approachable for someone who is just beginning to learn to develop firmware. I've been in the process of porting the examples to a new common Makefile, but haven't finished that completely yet, hence the build warning. A couple of the more complex examples (bulkloop, eeprom, et al) build correctly with the Makefile already, I just haven't modified the Makefile to exclude the portions the more simple examples don't need. All that is needed really, is to not add the DSCR_AREA AND INT2JT defines to the linker arguments in the Makefile. Perhaps I'll make the modification and push that change. -Dennis Steve Calfee wrote: > Hi Dennis, > > I don't really know how to do this. I am sure Yahoo will mess up the patch file, so I will both include it in this message and attach it. > > Note, I don't have hardware to test this, I have built the example light program to test my hypothetical build fixes. > > If you don't want to adopt this fine, or if you want me to change things let me know. Eventually I would like to submit ezusb/fx1 code to this library. > > ==================================== > >From b09aaa448599e5acca0bec5fbf465f05bb7adade Mon Sep 17 00:00:00 2001 > From: Steve Calfee <nos...@ya...> > Date: Tue, 24 Nov 2009 21:03:08 -0800 > Subject: [PATCH] Simplify examples to fix link errors and provide default interrupt routines > > A linker first resolves the symbols in the project objects and then looks in > libraries for unresolved symbols. A good linker only adds functions that are > referenced, the as51 linker includes the entire object module that contains > a referenced function. So every default routine should be in its own > source module. I only did the most commonly used modules, as an example. > A program that wants to use any symbol defined in def_ints.c must define > all the entries their or multiple definition errors will happen. > > However, a simple example that does not use interrupts will not need to > include them in the example source code. I show this in lights.c where > a few interrupt routines are used, but most are not, and the defaults > from the library are used. > > |
From: Steve C. <nos...@ya...> - 2009-11-25 05:35:41
|
Hi Dennis, I don't really know how to do this. I am sure Yahoo will mess up the patch file, so I will both include it in this message and attach it. Note, I don't have hardware to test this, I have built the example light program to test my hypothetical build fixes. If you don't want to adopt this fine, or if you want me to change things let me know. Eventually I would like to submit ezusb/fx1 code to this library. ==================================== >From b09aaa448599e5acca0bec5fbf465f05bb7adade Mon Sep 17 00:00:00 2001 From: Steve Calfee <nos...@ya...> Date: Tue, 24 Nov 2009 21:03:08 -0800 Subject: [PATCH] Simplify examples to fix link errors and provide default interrupt routines A linker first resolves the symbols in the project objects and then looks in libraries for unresolved symbols. A good linker only adds functions that are referenced, the as51 linker includes the entire object module that contains a referenced function. So every default routine should be in its own source module. I only did the most commonly used modules, as an example. A program that wants to use any symbol defined in def_ints.c must define all the entries their or multiple definition errors will happen. However, a simple example that does not use interrupts will not need to include them in the example source code. I show this in lights.c where a few interrupt routines are used, but most are not, and the defaults from the library are used. I don't like ignoring build errors, so I just added "any" descriptor file to fix the build. Signed-off-by: Steve Calfee <nos...@ya...> --- examples/lights/Makefile | 1 + examples/lights/dscr.a51 | 254 ++++++++++++++++++++++++++++++++++++++++++++++ examples/lights/lights.c | 19 ++++ lib/Makefile | 4 +- lib/def_ints.c | 69 +++++++++++++ lib/def_ints_ep0ack.c | 22 ++++ lib/def_ints_hispeed.c | 22 ++++ lib/def_ints_reset.c | 22 ++++ lib/def_ints_sof.c | 22 ++++ lib/def_ints_sudav.c | 22 ++++ 10 files changed, 456 insertions(+), 1 deletions(-) create mode 100644 examples/lights/dscr.a51 create mode 100644 lib/def_ints.c create mode 100644 lib/def_ints_ep0ack.c create mode 100644 lib/def_ints_hispeed.c create mode 100644 lib/def_ints_reset.c create mode 100644 lib/def_ints_sof.c create mode 100644 lib/def_ints_sudav.c diff --git a/examples/lights/Makefile b/examples/lights/Makefile index 9a4254d..15d16c5 100644 --- a/examples/lights/Makefile +++ b/examples/lights/Makefile @@ -1,6 +1,7 @@ FX2LIBDIR=../.. BASENAME = lights SOURCES=lights.c +A51_SOURCES=dscr.a51 include ../fx2.mk diff --git a/examples/lights/dscr.a51 b/examples/lights/dscr.a51 new file mode 100644 index 0000000..b27f03d --- /dev/null +++ b/examples/lights/dscr.a51 @@ -0,0 +1,254 @@ +; Copyright (C) 2009 Ubixum, Inc. +; +; This library is free software; you can redistribute it and/or +; modify it under the terms of the GNU Lesser General Public +; License as published by the Free Software Foundation; either +; version 2.1 of the License, or (at your option) any later version. +; +; This library is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +; Lesser General Public License for more details. +; +; You should have received a copy of the GNU Lesser General Public +; License along with this library; if not, write to the Free Software +; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +; this is a the default +; full speed and high speed +; descriptors found in the TRM +; change however you want but leave +; the descriptor pointers so the setupdat.c file works right + + +.module DEV_DSCR + +; descriptor types +; same as setupdat.h +DSCR_DEVICE_TYPE=1 +DSCR_CONFIG_TYPE=2 +DSCR_STRING_TYPE=3 +DSCR_INTERFACE_TYPE=4 +DSCR_ENDPOINT_TYPE=5 +DSCR_DEVQUAL_TYPE=6 + +; for the repeating interfaces +DSCR_INTERFACE_LEN=9 +DSCR_ENDPOINT_LEN=7 + +; endpoint types +ENDPOINT_TYPE_CONTROL=0 +ENDPOINT_TYPE_ISO=1 +ENDPOINT_TYPE_BULK=2 +ENDPOINT_TYPE_INT=3 + + .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end +; These need to be in code memory. If +; they aren't you'll have to manully copy them somewhere +; in code memory otherwise SUDPTRH:L don't work right + .area DSCR_AREA (CODE) + +_dev_dscr: + .db dev_dscr_end-_dev_dscr ; len + .db DSCR_DEVICE_TYPE ; type + .dw 0x0002 ; usb 2.0 + .db 0xff ; class (vendor specific) + .db 0xff ; subclass (vendor specific) + .db 0xff ; protocol (vendor specific) + .db 64 ; packet size (ep0) + .dw 0xB404 ; vendor id + .dw 0x1386 ; product id + .dw 0x0100 ; version id + .db 0 ; manufacturure str idx + .db 2 ; product str idx + .db 0 ; serial str idx + .db 1 ; n configurations +dev_dscr_end: + +_dev_qual_dscr: + .db dev_qualdscr_end-_dev_qual_dscr + .db DSCR_DEVQUAL_TYPE + .dw 0x0002 ; usb 2.0 + .db 0xff + .db 0xff + .db 0xff + .db 64 ; max packet + .db 1 ; n configs + .db 0 ; extra reserved byte +dev_qualdscr_end: + +_highspd_dscr: + .db highspd_dscr_end-_highspd_dscr ; dscr len ;; Descriptor length + .db DSCR_CONFIG_TYPE + ; can't use .dw because byte order is different + .db (highspd_dscr_realend-_highspd_dscr) % 256 ; total length of config lsb + .db (highspd_dscr_realend-_highspd_dscr) / 256 ; total length of config msb + .db 1 ; n interfaces + .db 1 ; config number + .db 0 ; config string + .db 0x80 ; attrs = bus powered, no wakeup + .db 0x32 ; max power = 100ma +highspd_dscr_end: + +; all the interfaces next +; NOTE the default TRM actually has more alt interfaces +; but you can add them back in if you need them. +; here, we just use the default alt setting 1 from the trm + .db DSCR_INTERFACE_LEN + .db DSCR_INTERFACE_TYPE + .db 0 ; index + .db 0 ; alt setting idx + .db 6 ; n endpoints + .db 0xff ; class + .db 0xff + .db 0xff + .db 0 ; string index + +; endpoint 1 out + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x01 ; ep1 dir=out and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x00 ; max packet LSB + .db 0x02 ; max packet size=512 bytes + .db 0x00 ; polling interval + +; endpoint 1 in + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x81 ; ep1 dir=in and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x00 ; max packet LSB + .db 0x02 ; max packet size=512 bytes + .db 0x00 ; polling interval + +; endpoint 2 out + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x02 ; ep2 dir=OUT and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x00 ; max packet LSB + .db 0x02 ; max packet size=512 bytes + .db 0x00 ; polling interval + +; endpoint 4 out + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x04 ; ep4 dir=OUT and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x00 ; max packet LSB + .db 0x02 ; max packet size=512 bytes + .db 0x00 ; polling interval + +; endpoint 6 in + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x86 ; ep6 dir=in and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x00 ; max packet LSB + .db 0x02 ; max packet size=512 bytes + .db 0x00 ; polling interval + +; endpoint 8 in + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x88 ; ep8 dir=in and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x00 ; max packet LSB + .db 0x02 ; max packet size=512 bytes + .db 0x00 ; polling interval +highspd_dscr_realend: + +_fullspd_dscr: + .db fullspd_dscr_end-_fullspd_dscr ; dscr len + .db DSCR_CONFIG_TYPE + ; can't use .dw because byte order is different + .db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length of config lsb + .db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length of config msb + .db 1 ; n interfaces + .db 1 ; config number + .db 0 ; config string + .db 0x80 ; attrs = bus powered, no wakeup + .db 0x32 ; max power = 100ma +fullspd_dscr_end: + +; all the interfaces next +; NOTE the default TRM actually has more alt interfaces +; but you can add them back in if you need them. +; here, we just use the default alt setting 1 from the trm + .db DSCR_INTERFACE_LEN + .db DSCR_INTERFACE_TYPE + .db 0 ; index + .db 0 ; alt setting idx + .db 6 ; n endpoints + .db 0xff ; class + .db 0xff + .db 0xff + .db 0 ; string index + +; endpoint 1 out + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x01 ; ep1 dir=out and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x40 ; max packet LSB + .db 0x00 ; max packet size=64 bytes + .db 0x00 ; polling interval + +; endpoint 1 in + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x81 ; ep1 dir=in and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x40 ; max packet LSB + .db 0x00 ; max packet size=64 bytes + .db 0x00 ; polling interval + +; endpoint 2 out + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x02 ; ep2 dir=OUT and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x40 ; max packet LSB + .db 0x00 ; max packet size=64 bytes + .db 0x00 ; polling interval + +; endpoint 4 out + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x04 ; ep4 dir=OUT and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x40 ; max packet LSB + .db 0x00 ; max packet size=64 bytes + .db 0x00 ; polling interval + +; endpoint 6 in + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x86 ; ep6 dir=in and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x40 ; max packet LSB + .db 0x00 ; max packet size=64 bytes + .db 0x00 ; polling interval +; endpoint 6 in + .db DSCR_ENDPOINT_LEN + .db DSCR_ENDPOINT_TYPE + .db 0x88 ; ep6 dir=in and address + .db ENDPOINT_TYPE_BULK ; type + .db 0x40 ; max packet LSB + .db 0x00 ; max packet size=64 bytes + .db 0x00 ; polling interval +fullspd_dscr_realend: + +_dev_strings: +; sample string +_string0: + .db string0end-_string0 ; len + .db DSCR_STRING_TYPE + .db 0x09, 0x04 ; 0x0409 is the language code for English. Possible to add more codes after this. +string0end: +; add more strings here + + +_dev_strings_end: + .dw 0x0000 ; in case you wanted to look at memory between _dev_strings and _dev_strings_end diff --git a/examples/lights/lights.c b/examples/lights/lights.c index e2ffd6c..1c8cc72 100644 --- a/examples/lights/lights.c +++ b/examples/lights/lights.c @@ -21,6 +21,7 @@ #include <lights.h> #include <delay.h> +#include <usbjt.h> volatile xdata BYTE* bytes[] = { &D2ON, &D3ON, &D4ON, &D5ON, &D2OFF, &D3OFF, &D4OFF, &D5OFF }; @@ -28,6 +29,7 @@ void main(void) { volatile BYTE tmp; BYTE cur=0; + USE_USB_INTS(); // loop endlessly for(;;) { @@ -36,3 +38,20 @@ void main(void) cur = cur == 7 ? 0 : cur+1; } } +/* + * copied usb jt routines from usbjt.h + * Add any custom isrs that I want. + */ +void sudav_isr() interrupt SUDAV_ISR { + CLEAR_SUDAV(); +} + +void sof_isr () interrupt SOF_ISR using 1 { + CLEAR_SOF(); +} +void usbreset_isr() interrupt USBRESET_ISR { + CLEAR_USBRESET(); +} +void hispeed_isr() interrupt HISPEED_ISR { + CLEAR_HISPEED(); +} diff --git a/lib/Makefile b/lib/Makefile index 9757b1a..023f635 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -14,7 +14,9 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -SOURCES = serial.c i2c.c delay.c setupdat.c gpif.c eputils.c +SOURCES = serial.c i2c.c delay.c setupdat.c gpif.c eputils.c \ + def_ints.c def_ints_sudav.c def_ints_ep0ack.c def_ints_hispeed.c \ + def_ints_reset.c def_ints_sof.c FX2_OBJS = $(patsubst %.c,%.rel, $(SOURCES)) usbjt.rel INCLUDES = -I../include SDCC = sdcc -mmcs51 $(SDCCFLAGS) diff --git a/lib/def_ints.c b/lib/def_ints.c new file mode 100644 index 0000000..d92255a --- /dev/null +++ b/lib/def_ints.c @@ -0,0 +1,69 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + +#include <usbjt.h> + +/* + * define default routines, if an app uses one of these it must define them + * all or get link errors. Individual routines can be moved to files in the lib + * directory. Then the linker will install the routine if needed. + */ +// copied usb jt routines from usbjt.h +//void sudav_isr() interrupt SUDAV_ISR {} +//void ep0ack_isr() interrupt EP0ACK_ISR {} +//void sof_isr() interrupt SOF_ISR {} +void sutok_isr() interrupt SUTOK_ISR {} +void suspend_isr() interrupt SUSPEND_ISR {} +//void usbreset_isr() interrupt USBRESET_ISR {} +//void hispeed_isr() interrupt HISPEED_ISR {} +//void ep0ack_isr() interrupt EP0ACK_ISR {} +void ep0in_isr() interrupt EP0IN_ISR {} +void ep0out_isr() interrupt EP0OUT_ISR {} +void ep1in_isr() interrupt EP1IN_ISR {} +void ep1out_isr() interrupt EP1OUT_ISR {} +void ep2_isr() interrupt EP2_ISR {} +void ep4_isr() interrupt EP4_ISR {} +void ep6_isr() interrupt EP6_ISR {} +void ep8_isr() interrupt EP8_ISR {} +void ibn_isr() interrupt IBN_ISR {} +void ep0ping_isr() interrupt EP0PING_ISR {} +void ep1ping_isr() interrupt EP1PING_ISR {} +void ep2ping_isr() interrupt EP2PING_ISR {} +void ep4ping_isr() interrupt EP4PING_ISR {} +void ep6ping_isr() interrupt EP6PING_ISR {} +void ep8ping_isr() interrupt EP8PING_ISR {} +void errlimit_isr() interrupt ERRLIMIT_ISR {} +void ep2isoerr_isr() interrupt EP2ISOERR_ISR {} +void ep4isoerr_isr() interrupt EP4ISOERR_ISR {} +void ep6isoerr_isr() interrupt EP6ISOERR_ISR {} +void ep8isoerr_isr() interrupt EP8ISOERR_ISR {} +void spare_isr() interrupt RESERVED_ISR {} +void ep2pf_isr() interrupt EP2PF_ISR{} +void ep4pf_isr() interrupt EP4PF_ISR{} +void ep6pf_isr() interrupt EP6PF_ISR{} +void ep8pf_isr() interrupt EP8PF_ISR{} +void ep2ef_isr() interrupt EP2EF_ISR{} +void ep4ef_isr() interrupt EP4EF_ISR{} +void ep6ef_isr() interrupt EP6EF_ISR{} +void ep8ef_isr() interrupt EP8EF_ISR{} +void ep2ff_isr() interrupt EP2FF_ISR{} +void ep4ff_isr() interrupt EP4FF_ISR{} +void ep6ff_isr() interrupt EP6FF_ISR{} +void ep8ff_isr() interrupt EP8FF_ISR{} +void gpifdone_isr() interrupt GPIFDONE_ISR{} +void gpifwf_isr() interrupt GPIFWF_ISR{} diff --git a/lib/def_ints_ep0ack.c b/lib/def_ints_ep0ack.c new file mode 100644 index 0000000..6c5948a --- /dev/null +++ b/lib/def_ints_ep0ack.c @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + +#include <usbjt.h> + +// copied usb jt routines from usbjt.h +void ep0ack_isr() interrupt EP0ACK_ISR {} diff --git a/lib/def_ints_hispeed.c b/lib/def_ints_hispeed.c new file mode 100644 index 0000000..9f1dc59 --- /dev/null +++ b/lib/def_ints_hispeed.c @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + +#include <usbjt.h> + +// copied usb jt routines from usbjt.h +void hispeed_isr() interrupt HISPEED_ISR {} diff --git a/lib/def_ints_reset.c b/lib/def_ints_reset.c new file mode 100644 index 0000000..b3191a8 --- /dev/null +++ b/lib/def_ints_reset.c @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + +#include <usbjt.h> + +// copied usb jt routines from usbjt.h +void usbreset_isr() interrupt USBRESET_ISR {} diff --git a/lib/def_ints_sof.c b/lib/def_ints_sof.c new file mode 100644 index 0000000..1fb63bf --- /dev/null +++ b/lib/def_ints_sof.c @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + +#include <usbjt.h> + +// copied usb jt routines from usbjt.h +void sof_isr() interrupt SOF_ISR {} diff --git a/lib/def_ints_sudav.c b/lib/def_ints_sudav.c new file mode 100644 index 0000000..40b8159 --- /dev/null +++ b/lib/def_ints_sudav.c @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2009 Steve Calfee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **/ + +#include <usbjt.h> + +// copied usb jt routines from usbjt.h +void sudav_isr() interrupt SUDAV_ISR {} -- 1.6.3.3 |
From: Steve C. <nos...@ya...> - 2009-11-24 02:01:23
|
--- On Mon, 11/23/09, Dennis Muhlestein <de...@ub...> wrote: > From: Dennis Muhlestein <de...@ub...> > Subject: Re: [Fx2lib-devel] fx1lib - cypress license issues > To: "fx2lib developer mailing list" <fx2...@li...> > Date: Monday, November 23, 2009, 8:27 AM > > > Steve Calfee wrote: > > Hi, > > > > I would like to extend fx2lib to work with the > original, full speed ezusb system. I have some cheap keyspan > serial adapters to play with. > > > fx2lib should already work with full speed USB > systems. If you know of > any area that doesn't work, please let us know. If > you #define FX2 > before including headers, then FX1 code is enabled. > So far, the only > thing that is changes is the address of the debug LEDs on > the dev > boards. I don't know of any other changes that need > to be made at this > point though but I don't have an FX1 development board. > Ok, after looking at the code, the only thing that changes with fx1 being defined is the few debug LEDs, on a board I don't have. There are many more changes in the registers etc. I will build the header files from the Spanish files and you can include them in fx2lib. I will not ask any more legal questions, and will only add essential definitions that must match the actual hardware for the fx1. I really recommend either finding on the net or going to Fry's and finding a keyspan serial adapter that uses a fx1/ezusb. It is the lowest cost hardware to really test or work a full speed usb. |
From: Dennis M. <de...@ub...> - 2009-11-23 18:37:19
|
> Hi Dennis, I wondered about why FX2. I guess I assumed that all the fx1 registers were in different places than the fx2, certainly the endpoints are, so I assumed we would need different headers. > > Anyway, I will try this and report back in a few days. > > Feel free to send any contributions/patches. -Dennis |
From: Steve C. <nos...@ya...> - 2009-11-23 18:34:37
|
On Mon, 11/23/09, Dennis Muhlestein <de...@ub...> wrote: > From: Dennis Muhlestein <de...@ub...> > Subject: Re: [Fx2lib-devel] fx1lib - cypress license issues > To: "fx2lib developer mailing list" <fx2...@li...> > Date: Monday, November 23, 2009, 8:30 AM > > > fx2lib should already work with full speed USB > systems. If you know of > > any area that doesn't work, please let us know. > If you #define FX2 > > > I typod that: > > #define FX1 before including the header files to enable FX1 > differences. > > -Dennis > > Hi Dennis, I wondered about why FX2. I guess I assumed that all the fx1 registers were in different places than the fx2, certainly the endpoints are, so I assumed we would need different headers. Anyway, I will try this and report back in a few days. Regards, Steve |
From: Dennis M. <de...@ub...> - 2009-11-23 16:30:22
|
> fx2lib should already work with full speed USB systems. If you know of > any area that doesn't work, please let us know. If you #define FX2 > I typod that: #define FX1 before including the header files to enable FX1 differences. -Dennis |
From: Dennis M. <de...@ub...> - 2009-11-23 16:27:39
|
Steve Calfee wrote: > Hi, > > I would like to extend fx2lib to work with the original, full speed ezusb system. I have some cheap keyspan serial adapters to play with. > fx2lib should already work with full speed USB systems. If you know of any area that doesn't work, please let us know. If you #define FX2 before including headers, then FX1 code is enabled. So far, the only thing that is changes is the address of the debug LEDs on the dev boards. I don't know of any other changes that need to be made at this point though but I don't have an FX1 development board. > My question is has Cypress allowed the use of its header files? I don't know why they would not, but who can guess with lawyers? I found the cypress headers fixed by some kid in Spain, to work with the SDCC syntax instead of Keil. They still have the cypress copyright, but is that ok for using in fx2lib? > You can use any header file you want as long as it is compatible with SDCC. The fx2 library does internally depend on the supplied fx2regs.h though. > This fx.h file has been maybe manually converted like the fx2regs.h file in fx2lib. Is search and replace sufficient to establish a new copyright like claimed at the head of fx2regs.h? This whole licensing of basically names and a (fixed by hardware) address, is really stretching the definition of copyright. However, IANAL, so how has Ubixum decided on this? > The register names are publicly available information available in the EZ-USB TRM. Whether we searched/replaced or recoded the entire file by hand, we would have come up with the same header file for SDCC. The Cypress license allows modification of their files for use with their chips and fx2lib is only useful for their products. > The only questionable licensing issues are the few Cypress headers defining register names and possibly a header defining structures that match USB defined fields. > USB defined fields are open standards that anyone can implement. You can get the spec right from www.usb.org. -Dennis |
From: Steve C. <nos...@ya...> - 2009-11-22 02:51:52
|
Hi, I would like to extend fx2lib to work with the original, full speed ezusb system. I have some cheap keyspan serial adapters to play with. My question is has Cypress allowed the use of its header files? I don't know why they would not, but who can guess with lawyers? I found the cypress headers fixed by some kid in Spain, to work with the SDCC syntax instead of Keil. They still have the cypress copyright, but is that ok for using in fx2lib? This fx.h file has been maybe manually converted like the fx2regs.h file in fx2lib. Is search and replace sufficient to establish a new copyright like claimed at the head of fx2regs.h? This whole licensing of basically names and a (fixed by hardware) address, is really stretching the definition of copyright. However, IANAL, so how has Ubixum decided on this? The only questionable licensing issues are the few Cypress headers defining register names and possibly a header defining structures that match USB defined fields. Regards, Steve |
From: Ben G. <bga...@gm...> - 2009-10-26 05:35:05
|
To start, thanks a ton for your message. I really appreciate it. As it generally turns out with these things, the problem was simple and completely unexpected. While initially reworking the code, I felt that the pin assignments could be renamed. Unfortunately, instead of changing the assignments themselves, I decided that it would be less error-prone if I just setup "alias" assignments from the new pin names to the old. Naturally, I quickly forgot that I did this and went on my way reworking the code. When I finally arrived at the point of testing and found that things weren't working, this assignment decision was far out of my mind. In fact, it wasn't until several days of searching that I finally came across this and on a whim set the assignments correctly. It was at this point that I learned that "alias" assignments don't seem to be aliases at all. Argh! But regardless, now things seem to be working (insofar as I can expect them to). Now it's time for the real debugging. Excerpts from Dennis Muhlestein's message of Wed Oct 21 17:32:40 -0400 2009: > We have a working slave fifo controller. The issues I had when getting > it up and running were with the timing of the data, the read/write > signals and the pktend signal. If I recall, we had issues needing to > wait one cycle between asserting the FD and the fx2_slwr and/or > fx2_pktend. I don't see how this would be an issue for you since you > aren't asserting different bytes between data though. > > You might try registering your inputs/outputs and asserting the signals > on posedge FX2_CLK. I'm not positive that will help but I do think the > FX2 may want at least a clock cycle at least before WR is asserted after > it deasserted the EP6_full signal. > > reg [2:0] fx2_flags_reg; > reg FIFO_WR; > wire FIFO6_full = fx2_flags_reg[1]; > assign FX2_SLWR = ~FIFO_WR; > always @(posedge FX2_CLK) begin > // resets, latches etc > ... else begin > if (!FIFO6_full) begin > FIFO_WR <= 1; > end else begin > FIFO_WR <= 0; > end > end > end > > Have you tried monitoring the fx2_flags on your LASER outputs? When I > was debugging our system, I created a counter that counted the number of > times the signals went low (for a lot of inputs/outputs besides the > flags too) and tied that to the lights. Eventually, I found some signal > that wasn't tied the way I thought it was supposed to be. > > I hope to release a Verilog behavioral model of the fx2 that implements > slave fifo along with our slave fifo interface. This helped me a lot > during debugging. As I was able to visualize what was supposed to be > going on instead of only having my "4 bit" LED display. > > A few firmware issues: > > You can't use ep6 quad and ep8 double at the same time. They use the > same memory space in the FX2. The best you can do is ep6 double/ep8 > double. See the TRM 1.18. This is a good catch. Guess I forgot to check whether my desired configuration was actually supported. > > An additional note, my handle_set_interface function has this: > > BOOL handle_set_interface(...) { > RESETTOGGLE(0x02); > RESETTOGGLE(0x86); > //.. other code > } > > Without the resets, my driver would get a timeout after a read that read > an odd number of packets. In addition, I had to put my endpoints in > interface 1 instead of 0 because on Windows, the driver never called the > set_interface USB command on interface 0 and the fx2 never reset the > TOGGLES. This just might be your whole issue but you'll have to test > and see. This is another very good point. Excellent advice. > > I'll let everyone know when I get the slave fifo interface and models > released. This would be fantastic. I've just started working on my own test harnesses. I'm omitting the FX2 for now, but it might be nice to include if a model were readily available. Thanks, - Ben |
From: Dennis M. <de...@ub...> - 2009-10-21 21:33:00
|
We have a working slave fifo controller. The issues I had when getting it up and running were with the timing of the data, the read/write signals and the pktend signal. If I recall, we had issues needing to wait one cycle between asserting the FD and the fx2_slwr and/or fx2_pktend. I don't see how this would be an issue for you since you aren't asserting different bytes between data though. You might try registering your inputs/outputs and asserting the signals on posedge FX2_CLK. I'm not positive that will help but I do think the FX2 may want at least a clock cycle at least before WR is asserted after it deasserted the EP6_full signal. reg [2:0] fx2_flags_reg; reg FIFO_WR; wire FIFO6_full = fx2_flags_reg[1]; assign FX2_SLWR = ~FIFO_WR; always @(posedge FX2_CLK) begin // resets, latches etc ... else begin if (!FIFO6_full) begin FIFO_WR <= 1; end else begin FIFO_WR <= 0; end end end Have you tried monitoring the fx2_flags on your LASER outputs? When I was debugging our system, I created a counter that counted the number of times the signals went low (for a lot of inputs/outputs besides the flags too) and tied that to the lights. Eventually, I found some signal that wasn't tied the way I thought it was supposed to be. I hope to release a Verilog behavioral model of the fx2 that implements slave fifo along with our slave fifo interface. This helped me a lot during debugging. As I was able to visualize what was supposed to be going on instead of only having my "4 bit" LED display. A few firmware issues: You can't use ep6 quad and ep8 double at the same time. They use the same memory space in the FX2. The best you can do is ep6 double/ep8 double. See the TRM 1.18. An additional note, my handle_set_interface function has this: BOOL handle_set_interface(...) { RESETTOGGLE(0x02); RESETTOGGLE(0x86); //.. other code } Without the resets, my driver would get a timeout after a read that read an odd number of packets. In addition, I had to put my endpoints in interface 1 instead of 0 because on Windows, the driver never called the set_interface USB command on interface 0 and the fx2 never reset the TOGGLES. This just might be your whole issue but you'll have to test and see. I'll let everyone know when I get the slave fifo interface and models released. -Dennis Ben Gamari wrote: > Hey all, > > Recently I have been experiencing great difficulty trying to get the FX2's > slave FIFO interface working on our KNJN Xylo EM. While the Windows tests work > precisely as expected, we have had to write our own FX2 firmware[1] for use > with the photon counter. For this, we setup endpoint 6 as an IN endpoint with > AUTOIN enabled. Unfortunately, even with the FPGA writing a constant stream of > data[2] to the endpoint, all reads time out and the FIFO claims to be empty. > > To rule out some deeper issue, I added test code to the firmware to > write data to initially seed the endpoint. This seed data is > successfully received by the host, demonstrating that the endpoint FIFO > is correctly configured to send data. Unfortunately, any further reads > of data provided by the FPGA ultimately time out. As mentioned earlier, > the FIFO's empty bit remains set after the seed data has been read. > Yet, looking at the FPGA's output on LASER[0123]_EN in the code > below, the FPGA seems to be pushing the correct values onto the FX2 pins > to write. It almost seems as if the slave FIFO pins aren't accepting input. > > Has anyone else observed behavior such as this? It seems that the problem is > likely in the slave FIFO pin configuration but after two days of comparing code > against other implementations, I've been utterly unable to find any issues. It > seems like this should be far simpler than it has been. > > For reference, I have included the source for both the 8051 firmware and the > FPGA Verilog code. I would greatly appreciate any input that you might have. > > - Ben > > > > [1] Verilog code for FPGA data producer > module fx2_test( > FX2_CLK, > FX2_WU2, > > FX2_FIFOADR, FX2_FD, > > FX2_flags, > FX2_PKTEND, > FX2_SLOE, FX2_SLWR, FX2_SLRD, > > LED, Push_button, > > LASER0_EN, > LASER1_EN, > LASER2_EN, > LASER3_EN > ); > > input FX2_CLK; > input [2:0] FX2_flags; > input Push_button; > > output FX2_WU2; > output [1:0] FX2_FIFOADR; > output FX2_PKTEND; > output FX2_SLOE; > output FX2_SLWR; > output FX2_SLRD; > > output [1:0] LED; > output LASER0_EN; > output LASER1_EN; > output LASER2_EN; > output LASER3_EN; > inout [7:0] FX2_FD; > > // FX2 inputs > wire FIFO_RD, FIFO_WR, FIFO_PKTEND, FIFO_DATAIN_OE; > wire FX2_SLRD = ~FIFO_RD; > wire FX2_SLWR = ~FIFO_WR; > assign FX2_SLOE = ~FIFO_DATAIN_OE; > assign FX2_PKTEND = ~FIFO_PKTEND; > > wire FIFO2_empty = ~FX2_flags[0]; wire FIFO2_data_available = ~FIFO2_empty; > wire FIFO6_full = ~FX2_flags[1]; wire FIFO6_ready_to_accept_data = ~FIFO6_full; > wire FIFO8_full = ~FX2_flags[2]; wire FIFO8_ready_to_accept_data = ~FIFO8_full; > > wire [1:0] FIFO_FIFOADR; > assign FX2_FIFOADR = FIFO_FIFOADR; > > assign FX2_WU2 = 1'b0; // This is active-low > assign FIFO_FIFOADR = 2'b10; // EP6 > assign FX2_FD = 8'hAB; > assign FIFO_RD = 0; > assign FIFO_WR = FIFO6_ready_to_accept_data; > assign FIFO_DATAIN_OE = 0; > assign FIFO_PKTEND = 0; > > assign LED[0] = FX2_SLOE; > assign LED[1] = FIFO6_ready_to_accept_data; > > assign LASER0_EN = FIFO6_ready_to_accept_data; > assign LASER1_EN = FX2_SLOE; > assign LASER2_EN = FX2_SLWR; > assign LASER3_EN = FX2_CLK; > > endmodule > > > > > [2] Firmware Source (using fx2lib headers) > > #include <stdio.h> > > #include <fx2regs.h> > #include <fx2macros.h> > #include <delay.h> > #include <setupdat.h> > #include <eputils.h> > #include <usbjt.h> > > #define SYNCDELAY() SYNCDELAY4 > > > volatile bit got_sud; > > void reset_toggle(int ep, int dir) { > TOGCTL = ep | (dir << 4); > TOGCTL = ep | (dir << 4) | (1 << 5); > } > > void main() { > int i; > > got_sud = FALSE; > > // Renumerate > RENUMERATE(); > > CLRERRCNT = 1; > CPUCS = 0x00; SYNCDELAY(); > //CPUCS = 0x12; SYNCDELAY(); // 48MHz, output to CLKOUT > //IFCONFIG = 0xe3; SYNCDELAY(); // Configure IFCLK and enable slave FIFOs > WAKEUPCS = 0x06; SYNCDELAY(); // Active-low polarity on WU2, enable as wake-up source > > USE_USB_INTS(); > ENABLE_SUDAV(); > ENABLE_HISPEED(); > ENABLE_USBRESET(); > > // Enable stuff > REVCTL = 0x03; > > // Configure endpoints > EP2CFG = 0xa2; SYNCDELAY(); // Endpoint 2: OUT, bulk, 512 bytes, double-buffered > EP6CFG = 0xe0; SYNCDELAY(); // Endpoint 6: IN, bulk, 512 bytes, quad-buffered > EP8CFG = 0xe2; SYNCDELAY(); // Endpoint 8: IN, bulk, 512 bytes, double-buffered > > // All others invalid > //EP1INCFG &= ~bmVALID; SYNCDELAY(); > EP1OUTCFG &= ~bmVALID; SYNCDELAY(); > EP4CFG &= ~bmVALID; SYNCDELAY(); > > // NAKALL all endpoints and reset > FIFORESET = 0x80; SYNCDELAY(); > FIFORESET = 0x82; SYNCDELAY(); // EP2 > FIFORESET = 0x84; SYNCDELAY(); // EP4 > FIFORESET = 0x86; SYNCDELAY(); // EP6 > FIFORESET = 0x88; SYNCDELAY(); // EP8 > FIFORESET = 0x00; SYNCDELAY(); // Turn off NAKALL > > // Configure EP2 FIFO: > OUTPKTEND = 0x82; SYNCDELAY(); > OUTPKTEND = 0x82; SYNCDELAY(); // Arm endpoint > EP2FIFOCFG = 0x10; SYNCDELAY(); // Auto Out, 8-bit data bus > > // Configure EP4 FIFO: > EP4FIFOCFG = 0x00; SYNCDELAY(); // Just make sure WORDWIDE=0 > > // Configure EP6 FIFO: > // Data packets are 512 bytes > EP6FIFOCFG = 0x08; SYNCDELAY(); // Auto In > EP6AUTOINLENH = 0x02; SYNCDELAY(); > EP6AUTOINLENL = 0x00; SYNCDELAY(); > > // Configure EP8 FIFO: > // Command replies are 8 bytes > EP8FIFOCFG = 0x08; SYNCDELAY(); // Auto in > EP8AUTOINLENH = 0x00; SYNCDELAY(); > EP8AUTOINLENL = 0x08; SYNCDELAY(); > > // Setup endpoint status flags > PINFLAGSAB = 0xe8; SYNCDELAY(); // FLAGA=0x8=FIFO2 Empty, FLAGB=0xe=FIFO6 Full > PINFLAGSCD = 0x0f; SYNCDELAY(); // FLAGC=0xf=FIFO8 Full > FIFOPINPOLAR = 0x00; SYNCDELAY(); // Use default (active-low) polarities > > reset_toggle(2, 0); > reset_toggle(6, 1); > reset_toggle(8, 1); > IFCONFIG = 0xa3; SYNCDELAY(); // Configure IFCLK and enable slave FIFOs > EA = 1; SYNCDELAY(); // Turn on interrupts > > for (i=0; i<255; i++) > EP6FIFOBUF[i] = i; > EP6BCL = 255; > > while(TRUE) { > > if (got_sud) { > handle_setupdata(); > got_sud = FALSE; > } > > if (!(EP1INCS & 0x2)) { > EP1INBUF[0] = EP6CS; > EP1INBUF[1] = 0x00; > EP1INBUF[2] = EP2468STAT; > EP1INBUF[3] = 0x00; > EP1INBUF[4] = EP6BCH; > EP1INBUF[5] = EP6BCL; > EP1INBUF[6] = 0x00; > EP1INBUF[7] = ERRCNTLIM; > > EP1INBUF[8] = 0x00; > EP1INBUF[9] = 0x00; > EP1INBUF[10] = 0x00; > EP1INBUF[11] = 0x00; > EP1INBUF[12] = 0x00; > EP1INBUF[13] = 0x00; > EP1INBUF[14] = 0x00; > EP1INBUF[15] = 0x00; > > EP1INBC = 16; > } > > #define EP6_TEST 0 > #if EP6_TEST > if (!(EP6CS & 0x8)) { > for (i=0; i<128; i++) > EP6FIFOBUF[i] = i; > EP6BCL = 128; > } > #endif > } > } > > // return TRUE if you handle the command > // you can directly get SETUPDAT[0-7] for the data sent with the command > BOOL handle_vendorcommand(BYTE cmd) { cmd=cmd; return FALSE; } > > // We only support interface 0,0 > BOOL handle_get_interface(BYTE ifc, BYTE* alt_ifc) { > if (ifc == 0) { > *alt_ifc = 0; > return TRUE; > } else > return FALSE; > } > > BOOL handle_set_interface(BYTE ifc, BYTE alt_ifc) { return ifc == 0 && alt_ifc == 0; } > > // We only handle configuration 1 > BYTE handle_get_configuration() { return 1; } > > BOOL handle_set_configuration(BYTE cfg) { return cfg==1 ? TRUE : FALSE; } > > void sudav_isr() interrupt SUDAV_ISR { > got_sud = TRUE; > CLEAR_SUDAV(); > } > > void usbreset_isr() interrupt USBRESET_ISR { > handle_hispeed(FALSE); > CLEAR_USBRESET(); > } > void hispeed_isr() interrupt HISPEED_ISR { > handle_hispeed(TRUE); > CLEAR_HISPEED(); > } > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > |
From: Ben G. <bga...@gm...> - 2009-10-21 20:34:01
|
Hey all, Recently I have been experiencing great difficulty trying to get the FX2's slave FIFO interface working on our KNJN Xylo EM. While the Windows tests work precisely as expected, we have had to write our own FX2 firmware[1] for use with the photon counter. For this, we setup endpoint 6 as an IN endpoint with AUTOIN enabled. Unfortunately, even with the FPGA writing a constant stream of data[2] to the endpoint, all reads time out and the FIFO claims to be empty. To rule out some deeper issue, I added test code to the firmware to write data to initially seed the endpoint. This seed data is successfully received by the host, demonstrating that the endpoint FIFO is correctly configured to send data. Unfortunately, any further reads of data provided by the FPGA ultimately time out. As mentioned earlier, the FIFO's empty bit remains set after the seed data has been read. Yet, looking at the FPGA's output on LASER[0123]_EN in the code below, the FPGA seems to be pushing the correct values onto the FX2 pins to write. It almost seems as if the slave FIFO pins aren't accepting input. Has anyone else observed behavior such as this? It seems that the problem is likely in the slave FIFO pin configuration but after two days of comparing code against other implementations, I've been utterly unable to find any issues. It seems like this should be far simpler than it has been. For reference, I have included the source for both the 8051 firmware and the FPGA Verilog code. I would greatly appreciate any input that you might have. - Ben [1] Verilog code for FPGA data producer module fx2_test( FX2_CLK, FX2_WU2, FX2_FIFOADR, FX2_FD, FX2_flags, FX2_PKTEND, FX2_SLOE, FX2_SLWR, FX2_SLRD, LED, Push_button, LASER0_EN, LASER1_EN, LASER2_EN, LASER3_EN ); input FX2_CLK; input [2:0] FX2_flags; input Push_button; output FX2_WU2; output [1:0] FX2_FIFOADR; output FX2_PKTEND; output FX2_SLOE; output FX2_SLWR; output FX2_SLRD; output [1:0] LED; output LASER0_EN; output LASER1_EN; output LASER2_EN; output LASER3_EN; inout [7:0] FX2_FD; // FX2 inputs wire FIFO_RD, FIFO_WR, FIFO_PKTEND, FIFO_DATAIN_OE; wire FX2_SLRD = ~FIFO_RD; wire FX2_SLWR = ~FIFO_WR; assign FX2_SLOE = ~FIFO_DATAIN_OE; assign FX2_PKTEND = ~FIFO_PKTEND; wire FIFO2_empty = ~FX2_flags[0]; wire FIFO2_data_available = ~FIFO2_empty; wire FIFO6_full = ~FX2_flags[1]; wire FIFO6_ready_to_accept_data = ~FIFO6_full; wire FIFO8_full = ~FX2_flags[2]; wire FIFO8_ready_to_accept_data = ~FIFO8_full; wire [1:0] FIFO_FIFOADR; assign FX2_FIFOADR = FIFO_FIFOADR; assign FX2_WU2 = 1'b0; // This is active-low assign FIFO_FIFOADR = 2'b10; // EP6 assign FX2_FD = 8'hAB; assign FIFO_RD = 0; assign FIFO_WR = FIFO6_ready_to_accept_data; assign FIFO_DATAIN_OE = 0; assign FIFO_PKTEND = 0; assign LED[0] = FX2_SLOE; assign LED[1] = FIFO6_ready_to_accept_data; assign LASER0_EN = FIFO6_ready_to_accept_data; assign LASER1_EN = FX2_SLOE; assign LASER2_EN = FX2_SLWR; assign LASER3_EN = FX2_CLK; endmodule [2] Firmware Source (using fx2lib headers) #include <stdio.h> #include <fx2regs.h> #include <fx2macros.h> #include <delay.h> #include <setupdat.h> #include <eputils.h> #include <usbjt.h> #define SYNCDELAY() SYNCDELAY4 volatile bit got_sud; void reset_toggle(int ep, int dir) { TOGCTL = ep | (dir << 4); TOGCTL = ep | (dir << 4) | (1 << 5); } void main() { int i; got_sud = FALSE; // Renumerate RENUMERATE(); CLRERRCNT = 1; CPUCS = 0x00; SYNCDELAY(); //CPUCS = 0x12; SYNCDELAY(); // 48MHz, output to CLKOUT //IFCONFIG = 0xe3; SYNCDELAY(); // Configure IFCLK and enable slave FIFOs WAKEUPCS = 0x06; SYNCDELAY(); // Active-low polarity on WU2, enable as wake-up source USE_USB_INTS(); ENABLE_SUDAV(); ENABLE_HISPEED(); ENABLE_USBRESET(); // Enable stuff REVCTL = 0x03; // Configure endpoints EP2CFG = 0xa2; SYNCDELAY(); // Endpoint 2: OUT, bulk, 512 bytes, double-buffered EP6CFG = 0xe0; SYNCDELAY(); // Endpoint 6: IN, bulk, 512 bytes, quad-buffered EP8CFG = 0xe2; SYNCDELAY(); // Endpoint 8: IN, bulk, 512 bytes, double-buffered // All others invalid //EP1INCFG &= ~bmVALID; SYNCDELAY(); EP1OUTCFG &= ~bmVALID; SYNCDELAY(); EP4CFG &= ~bmVALID; SYNCDELAY(); // NAKALL all endpoints and reset FIFORESET = 0x80; SYNCDELAY(); FIFORESET = 0x82; SYNCDELAY(); // EP2 FIFORESET = 0x84; SYNCDELAY(); // EP4 FIFORESET = 0x86; SYNCDELAY(); // EP6 FIFORESET = 0x88; SYNCDELAY(); // EP8 FIFORESET = 0x00; SYNCDELAY(); // Turn off NAKALL // Configure EP2 FIFO: OUTPKTEND = 0x82; SYNCDELAY(); OUTPKTEND = 0x82; SYNCDELAY(); // Arm endpoint EP2FIFOCFG = 0x10; SYNCDELAY(); // Auto Out, 8-bit data bus // Configure EP4 FIFO: EP4FIFOCFG = 0x00; SYNCDELAY(); // Just make sure WORDWIDE=0 // Configure EP6 FIFO: // Data packets are 512 bytes EP6FIFOCFG = 0x08; SYNCDELAY(); // Auto In EP6AUTOINLENH = 0x02; SYNCDELAY(); EP6AUTOINLENL = 0x00; SYNCDELAY(); // Configure EP8 FIFO: // Command replies are 8 bytes EP8FIFOCFG = 0x08; SYNCDELAY(); // Auto in EP8AUTOINLENH = 0x00; SYNCDELAY(); EP8AUTOINLENL = 0x08; SYNCDELAY(); // Setup endpoint status flags PINFLAGSAB = 0xe8; SYNCDELAY(); // FLAGA=0x8=FIFO2 Empty, FLAGB=0xe=FIFO6 Full PINFLAGSCD = 0x0f; SYNCDELAY(); // FLAGC=0xf=FIFO8 Full FIFOPINPOLAR = 0x00; SYNCDELAY(); // Use default (active-low) polarities reset_toggle(2, 0); reset_toggle(6, 1); reset_toggle(8, 1); IFCONFIG = 0xa3; SYNCDELAY(); // Configure IFCLK and enable slave FIFOs EA = 1; SYNCDELAY(); // Turn on interrupts for (i=0; i<255; i++) EP6FIFOBUF[i] = i; EP6BCL = 255; while(TRUE) { if (got_sud) { handle_setupdata(); got_sud = FALSE; } if (!(EP1INCS & 0x2)) { EP1INBUF[0] = EP6CS; EP1INBUF[1] = 0x00; EP1INBUF[2] = EP2468STAT; EP1INBUF[3] = 0x00; EP1INBUF[4] = EP6BCH; EP1INBUF[5] = EP6BCL; EP1INBUF[6] = 0x00; EP1INBUF[7] = ERRCNTLIM; EP1INBUF[8] = 0x00; EP1INBUF[9] = 0x00; EP1INBUF[10] = 0x00; EP1INBUF[11] = 0x00; EP1INBUF[12] = 0x00; EP1INBUF[13] = 0x00; EP1INBUF[14] = 0x00; EP1INBUF[15] = 0x00; EP1INBC = 16; } #define EP6_TEST 0 #if EP6_TEST if (!(EP6CS & 0x8)) { for (i=0; i<128; i++) EP6FIFOBUF[i] = i; EP6BCL = 128; } #endif } } // return TRUE if you handle the command // you can directly get SETUPDAT[0-7] for the data sent with the command BOOL handle_vendorcommand(BYTE cmd) { cmd=cmd; return FALSE; } // We only support interface 0,0 BOOL handle_get_interface(BYTE ifc, BYTE* alt_ifc) { if (ifc == 0) { *alt_ifc = 0; return TRUE; } else return FALSE; } BOOL handle_set_interface(BYTE ifc, BYTE alt_ifc) { return ifc == 0 && alt_ifc == 0; } // We only handle configuration 1 BYTE handle_get_configuration() { return 1; } BOOL handle_set_configuration(BYTE cfg) { return cfg==1 ? TRUE : FALSE; } void sudav_isr() interrupt SUDAV_ISR { got_sud = TRUE; CLEAR_SUDAV(); } void usbreset_isr() interrupt USBRESET_ISR { handle_hispeed(FALSE); CLEAR_USBRESET(); } void hispeed_isr() interrupt HISPEED_ISR { handle_hispeed(TRUE); CLEAR_HISPEED(); } |
From: Dennis M. <de...@ub...> - 2009-10-05 12:01:47
|
On Oct 5, 2009, at 3:25 AM, S S wrote: > > and you should see the bix file created with the size 16k (or > whatever size you selec with the -m option). > Note that the -f 0xC2 setup is to boot from the EEPROM so I am not > sure what it should be setup as if just playing with a bix file > (0xC0 ?). > With bix format, the load byte is ignored. -Dennis |
From: S S <ss...@ho...> - 2009-10-05 09:25:12
|
Folks, Finally managed to get to the desired result using hex2bix on windows. The -m option for specifying the target memory size (default is 8k) does work. Just don't type -m 16k but -m 16000 So the command line used to convert a file from .ihx to .icc is: hex2bix -i -m 16000 -f 0xC2 -o MyFile.icc MyFile.ihx If you want the file in bix format then it is: hex2bix -b -m 16000 -f 0xC2 -o MyFile.bix MyFile.ihx and you should see the bix file created with the size 16k (or whatever size you selec with the -m option). Note that the -f 0xC2 setup is to boot from the EEPROM so I am not sure what it should be setup as if just playing with a bix file (0xC0 ?). Cheers, Sebastien > From: de...@ub... > To: fx2...@li... > Date: Sat, 3 Oct 2009 06:27:07 -0600 > Subject: Re: [Fx2lib-devel] FX2 Bulkloop example compiled sized > > > On Oct 3, 2009, at 5:15 AM, Chris McClelland wrote: > > > If you're developing with SDCC and fx2lib on Windows you may find this > > useful: > > > > http://www.makestuff.eu/wordpress/?page_id=343 > > Thanks Chris, for mentioning that post again. My plan for the fxload > package is to remove the bix file format requirement completely and > load ihx files directly. I already do this in my own drivers but just > haven't had a chance to integrate the code back into fx2lib. I'd like > to make fx2lib much more friendly for Windows development in the next > round of changes I make. > > -Dennis > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel _________________________________________________________________ View your other email accounts from your Hotmail inbox. Add them now. http://clk.atdmt.com/UKM/go/167688463/direct/01/ |
From: S S <ss...@ho...> - 2009-10-04 14:21:36
|
Chris, Dennis, Thanks for the tips. Sebastien > From: de...@ub... > To: fx2...@li... > Date: Sat, 3 Oct 2009 06:27:07 -0600 > Subject: Re: [Fx2lib-devel] FX2 Bulkloop example compiled sized > > > On Oct 3, 2009, at 5:15 AM, Chris McClelland wrote: > > > If you're developing with SDCC and fx2lib on Windows you may find this > > useful: > > > > http://www.makestuff.eu/wordpress/?page_id=343 > > Thanks Chris, for mentioning that post again. My plan for the fxload > package is to remove the bix file format requirement completely and > load ihx files directly. I already do this in my own drivers but just > haven't had a chance to integrate the code back into fx2lib. I'd like > to make fx2lib much more friendly for Windows development in the next > round of changes I make. > > -Dennis > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel _________________________________________________________________ Learn how to add other email accounts to Hotmail in 3 easy steps. http://clk.atdmt.com/UKM/go/167688463/direct/01/ |
From: Dennis M. <de...@ub...> - 2009-10-03 12:27:26
|
On Oct 3, 2009, at 5:15 AM, Chris McClelland wrote: > If you're developing with SDCC and fx2lib on Windows you may find this > useful: > > http://www.makestuff.eu/wordpress/?page_id=343 Thanks Chris, for mentioning that post again. My plan for the fxload package is to remove the bix file format requirement completely and load ihx files directly. I already do this in my own drivers but just haven't had a chance to integrate the code back into fx2lib. I'd like to make fx2lib much more friendly for Windows development in the next round of changes I make. -Dennis |
From: Chris M. <fx...@m3...> - 2009-10-03 11:42:38
|
If you're developing with SDCC and fx2lib on Windows you may find this useful: http://www.makestuff.eu/wordpress/?page_id=343 On Sat, 2009-10-03 at 10:29 +0000, S S wrote: > Hi Dennis, > > The hex2bix has a parameter -m to specify the size of the memory for > the target device but that didn't seem to make a difference. The > format for specifying the size is not given however so I might have > made a mistake when entering it. > > Failing that I'll use objcopy (I am on windows just now so I will have > to swap to linux for this I believe). > > I am away from my desk at the moment but I'll let you know the results > once I get a chance of playing with all that some more. > > Cheers, > > Sebastien > > > > > Date: Fri, 2 Oct 2009 09:44:04 -0600 > > From: de...@ub... > > To: fx2...@li... > > Subject: Re: [Fx2lib-devel] FX2 Bulkloop example compiled sized > > > > Hi Sebastien, > > > > For me, The files (on Linux) are: > > > > bulkloop.asm: 58K > > bulkloop.rel 23K > > bulkloop.ihx 18K > > > > The ihx file size isn't really relevant to the firmware size, the > most > > important thing is the bix size and the iic (for the eeprom) size. > > > > With hex2bix, you probably need to pass in a parameter for the max > size > > or something. What is the command line you are using that is > showing > > you the error? > > > > I haven't really used hex2bix much though since objcopy already has > > built in support for ihex files: > > > > objcopy -I ihex -O binary bulkloop.ihx bulkloop.bix > > > > That gives me: > > bulkloop.bix = 8.7K > > > > ihx2iic.py (from the fx2lib/utils directory) > > ihx2iic.py bulkloop.ihx bulkloop.iic > > bulkloop.iic = 5186 bytes > > > > Bix files must be <= 16K to be loadable on the FX2 > > iic files must be <= size of the eeprom. The Cypress dev board has > a > > 16K eeprom. Some boards use an 8K or smaller prom. This iic file > > should fit on either size prom. > > > > You might want to make sure your fx2lib is up to date. A while back > I > > pushed a fix to get rid of printf statements in some of the > libraries > > (those can be enabled for debugging but shouldn't be there for > > production firmware.) Before that there would be extra functions or > > printing included in the final firmware even if you didn't use them. > > > > -Dennis > > > > S S wrote: > > > Hi Dennis, > > > > > > What sizes of .ihx and .iic files do you get using your bulkloop > example? > > > I get the following sizes: > > > bulkloop.asm = 60kB > > > bulkloop.rel = 24kB > > > bulkloop.ihx = 21kB > > > > > > and the hex2bix firmware returns an error telling me the input > image > > > is too big for output file size Addr = 0x2000, len = 0xe > > > > > > The bulkloop example from cypress in comparison is around 2kB and > it > > > does not look too dissimilar to what you have done. > > > > > > Any idea on where I might have gone wrong? > > > > > > Incidentally what is the command you are using with sdcc for this > example? > > > > > > Cheers, > > > > > > Sebastien > > > > > > > > > > ------------------------------------------------------------------------ > > > Beyond Hotmail - see what else you can do with Windows Live. Find > out > > > more. <http://clk.atdmt.com/UKM/go/134665375/direct/01/> > > > > ------------------------------------------------------------------------ > > > > > > > ------------------------------------------------------------------------------ > > > Come build with us! The BlackBerry® Developer Conference in > SF, CA > > > is the only developer event you need to attend this year. > Jumpstart your > > > developing skills, take BlackBerry mobile applications to market > and stay > > > ahead of the curve. Join us from November 9-12, 2009. Register > now! > > > http://p.sf.net/sfu/devconf > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Fx2lib-devel mailing list > > > Fx2...@li... > > > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > > > > > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry® Developer Conference in SF, > CA > > is the only developer event you need to attend this year. Jumpstart > your > > developing skills, take BlackBerry mobile applications to market and > stay > > ahead of the curve. Join us from November 9-12, 2009. Register > now! > > http://p.sf.net/sfu/devconf > > _______________________________________________ > > Fx2lib-devel mailing list > > Fx2...@li... > > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > > > ______________________________________________________________________ > Have more than one Hotmail account? Link them together to easily > access both. > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ Fx2lib-devel mailing list Fx2...@li... https://lists.sourceforge.net/lists/listinfo/fx2lib-devel |
From: S S <ss...@ho...> - 2009-10-03 10:29:31
|
Hi Dennis, The hex2bix has a parameter -m to specify the size of the memory for the target device but that didn't seem to make a difference. The format for specifying the size is not given however so I might have made a mistake when entering it. Failing that I'll use objcopy (I am on windows just now so I will have to swap to linux for this I believe). I am away from my desk at the moment but I'll let you know the results once I get a chance of playing with all that some more. Cheers, Sebastien > Date: Fri, 2 Oct 2009 09:44:04 -0600 > From: de...@ub... > To: fx2...@li... > Subject: Re: [Fx2lib-devel] FX2 Bulkloop example compiled sized > > Hi Sebastien, > > For me, The files (on Linux) are: > > bulkloop.asm: 58K > bulkloop.rel 23K > bulkloop.ihx 18K > > The ihx file size isn't really relevant to the firmware size, the most > important thing is the bix size and the iic (for the eeprom) size. > > With hex2bix, you probably need to pass in a parameter for the max size > or something. What is the command line you are using that is showing > you the error? > > I haven't really used hex2bix much though since objcopy already has > built in support for ihex files: > > objcopy -I ihex -O binary bulkloop.ihx bulkloop.bix > > That gives me: > bulkloop.bix = 8.7K > > ihx2iic.py (from the fx2lib/utils directory) > ihx2iic.py bulkloop.ihx bulkloop.iic > bulkloop.iic = 5186 bytes > > Bix files must be <= 16K to be loadable on the FX2 > iic files must be <= size of the eeprom. The Cypress dev board has a > 16K eeprom. Some boards use an 8K or smaller prom. This iic file > should fit on either size prom. > > You might want to make sure your fx2lib is up to date. A while back I > pushed a fix to get rid of printf statements in some of the libraries > (those can be enabled for debugging but shouldn't be there for > production firmware.) Before that there would be extra functions or > printing included in the final firmware even if you didn't use them. > > -Dennis > > S S wrote: > > Hi Dennis, > > > > What sizes of .ihx and .iic files do you get using your bulkloop example? > > I get the following sizes: > > bulkloop.asm = 60kB > > bulkloop.rel = 24kB > > bulkloop.ihx = 21kB > > > > and the hex2bix firmware returns an error telling me the input image > > is too big for output file size Addr = 0x2000, len = 0xe > > > > The bulkloop example from cypress in comparison is around 2kB and it > > does not look too dissimilar to what you have done. > > > > Any idea on where I might have gone wrong? > > > > Incidentally what is the command you are using with sdcc for this example? > > > > Cheers, > > > > Sebastien > > > > > > ------------------------------------------------------------------------ > > Beyond Hotmail - see what else you can do with Windows Live. Find out > > more. <http://clk.atdmt.com/UKM/go/134665375/direct/01/> > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry® Developer Conference in SF, CA > > is the only developer event you need to attend this year. Jumpstart your > > developing skills, take BlackBerry mobile applications to market and stay > > ahead of the curve. Join us from November 9-12, 2009. Register now! > > http://p.sf.net/sfu/devconf > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Fx2lib-devel mailing list > > Fx2...@li... > > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel _________________________________________________________________ Save time by using Hotmail to access your other email accounts. http://clk.atdmt.com/UKM/go/167688463/direct/01/ |
From: Dennis M. <de...@ub...> - 2009-10-02 18:24:11
|
Hi Sebastien, For me, The files (on Linux) are: bulkloop.asm: 58K bulkloop.rel 23K bulkloop.ihx 18K The ihx file size isn't really relevant to the firmware size, the most important thing is the bix size and the iic (for the eeprom) size. With hex2bix, you probably need to pass in a parameter for the max size or something. What is the command line you are using that is showing you the error? I haven't really used hex2bix much though since objcopy already has built in support for ihex files: objcopy -I ihex -O binary bulkloop.ihx bulkloop.bix That gives me: bulkloop.bix = 8.7K ihx2iic.py (from the fx2lib/utils directory) ihx2iic.py bulkloop.ihx bulkloop.iic bulkloop.iic = 5186 bytes Bix files must be <= 16K to be loadable on the FX2 iic files must be <= size of the eeprom. The Cypress dev board has a 16K eeprom. Some boards use an 8K or smaller prom. This iic file should fit on either size prom. You might want to make sure your fx2lib is up to date. A while back I pushed a fix to get rid of printf statements in some of the libraries (those can be enabled for debugging but shouldn't be there for production firmware.) Before that there would be extra functions or printing included in the final firmware even if you didn't use them. -Dennis S S wrote: > Hi Dennis, > > What sizes of .ihx and .iic files do you get using your bulkloop example? > I get the following sizes: > bulkloop.asm = 60kB > bulkloop.rel = 24kB > bulkloop.ihx = 21kB > > and the hex2bix firmware returns an error telling me the input image > is too big for output file size Addr = 0x2000, len = 0xe > > The bulkloop example from cypress in comparison is around 2kB and it > does not look too dissimilar to what you have done. > > Any idea on where I might have gone wrong? > > Incidentally what is the command you are using with sdcc for this example? > > Cheers, > > Sebastien > > > ------------------------------------------------------------------------ > Beyond Hotmail - see what else you can do with Windows Live. Find out > more. <http://clk.atdmt.com/UKM/go/134665375/direct/01/> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > ------------------------------------------------------------------------ > > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > |