Who defines the operations __eabi and __init?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Who defines the operations __eabi and __init?

Jump to solution
1,438 Views
michaelbinz
Contributor III

We generated a C project on the mpc5748g that results in a failure when starting the main() operation.  The problem seems to be a bad hardware initialisation.  In the process of analysing the issue we found that the following function entry was generated for our main():

40002bce: se_illegal
main:
40002bd0: e_stwu r1,-32(r1)
40002bd4: se_mflr r0
40002bd6: se_stw r0,36(r1)
40002bd8: se_stw r31,28(r1)
40002bda: se_mr r31,r1
40002bdc: e_bl 0x40003908 <__eabi>
40002be0: se_li r7,0
40002be2: se_stw r7,8(r31)
40002be4: e_lis r7,16384
40002be8: se_li r6,0
40002bea: e_stb r6,23324(r7)
40002bee: e_lis r7,16384

The question is where the __eabi (in bold above) is defined?  We debugged __eabi and found that in turn the operation __init is called and here we have the same question:

Who does where define these operations? Are there different versions available? Is the source code of the operations available?

0 Kudos
1 Solution
1,274 Views
martin_kovar
NXP Employee
NXP Employee

Hello Michael,

Could you please try the tutorial below:

HOWTO: Migrate project created in S32DS Power v1.x into v1.2+ 

Honestly, I am not compiler expert, so I do not know, if changing runtime library can help, but the tutorial was created by my colleague who is experienced in this area much more than me, so I hope this will help.

Regards,

Martin

View solution in original post

0 Kudos
4 Replies
1,274 Views
martin_kovar
NXP Employee
NXP Employee

Hello Michael,

symbol __eabi is defined in std library, which is in our case EWL or NewLib library.

But from my point of view source of your problem is following.

In early version of S32DS, compiler was not eabi compliant. In the newest S32DS version, compiler was changed and now compiler is eabi compliant. Because of this, also linker file was changed, and when you import project created in the older versions of S32DS into the newest one, project is compiled correct, but there are missing linker sections for eabi code, which results in the incorrect project behavior as soon as the code is downloaded into the microcontroller.

So, I recommend you to use S32DS 2017.R1 with the newest update 10, and in case you wanted to use projects from older version, best way is migrated the projects manually into the newest version of S32DS.

Here is link for S32DS update.

https://community.nxp.com/docs/DOC-343018 

Please let me know, if my thought written above is incorrect and eventually please write me back some other details which could help ma to resolve your issue.

Regards,

Martin

0 Kudos
1,274 Views
michaelbinz
Contributor III

Hello Martin,

the problem is complicated to describe and I found an ugly workaround ...

So let's start:  I am on the newest version of S32DS. So far so good.

Regarding your info on the abi change:  Yes your guess is right.  The source I'm talking of is the original demo firmware of the devkit mpc5748g board.  I understand what you say and that would explain the problem, the control flow inside __eabi and __init seems to be broken.

How can I change the runtime library of an existing project?  Actually this seems to be all I need.

And where can I find information on the runtime libraries?  I saw that I can select one of EWL or NewLib when creating a new project, but where can I find information on the actual functionality or features of these?

Regards,

Michael.

0 Kudos
1,275 Views
martin_kovar
NXP Employee
NXP Employee

Hello Michael,

Could you please try the tutorial below:

HOWTO: Migrate project created in S32DS Power v1.x into v1.2+ 

Honestly, I am not compiler expert, so I do not know, if changing runtime library can help, but the tutorial was created by my colleague who is experienced in this area much more than me, so I hope this will help.

Regards,

Martin

0 Kudos
1,274 Views
michaelbinz
Contributor III

Hello Martin,

cool, the link is very helpful.

Thanks a lot,

Michael.

0 Kudos