This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RVCT: Define to register (RO, WO) at the same location

Hi

When defining to (or more) registers at the same address the linker return error (memory overlap). How to solve this ?

Ex:

// Read only
volatile union { U32 REG; struct { U32 MIS : 1; // RD U32 :31; // RD } BIT; } I2CMMIS __at (0x40020018);

// Write only
volatile union { U32 REG; struct { U32 IC : 1; // WR U32 :31; // WR } BIT; } I2CMICR __at (0x40020018);

Parents Reply Children
  • "want to use different name to the registers when reading or writing"

    Isn't that exactly what a union gives you?

    Why not:

    volatile union
    {
       // Read-Only
       volatile union
       {
          U32 REG;
          struct { U32 MIS : 1; } BIT;
       } MIS;
    
       // Write-Only
       union
       {
          U32 REG;
          struct { U32 IC : 1; } BIT;
       } ICR ;
    
    } I2CM  __at (0x40020018);