1 2 Previous Next 17 Replies Latest reply on Nov 17, 2013 9:18 PM by brian.shih

    FX2 firmware bigger than 16K bytes

    decai.wang

       Hi,Sir!

         

      My code is bigger than 16K bytes, I select 64K bytes I2C Eprom and also attach one 64K bytes parallel SRAM as external Code(EA = 0) . the following description is from TRM:

         

       

         

      The Main RAM is accessible both as program and data memory, just as in the 56- and 100-pin

         

      FX2.

         

      To avoid conflict with the Main RAM, the pins which control access to off-chip memory (the RD,

         

      WR, CS, OE, and PSEN pins) are inactive whenever the FX2 accesses addresses 0x0000-

         

      0x1FFF. This allows a 64K memory chip (data and/or program) to be added without requiring additional

         

      external logic to inhibit access to the lower 8K of that chip. Note that the PSEN and RD signals

         

      are available on separate pins, so the program and data spaces outside the FX2 are not

         

      combined as they are inside the FX2.

         

      When code in the range 0x0000-0x1FFF is fetched from the on-chip RAM, the PSEN pin is not

         

      asserted; when code is fetched from program memory in the range 0x2000-0xFFFF, the PSEN pin

         

      is asserted.

         

      It seems that although we can program 64K I2C E2prom by Console app, it said only 16K bytes can be loaded into internal low 16K byte by hardware bootloader , I like C0 or C2 mode, because it is very easy to debug or deliver code.

         

      Does the C0 or C2 mode support more than 16K bytes code? 

        • 1. Re: FX2 firmware bigger than 16K bytes
          decai.wang

           Maybe user code in internal 16K RAM can finish this task, user code read remaining code data from I2C E2prom and write it to external SRAM (0x4000~0xffff), is it right?

          • 2. Re: FX2 firmware bigger than 16K bytes
            decai.wang

             as for C2 load, the user code can move the remaining code to exteral SRAM(0x4000~0xffff), but how does the C0 load?

            • 3. Re: FX2 firmware bigger than 16K bytes
              decai.wang

               In fact, I have to add a lot of task in FX2, that means FX2 not only transmit Data between PC by USB2.0, but also FX2 has to do a lot of tasks, such like Key scan,Step Motor control,and so on. so the code size is bigger than 16K bytes, any body can give some advice for  me?

              • 4. Re: FX2 firmware bigger than 16K bytes
                rama.sai.krishna.vakkantula

                Hi Davidwang,

                   

                There is a pin on FX2LP named as "EA" this one decides how you are addressing the internal and external memory.

                   

                I will explain you the simple case. Connect this EA to supply voltage to make it High. Then all the program memory that FX2LP addresses will be the one which is connected externally to it. I suppose that you are building your project by mentioning the proper ranges for code segment and xdata segment to generate a final hex file. Programm the EEPROM with the final .iic file and when you hit the reset FX2LP will load the entire code into the external RAM and run the programm from there.

                   

                Thanks,

                   

                sai krishna.

                • 5. Re: FX2 firmware bigger than 16K bytes
                  rama.sai.krishna.vakkantula

                  Please let me know if this method is not working for you.

                     

                  Thanks,

                     

                  sai krishna.

                  • 6. Re: FX2 firmware bigger than 16K bytes
                    decai.wang

                    C2 load mode and EA = 0, so lower 16K bytes internal XRAM is used as Xdata and Code,Boot loader load code data from I2C E2prom and copy it into internal lower 16K byte area and run

                       

                    But, If my code size is more than 16K bytes, How can I do?it said Console App can progam 64K I2C E2prom, but C2_load only copy first 16K Bytes into internal lower address space. I also know last byte in E2Prom is a reset code, hwo to deal with this reset byte if my code size is bigger tan 16K byte?

                       

                    In fact, I want to connect one 64 K bytes SRAM( not flash memory chip), CS pin(sram chip) is connected with CS pin of FX2LP, RD Pin(sram chip) is connected with OE pin of FX2LP, EA = 0; 

                       

                    So, from 4000H~DFFFH(SRAM CHIP) is as code or xdata space, E000 ~FFFF(SRAM CHIP) only as code area(PSEN is valid).

                       

                    0000~3FFF(Sram chip) is invalid. internal 16K at bottom is valid.

                       

                    I think the attached SRAM Chip can be operated as the same with internal 16K, defalut boot loader(C2 mode)can load (16K + 40K)bytes from I2C eeprom and download it from 0000~3FFF(16K bytes  internal) and 4000~DFFFh(40K), the upper (E000 and FFFF) can not be filled by loader(I guess loader maybe use Movx inst and will write code into interal Xdata aera other than SRAM CHIP).

                       

                    Unfortunately, C2 loader only copy 16K bytes in eeprom.

                       

                    Can you give me some advice how to deal with bigger code while working at C2 load mode?

                    • 7. Re: FX2 firmware bigger than 16K bytes
                      decai.wang

                       anybody can give some advice?

                      • 8. Re: FX2 firmware bigger than 16K bytes
                        gayathri.vasudevan

                         Hi David,

                           

                         

                           

                        This might be of use to you http://www.cypress.com/?id=4&rID=33394.

                           

                         

                           

                        Regards,

                           

                        Gayathri

                        • 9. Re: FX2 firmware bigger than 16K bytes
                          decai.wang

                          Sorry, I can't understand how the I2C boot loader read data from E2prom(bigger 16K bytes) and fill it into 0x0000~0x3fff(internal Xram) and 0x4000~0xDfff(attached Xram).

                          • 10. Re: FX2 firmware bigger than 16K bytes
                            gayathri.vasudevan

                             Hi,

                               

                             

                               

                            What is the command line that you used to create the iic file of you rcode (<16kB)? Please try the following command line and check if you are able to boot load this firmware iic image from your EEPROM.

                               

                             

                               

                            hex2bix -i -e -m <total firmware size in hex> -f 0xC2 -o <O/p file name.iic> <I/P file name.hex> 

                               

                            This assumes your code/xdata space occupies 0x0-0x1dff and 0x2000-0x<total firmware size specified after -m option>.

                               

                            The -m flag indicates the highest RAM address used for .iic files.

                               

                            -e appends a bootloader code to your final image.

                               

                            The bootloader code downloads code into the external RAM after the 16K onchip memeory has already been populated wth code.The bootloader code appended by the hex2bix utility resides at 0x1e00 and is 512 bytes long. You have to take care that your code doesnot occupy this region. 

                               

                             

                               

                            Regards,

                               

                            Gayathri

                            • 11. Re: FX2 firmware bigger than 16K bytes
                              gayathri.vasudevan

                               Hi,

                                 

                               

                                 

                              Sorry a typo in the above post.

                                 

                               

                                 

                              What is the command line that you used to create the iic file of you rcode (> 16kB)?

                                 

                               

                                 

                              Regards,

                                 

                              Gayathri

                              • 12. Re: FX2 firmware bigger than 16K bytes
                                decai.wang

                                 if I use -e, a boot loader will merged into my final code, which is at 0x1e00 to 0x1fff(512 bytes),of course,my code is linked by linker by default setting, so bootloader can be valid.

                                   

                                Can you give me a link of HOWTO of hex2bin utility?  the following readme is coming from :

                                   

                                C:\Cypress\USB\CY3684_EZ-USB_FX2LP_DVK\1.0\Utilities\Hex2Bix, no -e arg, it seems lower version?

                                   

                                 

                                   

                                 

                                   

                                 

                                   

                                 

                                   

                                This directory contains the Hex To Bix converter program

                                   

                                for the Anchor Chips EZ-USB chip.

                                   

                                 

                                   

                                This file converts the hex output file to a bix file that can be

                                   

                                downloaded directly into target memory. It also converts the hex

                                   

                                output to a file that can be directly loaded into an EEPROM.

                                   

                                It basically creates a memory image (including zeros) of the memory

                                   

                                space defined by the hex file.

                                   

                                 

                                   

                                Program Options:

                                   

                                HEX2BIX [-AIBRH?] [-S symbol] [-M memsize] [-O filename] Source

                                   

                                    Source - Input filename

                                   

                                    A      - Output file in the A51 file format

                                   

                                    B      - Output file in the BIX file format (Default)

                                   

                                    H|?    - Display this help screen

                                   

                                    I      - Output file in the IIC file format

                                   

                                    M      - Maximum memory limit (Default = 8k)

                                   

                                    O      - Output filename

                                   

                                    R      - Append bootload block to release reset

                                   

                                    S      - Public symbol name for linking

                                • 13. Re: FX2 firmware bigger than 16K bytes
                                  decai.wang

                                   it seem no any detail documents for demostrating how Hex2bix is working and how the EEloader mergered is working while C2-load mode?

                                  • 14. Re: FX2 firmware bigger than 16K bytes
                                    decai.wang

                                     I install the newest Cypress Suite USB 3.4.7 and also install CY3684_EZ-USB_FX2LP_DVK(V1.0)in my desktop. they all provide hex2bix utility,but CY3684_EZ-USB_FX2LP_DVK provide VC++ source code. it seems Cypress Suite USB 3.4.7 version is more powerful than CY3684_EZ-USB_FX2LP_DVK version, it add -X arg, is it right?

                                       

                                     

                                       

                                     

                                       

                                    C:\Cypress\Cypress Suite USB 3.4.7\Firmware\bin>hex2bix -?

                                       

                                    Intel Hex file to EZ-USB Binary file conversion utility

                                       

                                    Copyright (c) 1997-2005, Cypress Semiconductor Inc.

                                       


                                       

                                    HEX2BIX [-AEIBRH?] [-IC] [-S symbol] [-M memsize] [-C Config0Byte] [-F firstByte

                                       

                                    ] [-O filename] [-X filename address] Source

                                       


                                       

                                       Source - Input filename

                                       

                                       A      - Output file in the A51 file format

                                       

                                       B      - Output file in the BIX (raw binary) format (Default)

                                       

                                       BI     - Input file in the BIX (raw binary) format (hex is default)

                                       

                                       C      - Config0 BYTE for AN2200 and FX2 (Default = 0x04)

                                       

                                       E      - Create .IIC file for External RAM. Prepends 0x200 byte loader that

                                       

                                                loads at 0x1e00

                                       

                                       F      - First byte (0xB0, 0xB2, 0xB6, 0xC0, 0xC2) (Default = 0xB2)

                                       

                                       H|?    - Display this help screen

                                       

                                       I      - Output file in the IIC file format (sets -R)

                                       

                                       IC     - Output Compressed IIC file (sets -R)

                                       

                                       Ig     - Output Contiguous IIC file (without gaps) (sets -R)

                                       

                                       M      - Memory size, used as BIX and IIC out file size. (Default=8k)

                                       

                                       O      - Output filename

                                       

                                       P      - Product ID (Default = 2131)

                                       

                                       R      - Append bootload block to release reset

                                       

                                       S      - Public symbol name for linking

                                       

                                       V      - Vendor ID (Default = 0x0547)

                                       

                                       X      - Append Xtra data at fixed address in EEPROM.  Input file is raw bina

                                       

                                    ry, address in hex.

                                       


                                       


                                       

                                    C:\Cypress\USB\CY3684_EZ-USB_FX2LP_DVK\1.0\Utilities\Hex2Bix\Release>hex2bix -?

                                       

                                    Intel Hex file to EZ-USB Binary file conversion utility

                                       

                                    Copyright (c) 2012-2013, Cypress Semiconductor Inc.

                                       


                                       

                                    HEX2BIX [-AEIBRH?] [-IC] [-S symbol] [-M memsize] [-C Config0Byte] [-F firstByte

                                       

                                    ] [-O filename] [-X] Source

                                       


                                       

                                       Source - Input filename

                                       

                                       A      - Output file in the A51 file format

                                       

                                       B      - Output file in the BIX (raw binary) format (Default)

                                       

                                       BI     - Input file in the BIX (raw binary) format (hex is default)

                                       

                                       C      - Config0 BYTE for AN2200 and FX2 (Default = 0x04)

                                       

                                       E      - Create .IIC file for External RAM. Prepends 0x200 byte loader that

                                       

                                                loads at 0x1e00

                                       

                                       F      - First byte (0xB0, 0xB2, 0xB6, 0xC0, 0xC2) (Default = 0xB2)

                                       

                                       H|?    - Display this help screen

                                       

                                       I      - Output file in the IIC file format (sets -R)

                                       

                                       IC     - Output Compressed IIC file (sets -R)

                                       

                                       M      - Max Memory(RAM) limit for firmware. (Default=8k)

                                       

                                       O      - Output filename

                                       

                                       P      - Product ID (Default = 2131)

                                       

                                       R      - Append bootload block to release reset

                                       

                                       S      - Public symbol name for linking

                                       

                                       V      - Vendor ID (Default = 0x0547)

                                       


                                       

                                    C:\Cypress\USB\CY3684_EZ-USB_FX2LP_DVK\1.0\Utilities\Hex2Bix\Release>

                                    1 2 Previous Next