s32k144 Read Flash Weird Problem

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

s32k144 Read Flash Weird Problem

ソリューションへジャンプ
993件の閲覧回数
kmh48301
Contributor IV

Hello.

I'm having a hard time to understand this problem.

 

#define READ(X) (*(uint8_t *)(X)) //X is 32bit flash memory address

I use that Macro Function to read flash memory. 

 

ErrSou.PNG

 I ran this code with debugger. (there is break point at the end of 'for' loop)

please see the variable values below.

phr.PNG (this is parameter)

flash.PNG (this is flash memory)

 

ff.PNG(this is the problem)

as you can see, ReadResult is wrong.

why is this happened?

==============================================================================

NorSou.PNG i just added one more READ before loop.

 

flash.PNG Absolutely, same as before.

Right.PNGthis is the result i expected.

 

 

Opti.PNG i turned off compile optimization.

Could you please explain????

 

Thanks

Best Regards

Phillip

 

0 件の賞賛
返信
1 解決策
979件の閲覧回数
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

I have made a simple test and unfortunately, I cannot reproduce your case. See the attached test code.

dianabatrlova_1-1604933165947.png

Can you try it?

Best regards,

Diana

元の投稿で解決策を見る

1 返信
980件の閲覧回数
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

I have made a simple test and unfortunately, I cannot reproduce your case. See the attached test code.

dianabatrlova_1-1604933165947.png

Can you try it?

Best regards,

Diana