EZ-USB FX3 SDK Settings for FX3 Devices with 256 KB System RAM - KBA218345

Version: **

 

Question:

What are the changes required in the EZ-USB FX3 SDK to build the image file for FX3 devices with 256 KB system RAM?

 

Answer:

The default settings in the EZ-USB FX3 SDK is for FX3/FX3S device with 512 KB of SRAM. The CYUSB3011, CYUSB3012, CYUSB3032, CYUSB3031, CYUSB2032, CYUSB2031, CYUSB3021, CYUSB3061, CYUSB3063, and CYUSB2011 have 256 KB of SRAM; therefore, the image file built with these settings is not valid for a device with 256 KB of SRAM. This is because the memory mapping in the FX3 device with 256 KB of SRAM is different from that of 512 KB of SRAM.

 

The default memory mapping of 256 KB and 512 KB of SRAM are in the linker scripts files, fx3_256k.ld and fx3_512k.ld, provided with the FX3 SDK located at C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\fw_build\fx3_fw (default SDK installation path).

 

Note: fx3_fw.ld and fx3_512k.ld are the same files with a different name for 512 KB SRAM.

 

The memory mapping for the driver heap, buffer area, and two-stage boot area can be modified for 256 KB SRAM in the cyfxtx.c file of the project as explained here. This file, cyfxtx.c, is common for both the 512 KB and 256 KB FX3 devices.

 

Make the following changes in the EZ-USB FX3 SDK to build the image file for FX3/FX3S with 256 KB of SRAM:

 

  1. Define the macro CYMEM_256k in the cyfxtx.c file of the firmware project.
  2. If you want to modify the driver heap, buffer area, and two-stage boot area, follow the comments in the cyfxtx.c and make the required changes.
  3. Modify the linker script file in the properties as follows:

    1. Right-click on the project and select Properties. The Properties window will open, as shown in Figure 1.
    2. Click on the text that is highlighted in blue in Figure 1; the window shown in Figure 2 will pop up.

      Figure 1. Properties Window of the SDK

      1.png

      Figure 2. Default Linker Script for 512 KB SRAM

      2.png
    3. Change "${FX3_INSTALL_PATH}/fw_build/fx3_fw/fx3.ld" to "${FX3_INSTALL_PATH}/fw_build/fx3_fw/fx3_256k.ld" as shown in Figure 3.
    4.   Click OK, then build the image file.

      Figure 3. Linker Script for 256 KB SRAM

3.png

 

 

The newly built image file will reflect the settings for FX3/FX3S devices with 256 KB SRAM.