not able to read from flash

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19977
Level 2
Level 2
5 replies posted 5 questions asked First reply posted
Hi there,

I am using Aurix triCore TC275-D. I have some non-zero data located at 0x8001C000. And I have the following code to read and copy the value to a variable
debugCnt2 = modelParam.rev_num;

0x8003F016 91 20 00 F8 MOVH.A a15,0x8002
0x8003F01A 19 FF 00 0C LD.W d15,[a15]-0x4000
0x8003F01E 91 10 00 F7 MOVH.A a15,0x7001
0x8003F022 59 FF 28 CC ST.W [a15]-0x3CD8,d15

But for whatever reason. the value of the 'debuCnt2' is zero. I checked the register of d15 is 0, as well.

Thanks for help. Ke
0 Likes
3 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Just to be sure - can you dump a bit of memory at 0x8001C000?

Could it be that there's an interrupt handler that isn't saving and restoring D15 in between those instructions?
0 Likes
User19977
Level 2
Level 2
5 replies posted 5 questions asked First reply posted
I can read the memory with debugger. I can read the constant variable located at 0x8001C000, as well. I cannot copy the value to the ram mirror. The disassembly code seems to be right. is it because some safety measurement, overlay setting, ...?
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Is this executing on CPU0? If it's executing on a different CPU, could it be that the data cache is active, and the debugger's view of memory is stale?
0 Likes