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.
Hello!
I'm using a Zybo board with a dual-core ARM Cortex-A9 processor and I'm trying to read (and then write) the registers of the processor. How can I read these values into variables in C code?
Thank you!
Do you mean the system registers (e.g. SCTLR)?
If so, it'll partly depend on which compiler you are using. Arm Compiler 5 lets you define a pseudo variable to represent a register.http://infocenter.arm.com/help/topic/com.arm.doc.dui0472m/chr1359125006491.html
I've not used GCC as much, but I think you could use inline assembler: If you search for "gcc inline assembler for arm" you should find a number of sites with guides.