Flash Read Problem

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

Flash Read Problem

Jump to solution
1,712 Views
BrentW
Contributor II

K60N512

IAR Embedded Workbench 6.21

 

No problems at all writing flash but when reading back to verify I encounter several blocks that are not correct. If I reset the debugger I can see the blocks return to the values I expect in the memory window. My code is in the first bank and writing to the second bank.

 

I have read several posts about writing from one bank to another or running from RAM if writing to both banks. I have not encountered any posts yet that place the same restrictions on reading flash. Am I missing something?

It does not seem to matter whether I use flashx or not.

0 Kudos
Reply
1 Solution
1,340 Views
mjbcswitzerland
Specialist V

Hi

 

Have you checked to see whether your device is affected by the erratas e2644 and e2647?

Try disabling speculation and cache - there can be strange effects in devices > 256k Flash  when caching is enabled if they are early chips and both Flash banks are used.

 

Regards

 

Mark

 

View solution in original post

0 Kudos
Reply
2 Replies
1,341 Views
mjbcswitzerland
Specialist V

Hi

 

Have you checked to see whether your device is affected by the erratas e2644 and e2647?

Try disabling speculation and cache - there can be strange effects in devices > 256k Flash  when caching is enabled if they are early chips and both Flash banks are used.

 

Regards

 

Mark

 

0 Kudos
Reply
1,340 Views
BrentW
Contributor II

Mark,

 

Thanks for the reply. You nailed it!

 

I had borrowed some code from one of the examples that said it disabled the cache. After looking at the errata and the code more closely, it was obvious that it did not. Adding in the speculation disabling fixed me right up.

 

Thanks again,

 

Brent

0 Kudos
Reply