We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I wish to access & modify the contents of the internal RAM of the ARM7. How do I do that. I know that in the assembly file, there is a define statement for the starting of the RAM. But how do I access the contents (in fact the whole memory) from C code?
Thanks in advance, avani
Avani,
The RAM sections are defined via Target Dialog inside uVision, please refer to your device user's manual to see what valid RAM addresses are.
To access RAM in C you may use a pointer. Anything in ARM will be pretty much done via pointers ( load-store characteristic ), in ASM you probably used LDR and STR instructions nothing fancy to be used on that purpose.
C language doesn't know where your memory start/stop. It's your job to manage the access considering address and memory boundary ( check Thumb and ARM mode ).
Hope it helps.
Alex
Hi Alex,
Yaa i thought that I would have to use the assembly level instructions in order to access it. So, I had started to access RAM via LDR, STR instructions. Was a bit skeptic whether it can be done using C level, which I am more used to.
Thanks a lot for your help, Avani
Yaa i thought that I would have to use the assembly level instructions in order to access it.
No, you don't have to. Use pointers, just as Alex said. For information on how pointers work in C, consult your favorite C textbook. Pointers are not specific to ARM, they work on all architectures.