Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > FX2 firmware bigger than 16K bytes

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



FX2 firmware bigger than 16K bytes
Moderator:
RSKV

Post Reply
Follow this topic



FX2 firmware bigger than 16K bytes

davidwang posted on 29 Aug 2012 11:26 PM PST
Top Contributor
24 Forum Posts

 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? 

 




Re: FX2 firmware bigger than 16K bytes

davidwang posted on 29 Aug 2012 12:20 AM PST
Top Contributor
24 Forum Posts

 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?



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 29 Aug 2012 12:23 AM PST
Top Contributor
24 Forum Posts

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



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 29 Aug 2012 05:35 AM PST
Top Contributor
24 Forum Posts

 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?



Re: FX2 firmware bigger than 16K bytes

RSKV posted on 31 Aug 2012 09:12 PM PST
Cypress Employee
851 Forum Posts

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.

 



Re: FX2 firmware bigger than 16K bytes

RSKV posted on 31 Aug 2012 09:14 PM PST
Cypress Employee
851 Forum Posts

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

Thanks,

sai krishna.



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 06 Sep 2012 02:39 AM PST
Top Contributor
24 Forum Posts

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?



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 09 Sep 2012 07:44 PM PST
Top Contributor
24 Forum Posts

 anybody can give some advice?



Re: FX2 firmware bigger than 16K bytes

Gayathri posted on 10 Sep 2012 01:58 AM PST
Cypress Employee
428 Forum Posts

 Hi David,

 

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

 

Regards,

Gayathri



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 11 Sep 2012 03:47 AM PST
Top Contributor
24 Forum Posts

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).



Re: FX2 firmware bigger than 16K bytes

Gayathri posted on 11 Sep 2012 06:40 AM PST
Cypress Employee
428 Forum Posts

 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



Re: FX2 firmware bigger than 16K bytes

Gayathri posted on 11 Sep 2012 06:41 AM PST
Cypress Employee
428 Forum Posts

 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



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 11 Sep 2012 07:24 PM PST
Top Contributor
24 Forum Posts

 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

 



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 11 Sep 2012 07:56 PM PST
Top Contributor
24 Forum Posts

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



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 12 Sep 2012 10:21 PM PST
Top Contributor
24 Forum Posts

 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>



Re: FX2 firmware bigger than 16K bytes

Gayathri posted on 12 Sep 2012 10:45 PM PST
Cypress Employee
428 Forum Posts

 Hi,

 

Please download and install FX2LP DVK from http://www.cypress.com/?rID=14321. You can find the hex2bix utility at the location C:\Cypress\USB\bin.  A detailed description of how to go about using the Hex2Bix utility is available in the readme.txt file in C:\Cypress\USB\Util\Hex2Bix. The source code of this utility is also present in the same folder.

 

Regards,

Gayathri



Re: FX2 firmware bigger than 16K bytes

davidwang posted on 12 Sep 2012 01:02 AM PST
Top Contributor
24 Forum Posts

yeah, I download ***.ISO (more than 500M) and install it, this version hex2bix provide VC++ source code, hex2bin -? 

 

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)

This version Copyright is Copyright (c) 2012-2013, Cypress Semiconductor Inc. BUT this verison doesn't provide -X arg compared with USB suit3.4.7, it seems -X arg is an advanced feature, why not be added in this verison?

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20