s32k144 Read Flash Weird Problem

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

s32k144 Read Flash Weird Problem

Jump to solution
873 Views
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 Kudos
1 Solution
859 Views
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

View solution in original post

1 Reply
860 Views
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