s32k144 Read Flash Weird Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

s32k144 Read Flash Weird Problem

跳至解决方案
961 次查看
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 解答
947 次查看
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 回复
948 次查看
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