PSoC3 Convert to Elf error: '3221225477'

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

cross mob
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Hi,

I'm getting an error from the phase of the build that converts the omf file to elf.

The command 'c8051-elf-omf2elf.exe' failed with exit code '3221225477'.

What error is it and how can I 'fix' my code to address it?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
7 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi Len, 

Could you please let me know if the <project>.omf file is generated in the build artifacts directory? I am assuming that this is a project-specific issue. We had observed in one case that this issue was resolved when the project was built on a different PC. Could you try the same and check if that works? The error also occurs when unreferenced variables are used in your code.

Thanks and Regards,
Rakshith M B
0 Likes

Rakshith,

Thank you for your interest in this topic.


Could you please let me know if the <project>.omf file is generated in the build artifacts directory? 


Yes.  It generated a <project_name>.omf file and generated the '3221225477' error.

New finding:

When it generates the error, I then change the Active Configuration.  When I do this, the error does not appear and the build completes.

If I change back to the previous Active Configuration, I still get the error.

You'll probably ask: Which Active Configuration (Debug or Release) causes the issue?  Either one.  It appears not to be specific to the build configuration.

If I get the error under "Debug", I switch to "Release" and it builds. (No change to code)

If I get the error under "Release", I switch to "Debug" and it builds. (No change to code)

Additional Test #1

If I get the error,

  • exit Creator (no change to the Active Configuration),
  • reenter Creator,
  • the error reappears on another build attempt.

Additional Test #2

If I get the error, 

  • exit Creator (no change to the Active Configuration),
  • restart the PC, 
  • reenter Creator,
  • the error reappears on another build attempt.

The only way I have found to build correctly is to change the Active Configuration.

From the test steps listed above, it appears that for whatever is causing this condition, it is persistent. I'm assuming that some info that generates the error is stored to a file or to the system registry.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi Len, 

Thank you very much for providing a detailed description of the steps that you followed. I have not come across this issue. When the build succeeds after changing the active configuration, how are you recreating the issue? Does clean and build bring back the same issue?

I do not think it is due to PSoC Creator registry key corruption as this would most often lead to a global issue and in this case the issue is specific to the project. Could you please share the complete archive of the project so that we can try and run some tests?

Also, could you please try deleting only the hex file after a successful build and let me know if the issue persists on successive builds? If the issue persists, is the omf and hex file recreated?

Thanks and Regards,
Rakshith M B
0 Likes
lock attach
Attachments are accessible only for community members.

Rakshith.


...When the build succeeds after changing the active configuration, how are you recreating the issue?

Very good question.  I don't know.   I usually change some code and do a rebuild.  When I get this error it doesn't appear that I have changed that much.  I cannot detect a pattern or specific change type that causes it.

As an experiment, I comment out one of my lines of code that I change.  Sometimes the error goes away.  Sometimes not.

In general, I cannot discern a "rhyme or reason" for the error.


Does clean and build bring back the same issue?

No.  That is one of my first experiments.  A clean or a forced delete of the Creator generated files does not address this issue.


Could you please share the complete archive of the project so that we can try and run some tests?

I've attached a project that provides the error in the "Debug" configuration.  However, the "Release" configuration builds successfully.


Also, could you please try deleting only the hex file after a successful build and let me know if the issue persists on successive builds? If the issue persists, is the omf and hex file recreated?


As indicated, the "Debug" conf doesn't complete the build:  No Debug\ hex file to delete.

On the successful "Release" conf, I delete the Release\ hex file and it still rebuilds successfully.  (This is also true of the .omf file)

 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi Len, 

Tried building the project that you shared. Surprisingly I could not recreate the issue in both Release or Debug mode. So this made me think about the two workarounds that I had suggested in my previous comments. The issue could be specific to your PC. In addition to this, I found that the build logs contained a warning - 'WARNING: CySysTick.c:214: 'clockSource': unreferenced local variable'. Could you please try adding a dummy line (clockSource = clockSource;) just to avoid this warning and let me know if this fixes the elf error?

Thanks and Regards,
Rakshith M B
0 Likes

Rakshith,

I performed the following new experiments:

  1. Added a line "clocksource = clocksource;"  in CySysTickSetClockSource() as you requested.  Still throws the error.
  2. "Clean and Build" 1).  Still throws the error.
  3. Commented out the entire function in 1) and commented out the only line that calls this API in CySysTickInit().  Still throws the error.
  4. "Clean and Build" 3).  Still throws the error.
  5. "Change configuration to "Release".  The error is NOT thrown.
Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Rakshith,

Here's a couple more experiments:

  1. I changed my TopDesign to remove my custom component "Term" and replace it with the standard UART component and my "String_Funcs" and "MenuCmds" components.
    Len_CONSULTRON_0-1641497862150.png

    The build does NOT throw the error!

  2. I change the TopDesign back to using my custom "Term" component,  The error is thrown!
Len
"Engineering is an Art. The Art of Compromise."
0 Likes