can't load elf

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ScGr_289066
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

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

0 Likes
1 Solution

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.

View solution in original post

0 Likes
13 Replies
YangyangC_06
Employee
Employee
750 replies posted 500 replies posted 250 replies posted

Hi Scott,

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

0 Likes

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.

0 Likes
YangyangC_06
Employee
Employee
750 replies posted 500 replies posted 250 replies posted

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\​

0 Likes

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

pastedImage_0.png

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

0 Likes

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

0 Likes

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.

0 Likes

Hi,

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

pastedImage_0.png

So why is the SDK converting the wrong file?

0 Likes

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:

pastedImage_0.png

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)

0 Likes

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

pastedImage_0.png

0 Likes

And now I can't launch the debugger:

pastedImage_0.png

0 Likes

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.

0 Likes

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?

0 Likes