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

C167CS - can't access XRAM @0xC000

Can any one tell me how to access the XRAM at address 0xC000 on the C167CS.

I have :-
- ticked 'use on-chip xram'
- added XRAM class in linker file is as follows :-

   CLASSES (ICODE(000000h),
     IDATA0(00F600h),
     SDATA(00E000h-00E7FFh),
     SDATA0(00E000h-00E7FFh),
     XRAM(00C000h-00D7FFh),
     NCODE(010000h-013FFFh),
     .... etc
- used the RENAMECLASSE control at the top of my 'Debug.c' file and allocated some XRAM memory as follows
   #pragma RENAMECLASS(SDATA = XRAM)
   #pragma NOINIT

    static int sdata Temp[20];

The resulting .m66 file looks encouraging ...

START     STOP      LENGTH    TYPE  RTYP  ALIGN  TGR  GRP  COMB  CLASS   SECTION NAME
=====================================================================================
00C000H   00C027H   000028H   DATA  REL   WORD   ---    2  PUBL  XRAM    ?SD?DEBUG
But it doesn't work - the XRAM is not accessible. Any ideas anyone ??

Regards

Hari

Parents Reply Children
  • I would double check to make sure that you are indeed enabling all of XRAM.

          MOV   XPERCON,#0C03H    ; Enable CAN 1 and CAN 2 Xbus peripherals
                                  ; Enable XRAM 2 KByte memory
                                  ; Enable XRAM 6 KByte memory
          NOP
          NOP
    
          MOV   SYSCON,#8184H     ; Stack size = 512 words
                                  ; Internal rom starts at 00'0000
                                  ; Segmentation enabled
                                  ; Internal rom disabled
                                  ; BHE pin enabled
                                  ; Clock out pin enabled
                                  ; WR is write low, BHE is write high
                                  ; Xbus peripherals are enabled
                                  ; Xbus accesses are not visible on external bus
                                  ; Xbus peripherals not accessable on external bus


    Additionally try this in your linker file,
    SDATA0 (C000H-D7FFH, E000H-E7FFH)

  • Hari,

    The above works for sure because we are using with our C167CS.