NXP S32K14x SDK startup code for C++

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

NXP S32K14x SDK startup code for C++

2,447 Views
leo_cheng
Contributor I

Hello, 

Does anyone know if S32k14x SDK startup code supports C++ with IAR ARM compiler? I ran into a compile error, 

Fatal error[Lp049]: there was no reference to __iar_data_init3, but it is needed to call extra init routines

There is a global C++ object in the source code,  

CdevSigma SigmaDsp0(&dspdataConfigDsp0a, &dspdataConfigDsp0a, &dspHwConfigDsp0);

if remove it, the error is gone.

And the startup code and link file for IAR are used,

    S32SDK_S32K14x_RTM_2.0.0\platform\devices\S32K146\linker\iar\S32K146_128_flash.icf

    S32SDK_S32K14x_RTM_2.0.0\platform\devices\S32K146\startup\iar\startup_S32K146.s

    S32SDK_S32K14x_RTM_2.0.0\platform\devices\startup.c

Thanks,

Leo

0 Kudos
3 Replies

1,991 Views
leo_cheng
Contributor I

Got this answer from IAR

1. Add "--skip_dynamic_initialization" option during link process
2. Add c++ dynamic initialization in early part of Main():

#include "iar_dynamic_init.h"

void main()
{
...
__iar_dynamic_initialization();
...
}

0 Kudos

231 Views
iniya_anto
Contributor I

How does it resolve?

I want to understand how c++ object initialisation happens after this?

0 Kudos

1,991 Views
raresvasile
NXP Employee
NXP Employee

Hi,

Unfortunately, S32 SDK for S32K14x does not support C++.

Best regards,

Rares

0 Kudos