kanni1303
Full Member level 3
- Joined
- Jun 29, 2012
- Messages
- 164
- Helped
- 12
- Reputation
- 24
- Reaction score
- 11
- Trophy points
- 1,298
- Location
- Chennai, Tamil Nadu, India
- Activity points
- 2,708
Hi,
I came across a problem today here is my code
the problem is using physical address I could write the data and during debugging the value was able to read( I kept break point on "Flashval = (DWORD) *Flashptr;" and on watches the data i wrote already was available, but after that line my controller resets)
I clearly know this is because of virtual and physical address issue, my question is during debugging how watch could read the value and why write was success but read was failed?
I came across a problem today here is my code
Code:
#define NVMEM_ADDRS_PHY 0x1D07000 //Physical address
#define NVMEM_ADDRS_VIR 0xBD07000 //Virtual address
DWORD Flashval;
DWORD *Flashptr;
//Working to read the value
Flashptr= (DWORD *) NVMEM_ADDRS_VIR;
Flashval = (DWORD) *Flashptr;
//Not working but in watch it is working
Flashptr= (DWORD *) NVMEM_ADDRS_PHY;
Flashval = (DWORD) *Flashptr;
Nop();
the problem is using physical address I could write the data and during debugging the value was able to read( I kept break point on "Flashval = (DWORD) *Flashptr;" and on watches the data i wrote already was available, but after that line my controller resets)
I clearly know this is because of virtual and physical address issue, my question is during debugging how watch could read the value and why write was success but read was failed?