S32k146. Can't read vaule from Can register.

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

S32k146. Can't read vaule from Can register.

1,016件の閲覧回数
郑文豪
Contributor I

Can0.IFLAG1(Address 0x4002 4030) is 0x0000 0002 in EmbSys Registers view.1.png

Then u32flagReg reads from 0x4002 4030,the value is 0.Why are they different?Whether it is related to the optimization level?

0 件の賞賛
返信
3 返答(返信)

998件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

I don't know what the macro does, can you replace is with something like this:

u32flagReg = *((uint32_t*)0x40024030);

You can try using lower optimization level, I guess.

 

Regards,

Daniel

 

0 件の賞賛
返信

994件の閲覧回数
郑文豪
Contributor I

Same result by using u32flagReg = *((uint32_t*)0x40024030).

2.png

The optimize is O1 now.If I choose O0,the program restarts.Is there any other way?

1.png

0 件の賞賛
返信

955件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

It does not seems to be an issue with the optimization, please use the default one.

The screenshots that you sent shows the variable before the register is read by the core.

Can you step the whole function without a breakpoint there? Do you see a difference when you step the code and run the code?

I see the project is complex, can you reproduce the behavior with a simple test project?

If so, please send to the project so that we can test it on our side.

 

Thank you,

Daniel

 

 

0 件の賞賛
返信