4 Replies Latest reply on Dec 16, 2019 7:29 PM by JayakrishnaT_76

    How to build Fx3 project by cmd terminal

    xixu_4093676

      Are there one cmd line way to build the Fx3 project instead the way build manual click the "Build Project" menu in the Cypress EZ USB Suite?

      We  need to build the project on the Git server automatic, when engineer push updated code to the release branch .

        • 1. Re: How to build Fx3 project by cmd terminal
          JayakrishnaT_76

          Hello,

           

          Regarding building of the firmware using command prompt:

          - Create a folder (For example: folder named 'firmware')

          - Please refer to the figure below:

          As shown in the figure, copy the folders 'fw_lib', 'fw_build' and 'util' to the place where the folder 'firmware' is present.

          - Now copy the firmware folder from the following path into the folder 'firmware'

          C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbi2cregmode

          - After copying the folder cyfxusbi2cregmode from the above path to the firmware folder, open the cyfxusbi2cregmode.

          - Edit the makefile so that FX3FWROOT=../../.. is changed to FX3FWROOT=../.. 

          - Now open command prompt in the path firmware/cyfxusbi2cregmode where the make file is present.

          - Now do : make all

          You can see cyfxusbi2cregmode.elf being generated.

          - Now copy the 'elf2img.exe' from C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\util\elf2img to firmware/cyfxusbi2cregmode where the .elf file is present

          - Now in the command prompt run the following:

          elf2img.exe -i cyfxusbi2cregmode.elf -o cyfxusbi2cregmode.img

           

          Best Regards,

          Jayakrishna

          • 2. Re: How to build Fx3 project by cmd terminal
            xixu_4093676

            Hello,

             

               Thank you for your help, I following your steps, When do : make all,

               It seem like it show like "can not locate make cmd" then I try to do cs-make

               I get following message:

               C:\work\fx3_cmd_build\firmware\cyfxusbi2cregmode>cs-make all
            arm-none-eabi-gcc -g -DTX_ENABLE_EVENT_TRACE -DDEBUG -DCYU3P_FX3=1 -D__CYU3P_TX__=1 -I. -I../../fw_lib/1_3_3/inc  -O0 -Wall -mcpu=arm926ej-s -mthumb-interwork -ffunction-sections -fdata-sections -c -o cyfxusbi2cregmode.o cyfxusbi2cregmode.c
            arm-none-eabi-gcc -g -DTX_ENABLE_EVENT_TRACE -DDEBUG -DCYU3P_FX3=1 -D__CYU3P_TX__=1 -I. -I../../fw_lib/1_3_3/inc  -O0 -Wall -mcpu=arm926ej-s -mthumb-interwork -ffunction-sections -fdata-sections -c -o cyfxusbenumdscr.o cyfxusbenumdscr.c
            arm-none-eabi-gcc -g -DTX_ENABLE_EVENT_TRACE -DDEBUG -DCYU3P_FX3=1 -D__CYU3P_TX__=1 -I. -I../../fw_lib/1_3_3/inc  -O0 -Wall -mcpu=arm926ej-s -mthumb-interwork -ffunction-sections -fdata-sections -c -o cyfxtx.o cyfxtx.c
            arm-none-eabi-gcc  -Wall -c -mcpu=arm926ej-s -mthumb-interwork -o cyfx_gcc_startup.o cyfx_gcc_startup.S
            arm-none-eabi-ld cyfx_gcc_startup.o cyfxusbi2cregmode.o cyfxusbenumdscr.o cyfxtx.o --entry CyU3PFirmwareEntry -L ../../fw_lib/1_3_3/fx3_debug -lcyu3sport -lcyu3lpp -lcyfxapi -lcyu3threadx "$ARMGCC_INSTALL_PATH"/arm-none-eabi/lib/libc.a "$ARMGCC_INSTALL_PATH"/lib/gcc/arm-none-eabi/4.8.1/libgcc.a  -T ../../fw_build/fx3_fw/fx3_512k.ld -d --gc-sections --no-wchar-size-warning -Map cyfxusbi2cregmode.map -o cyfxusbi2cregmode.elf
            arm-none-eabi-ld: cannot find $ARMGCC_INSTALL_PATH/arm-none-eabi/lib/libc.a: No such file or directory
            arm-none-eabi-ld: cannot find $ARMGCC_INSTALL_PATH/lib/gcc/arm-none-eabi/4.8.1/libgcc.a: No such file or directory
            cs-make: *** [cyfxusbi2cregmode.elf] Error 1

             

            Also, If I run "cs-make clean"

            C:\work\fx3_cmd_build\firmware\cyfxusbi2cregmode>cs-make clean
            rm -f ./cyfxusbi2cregmode.elf
            process_begin: CreateProcess(NULL, rm -f ./cyfxusbi2cregmode.elf, ...) failed.
            make (e=2):
            cs-make: *** [clean] Error 2

             

            Would you please give me any advices on the issues?

            Also, Can you let me know how to install make? I must use make to build?

            Thanks,

            • 3. Re: How to build Fx3 project by cmd terminal
              xixu_4093676

              Update

              After install make by mingw basic setup, The issues is fixed.

              • 4. Re: How to build Fx3 project by cmd terminal
                JayakrishnaT_76

                Hello,

                 

                Thanks for the update. Hope you can build the firmware now using cmd terminal.

                 

                Best Regards,

                Jayakrishna