Hello Forum,
I am trying to access peripheral registers on the LPC1768. As an initial test, I tried reading the reset value of the I2SDAO transmit channel which can be found at address 0x400A8000.
I tried running the following code:
pc.printf("i2s: 0x%x\r\n", *((unsigned int *)0x400a8000));
This caused the program to hang and not progress further. I then discovered that just dereferencing memory locations in the APB mapped peripherals (ok, I didn't try them all) caused a similar symptom. What is the recognised way to access register contents for debugging when developing drivers? I tried creating a structure that overlaid with the correct offsets, pointed it at a peripheral's base address, but again, program execution ceased when I dereferenced it. I checked the generated addresses and they all looked good and mapped to the User Manual addresses for the registers I was looking at. If this is a data abort, then how do I get this information while debugging?
I really need to be able to dump register contents for the work I am doing.
Thanks in advance for any help anyone can offer.
Hello Forum,
I am trying to access peripheral registers on the LPC1768. As an initial test, I tried reading the reset value of the I2SDAO transmit channel which can be found at address 0x400A8000.
I tried running the following code:
pc.printf("i2s: 0x%x\r\n", *((unsigned int *)0x400a8000));
This caused the program to hang and not progress further. I then discovered that just dereferencing memory locations in the APB mapped peripherals (ok, I didn't try them all) caused a similar symptom. What is the recognised way to access register contents for debugging when developing drivers? I tried creating a structure that overlaid with the correct offsets, pointed it at a peripheral's base address, but again, program execution ceased when I dereferenced it. I checked the generated addresses and they all looked good and mapped to the User Manual addresses for the registers I was looking at. If this is a data abort, then how do I get this information while debugging?
I really need to be able to dump register contents for the work I am doing.
Thanks in advance for any help anyone can offer.