From: Wolfgang R. <wol...@ra...> - 2002-05-09 09:03:19
|
"Lanier, Paul" schrieb: > > Hello, > I've recently begun porting my firmware for a Cypress USB chip (FX2) > to sdcc. I was originally using the tools from Keil Software that came with > it but they had a 4K code limit (on a chip with 8K memory) and they wanted > $1600 to upgrade. I was very thankful to find an open source compiler was > available. Anyway, most of the transition has been pretty smooth so far. I > haven't actually tried the code out but I've got 90% of it to compile. I > just have a few problems left in compiling, then I'll have to sort out the > memory mapping. If have the Cypress Framework running complete on sdcc on linux. There were some adaptions necessary to get it running. Some C code is changed in inline assembler. Keil has a incomplete type checking and so original Cypress Code do not compile. Further is the byte order for 16-bit integers different in SDCC and Keil. The framework now is linked to startaddress 0 so all the brainless code for the Keil demo compiler version is gone. The Cypress library is ported to sdcc also the assembler parts. Currently I am not shure if it is possible to publish the code due to the copyright in the Cypress code. But my extension are GPL. If somebody is intrested please contact me. > > -First, does anyone have any documentation on the asx8051 assembler. The > syntax is different than that of the Keil assembler. All I need is info on > all the assembler directives available (like .area, etc.) and how they work > so it may not even need to be asx8051 specific (i.e. Is there a commercial > assembler that uses similar syntax?). The Keil demo version have documentation I think. > jump vector > -Second, the frameworks code written by Cypress to handle the USB functions > uses a jump table for USB interrupts. I'm not sure exactly sure how they > got the Keil compiler to do things right but the basic idea is that the jump > table is written in assembler and then all the interrupts are labeled in the > c source as "interrupt 0". Any ideas on how to get this to work correctly > with sdcc? I've attached the assembler for the jump table and the c file > where the interrupt procedures were declared. > I fall in the same problem and I don't find any way to tell the linker to add jump tables at fixed memory locations. There were some hints on this list but I get no success. It was also not possible to write C Code for the auto interrupt routines indicating a lot of interrupt 0 like in periph.c from Cypress samples. Keil use a special pragma NOIV to do this. I don't know if other have success linking the jump tables with the current used assembler and linker in SDCC. What I have done: - adding the missed funktions to sdcc - PRAGMA NOIV, compiler options to generate the autojump vector tables by sdcc at fixed address after the sdcc start code. Support for dual datapointer. All this is done in sdcc 2.2.1. Now I am able to build Cypress ezusb code on my linux box using a makefile. If it is intresting for the developper crew to add the extensions 2.3.0 let me know how to send this changes. > -Third, has anyone else ever used sdcc with Cypress ezusb chips? Any > problems I should look out for? It works. The DELAY_COUNT in fw.c must be changed because sdcc seems to generate faster code then Keil at this point. I use 19248*8L instead of 9248*8L , don#t compute it exactly. > > Thanks, > > Paul Lanier > <<periph.c>> <<USBJmpTb.a51>> > ------------------------ > Paul Lanier > Product Development Engineer > Analog Devices > ------------------------ Bye Wolfgang Rapp |