Question

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;.

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top