I am using an AT91SAM7X512 for my application. I perform a software reset after certain action. The processor resets. But upon reading the RSTC_RSR
status register I get an invalid register value for the reset type: RSTC_RSR = 0x700
which translates the RSTTYP
register value to be 111
. This condition is not defined in the data sheet. I am reading the reset type by using the statement unsigned int buffer = AT91C_RSTC_RSTTYP;
.
Asked
Active
Viewed 173 times
2
1 Answers
3
AT91C_RSTC_RSTTYP
is the constant 0x700
, it is the bitmask to mask out the RSTTYP
bits in the RSTC_SR
register (defined in AT91SAM7X512.h
):
#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type
To read the register there is a pointer AT91C_RSTC_RSR
:
#define AT91C_RSTC_RSR (AT91_CAST(AT91_REG *) 0xFFFFFD04) // (RSTC) Reset Status Register
So
unsigned int buffer = *AT91C_RSTC_RSR;
should work for reading the register (but I didn't test it).

starblue
- 55,348
- 14
- 97
- 151
-
I'm novice to stackoverflow. Learning the nitty gritty. Thanks for asking. I've up voted it now. – Aditya Jan 16 '13 at 14:15