MPC 5744P Compile difference of different SD32 version

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC 5744P Compile difference of different SD32 version

ソリューションへジャンプ
1,608件の閲覧回数
TerryDuPower
Contributor III

Dear supporters:

      I created two project with some code. One was created by S32 Design Studio for Power Architecture Version 2017.R1, Another was created by S32 DS 2.1.   After complied, It's strange they are different.

 S32 DS 2017.R1:

TerryDuPower_1-1650247101857.png

 

S32 DS 2.1:

TerryDuPower_0-1650246970941.png

I checked the propertity is same . Could you give me some help?

0 件の賞賛
返信
1 解決策
1,483件の閲覧回数
TerryDuPower
Contributor III

Hi  stanish,

     Yes, It's caused by the compiler option  

-fstrict-volatile-bitfields

  

Thanks very much!

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
1,587件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Do you have the same linker file? Do you have same optimization configuration?

0 件の賞賛
返信
1,559件の閲覧回数
TerryDuPower
Contributor III

Yes,  two projects have same link file and same optimization configuration.

0 件の賞賛
返信
1,526件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Can you provide your project or reproducible code snippet? Thanks

0 件の賞賛
返信
1,519件の閲覧回数
TerryDuPower
Contributor III

This is the code:  

void Tim_Init(void)
{
//STM_0.CR.R = 0x00003103;
STM_0.CR.B.FRZ = 1; /*0:STM counter continues to run in debug mode*/
STM_0.CHANNEL[0].CMP.R = 1000; /*matches the STM_CNT register*/
STM_0.CR.B.CPS = 0x31; /*counter prescaler */
STM_0.CR.B.TEN = 1; /*Timer counter Enabled*/
STM_0.CHANNEL[0].CCR.B.CEN = 1; /* channel 0 enable */
STM_0.CHANNEL[0].CIR.B.CIF = 1; /* clear the flag */
}

Thanks!

0 件の賞賛
返信
1,496件の閲覧回数
stanish
NXP Employee
NXP Employee

Hello,

it seems the difference is caused by the compiler option:

-fstrict-volatile-bitfields

this causes the bitfield struct access (peripheral register) respects the declared datatype.

See se_stw vs. se_stb instruction

In a previous version of the compiler this option was enabled by default. Later compiler versions (starting with v1.2+) this option has to be enabled expicitly in compiler options.

 

stanish_0-1651137824153.png

 

hope it helps.

Stan

 

0 件の賞賛
返信
1,484件の閲覧回数
TerryDuPower
Contributor III

Hi  stanish,

     Yes, It's caused by the compiler option  

-fstrict-volatile-bitfields

  

Thanks very much!

0 件の賞賛
返信