13 Replies Latest reply on Oct 9, 2018 6:28 PM by yyca

    can't load elf

    user_129004250

      Upon building the CX3 RDK project from e-consystems.  It appears to build OK, but there's an error when the IDE attempts to convert the generated ELF file to an IMG file:

       

      cs-make --no-print-directory post-build

      'Converting ELF to image (.img) format'

      'C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\\util\elf2img\elf2img.exe' -i CX3RDKOV5640.elf -o CX3RDKOV5640.img

      Failed to open file CX3RDKOV5640.elf

      cs-make[1]: [post-build] Error -1 (ignored)

      ' '

      'Invoking: ARM Sourcery Windows GNU Print Size'

      arm-none-eabi-size  --format=berkeley CX3RDK_OV5640.elf

         text       data        bss        dec        hex    filename

      159512       8068       6364     173944      2a778    CX3RDK_OV5640.elf

      'Finished building: CX3RDK_OV5640.siz'

       

      Notice the misformed path above: 'C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\\util\elf2img\elf2img.exe'

      with two "\\".  Why does this happen?  Is there an IDE setting to fix this?

       

      Thanks,

      Scott

        • 1. Re: can't load elf
          yyca

          Hi Scott,

           

          Could you please upload this project. We could check it.

          • 3. Re: can't load elf
            yyca

            Hi,

             

            In your project, the command line to convert elf to img is show below.

            '${FX3_INSTALL_PATH}\util\elf2img\elf2img.exe' -i ${ProjName}.elf -o ${ProjName}.img

             

            That is, the elf2img tool will try to open the ${ProjName}.elf . However, the variable ProjName in your project is aj-13-00283 but the real elf file name is CX3RDK_OV5640. That is the problem.

            • 4. Re: can't load elf
              yyca

              Second question:

              The first slash comes from the variable FX3_INSTALL_PATH since its value is C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\

              • 5. Re: can't load elf
                user_129004250

                Hi,

                I had renamed the project.  The img generation didn't work before I renamed it either.  Notice the command line path is incorrect:

                 

                'C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\\util\elf2img\elf2img.exe' -i CX3RDKOV5640.elf -o CX3RDKOV5640.img

                                                                                                        ^^ there are too many backslashes!~

                 

                Also, I'm discovering several other installation related issues:

                Attempts to change preferences (windows|preferences|general|appearence) causes this error dialog to appear.  Also, I cannot change the editor C/C++ text size (there's an error dialog that appears for an instant, too quickly to read).

                 

                Thinking some of these problems are related to windows 10 pro permissions I have taken ownership of the install directory.  That hasn't solved the problem.

                 

                Thanks,

                Scott

                • 6. Re: can't load elf
                  user_129004250

                  I modified FX3_INSTALL_PATH by removing the trailing '\' at the end of 'C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3'.  This fixed the problem is not loading the program (elf2img.exe), but the conversion still fails.  When I run the command line from a powershell prompt I get this message:

                   

                  PS D:\e-con_cx3_rdk\SDK_1.3.3\See3CAM_CX3RDK_ e-CAM59CX3\CX3RDKOV5640> 'C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\util\elf2img\elf2img.exe' -i

                  CX3RDKOV5640.elf -o CX3RDKOV5640.img

                  At line:1 char:78

                  + ... (x86)\Cypress\EZ-USB FX3 SDK\1.3\util\elf2img\elf2img.exe' -i CX3RDKO ...

                  +                                                                ~~

                  Unexpected token '-i' in expression or statement.

                  At line:1 char:81

                  + ... USB FX3 SDK\1.3\util\elf2img\elf2img.exe' -i CX3RDKOV5640.elf -o CX3R ...

                  +                                                  ~~~~~~~~~~~~~~~~

                  Unexpected token 'CX3RDKOV5640.elf' in expression or statement.

                      + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException

                      + FullyQualifiedErrorId : UnexpectedToken

                   

                  PS D:\e-con_cx3_rdk\SDK_1.3.3\See3CAM_CX3RDK_ e-CAM59CX3\CX3RDKOV5640>

                   

                  what are the correct arguments for elf2img?

                   

                  Thanks,

                  Scott

                  • 7. Re: can't load elf
                    yyca

                    No,No,No, renaming the project is incorrect. You need to modify the value of ProjName here

                    BaiduShurufa_2018-9-29_9-4-47.bmp

                    After that, you could get the img file.

                    BaiduShurufa_2018-9-29_9-7-7.bmp

                     

                    I have not met the issue you mentioned about the installation. I also test on my side without any problem.

                    I presume that is the problem of your PC. Could you please try with another PC/OS?

                    • 8. Re: can't load elf
                      yyca

                      I have not confirmed if this is a problem. But as you can see, the SDK could work with the current configuration.

                      I don't suggest you to modify it before I confirm this.

                      • 9. Re: can't load elf
                        user_129004250

                        Hi,

                        My project's properties, specifically the projname is set correctly:

                        So why is the SDK converting the wrong file?

                        • 10. Re: can't load elf
                          user_129004250

                          So after noticing there are two other pertinent settings and changing them, the IMG file still isn't generated even though the command line now looks correct:

                           

                          cs-make --no-print-directory post-build

                          'Converting ELF to image (.img) format'

                          'C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\\util\elf2img\elf2img.exe' -i aj-13-00283.elf -o aj-13-00283.img

                          Failed to open file aj-13-00283.elf

                          cs-make[1]: [post-build] Error -1 (ignored)

                          ' '

                          cs-make: *** No rule to make target `aj-13-00283.elf', needed by `aj-13-00283.siz'.  Stop.

                           

                          11:39:29 Build Finished (took 12s.226ms)

                          • 11. Re: can't load elf
                            user_129004250

                            and finally a fourth setting in C/C++ Build settings:

                            • 12. Re: can't load elf
                              user_129004250

                              And now I can't launch the debugger:

                              • 13. Re: can't load elf
                                yyca

                                I have point out the correct configuration in Post 7. Please do the same to get the img file.

                                The only thing you need to do is changing ProjName to CX3RDK_OV5640. No other modification is needed.