Last Update : 2008/Feb/14
SDCC Know How
Purpose
Sample code
Tools
How to use
Know How
Wanted
Thanks to
<< Return

    EZ-USB, FX, FX2 are very popular. The reason why, it is very affodable solution for development wiht firmware loading via USB it self.However, firmware development is still hard for us. EZ-USB series devices are manufactured/sold by Cypress semiconductor.It is needed Keil-compiler for firmware development of EZ-USB series devices. Software Development Kit(SDK) contains trial version of Keil compiler. However, the trial version compiler has limitation of 4KB for firmware building.


  • Purpose

    On the other hand, we also have free compiler system. SDCC is the most famous compiler for our purpose. It can create object code not only 8051(as used in EZ-USB) but also PIC. However, frame-work of USB is very big, it has been coded by Keil-compiler system as well. Still we have difference between Keil-compiler and SDCC. It means quite difficult to port SDCC system from Keil-compiler. Also, we encountered a problem which is called "Reinventing the wheel".

    fenrir has been creating FX2 system. He has opened a ported code on his blog as well. Also it has BBS system on the blog which contains useful information for using SDCC.

    OK, ofcourse. As usually, we need long time for starting-up that type of program. I hope to reduce time of starting-up, for concentrating application side as well.


  • Sample code

    Caution:
    Since, following sample code are ported from bulkloop. Some code are tested until Renum-level as well. It is needed for enought testing, if you use your own project.Those code are compiled by SDCC version is 2.7.0.

    • FX2

      Those sample code for FX2 kit which is released from Optimize. It is very affordable solution for proto-type developer.

      • bulkloop

        It is a very basic/simple firmware. Many developer are using the firmware which is customized from bulkloop.

      • FX2FW

        Kit developer/seller optimize also released his own firmware for his products. More complex apllication should use this firmware especiall GPIF/FIFO using as well.

      • tcxmaster

        TS capturing system for FX2 single.

    • ChamelonFX2

      Since, ChamelonUSB is very useful tools for us. However, it is little bit obsolted at moment. Market needs USB2.0 board as ChamelonFX2

      • spd_chk

        spd_chk is bench mark software for measuring transfer speed as transmit/receive. Ported from Keil-compiler to SDCC. We can compare firmware processing speed between Keil-compiler and SDCC as well.

      • cap_sts

        ChameleonUSB has a killer applicaiton. ChameleonFX2 also is getting a killer application ... ? cap_sts is capturing system for TS directly capturing from TS-Tuner.

    • Download sample code

      Download from here.


  • Tools

    • Cypress FX2 SDK

      Cypress provide SDK for EZ-USB FX2 system. It should be installed before developing for avoiding driver loading problem. More detail information from here (totally written in Japanese).

    • SDCC

      SDCC is a free compiler system. You can download it which is adapted your operating system from here. For windows sytem is easiest installing as well.

    • make

      You don't have to install "make", if you are using Unix operating system for firmaware development. Also, you are using Windows operatitng system. You have to find out "make"(a.k.a MinGW gmake?) and install your system by your self.

    • Binary translation tools

      Usually, firmware is generated as intel-hex format. Binary translation is very useful for using application software.

      • Windows

        Use "Hex2Bix" which is installed with Cypress SDK.

      • UNIX

        Use objcopy

        You have to confirm path-setting for tools. Not conciously, for using the tools which are invoked from make file.

    • Binary to C source code converter

      I guess that "binary to C source code converter tool is delivered by previous version of SDK. I could not find that type of tool in current version of Cypress SDK. bin2c is very useful tool, if you delivered combine firmware + host software within one file.

      • Windows

        Windows OS does not have compiling environment, I prepare execute code.

      • UNIX 系 OS

        You can use freely compile at UNIX OS from source code as well.

      • How to use
        1. How to make firm.c

          Firstly, you have to make filename.bix. Also set path for bin2c. Finally, do following command.

          bin2c filename.bix

          firm.c is created in current directory.

        2. How to combine firmware to host software

           
           extern unsigned char firmware[] =
           #include "firmware.c"
           
           
          This array should be transfered FX2 command.


    • How to use

      1. De-compress file

        Download and de-compress your target directly.

         
      2. Creating library

        Create library before firmware building.   

           
        • cd lib  
        • make (refer following instraction for firmware building)  

      3. Building firmware

        • Windows  

             copy Makefile.windows Makefile [Enter]
             make [Enter]
             

           
        • UNIX 系 OS  

               cp Makefile.unix Makefile [Enter]
               make [Enter]
               

      4. How to download firmware
        • Windows

          Downloading from CyConsole EZ-USB which is installed with Cypress SDK.

        • UNIX

          making tools...


    • Know How

      • No Renumration

        Device Descriptor alignment is not started from even boundary. We have to trim with "void resume_isr(void) interrupt WKUP_VECT" of fw.c

         fw.c
         void resume_isr(void) interrupt WKUP_VECT
         {
            EZUSB_CLEAR_RSMIRQ();
        
            // alignment end of fw.c
            _asm;
            .even
         //   nop; // comment out this if needed
            _endasm; 
         }
        
         
        with/without nop for trimming alignment.


    • Wanted

         
      • Dear Developers  

        • Trouble shooting

          Since, just started porting activity. We may encountered problems whichs are over our expectation. Please e-mail/write BBS, if you encountered them. I will reflect your feed back as well.

        • Future

          You can take over Keil traial compiler limitation (as 4KB). You cam make freely your system upto limit of firmware capacity.

         
      • Optimize (as developoer/seller of ChameloeonFX2)

        Should be possible to use mini-B connector of ChameleonFX2 also.

      • myst

        Advise for How to make "Makefile of Windows".


    • Thanks to

      We have to thank to Pionners

         
      • fenrir

        Base porting from Keil compiler to SDCC (as great work).

      • Optimize

        Provide FX2/ChameleonFX2 kit and sample firmware code

      • myst

        Advise for "How to make Makefile".

      • K.K.

        bin2c create and contribution


Top of Page
e-mail to Yuichi ODA


Copyright (C) 1998 - 2008 TeamKNOx