• AVR Freaks

Hot!Using extended address, DDR Ram

Author
RyanF
Starting Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/04/11 06:31:29
  • Location: 0
  • Status: offline
2020/01/23 05:06:22 (permalink)
0

Using extended address, DDR Ram

Hi All
 
I am using a Pic32MZ2064DAH176 with integral 32Mb DDR RAM.
XC32 version 2.3
 
I tried to define a memory region in DDR like this.
#pragma region name="ddr_mem" origin = 0xA8000000 size = 0x1000
 
Then created a struct (of type SIG_WINDOW) array in this region like this
 
SIG_WINDOW sigWindow[5] __attribute__((region("ddr_mem")));
 
All compiles and runs BUT if I look at the watch screen  I see that sigWindow starts at address 0x0
 
So now I am not sure if sigWindow is actually in DDR or located @  0x00
 
I can set pointers to DDR address and read/write to memory locations, this works fine.
I was hoping to be able to allocate multiple regions in DDR without having to keep track of each data structure's absolute address.
 
Any advice greatly appreciated.
 
 
#1

3 Replies Related Threads

    RyanF
    Starting Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2017/04/11 06:31:29
    • Location: 0
    • Status: offline
    Re: Using extended address, DDR Ram 2020/01/28 02:18:56 (permalink)
    +1 (1)
    Just an update
     
    It appears that the memory management mechanisms have not been implemented in the PIC.
    If I create a variable in the above area and try programmatically access it, the program crashes.
     
    I can however create a pointer to memory location (in kseg1 @ 0xA8000000 )
     
    If  I write a value to this location and read it back to a variable in the regular RAM, it works perfectly.
    If I upload and  look at memory 0x8000000 and above nothing is updated hence why I think this has not been implemented on the PIC yet.
     
    So it looks like you have to use pointers and manage memory allocation manually when using the integrated DDR.
    #2
    JasonK
    Moderator
    • Total Posts : 3406
    • Reward points : 0
    • Joined: 2003/11/14 09:49:40
    • Location: Microchip Technology in Arizona, USA
    • Status: offline
    Re: Using extended address, DDR Ram 2020/02/25 14:30:34 (permalink)
    0
    How are you initializing the DDR controller? Using the __on_reset() hook?

    Jason Kajita
     Follow me on Twitter
    http://support.microchip.com for urgent questions
    #3
    RyanF
    Starting Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2017/04/11 06:31:29
    • Location: 0
    • Status: offline
    Re: Using extended address, DDR Ram 2020/02/26 02:13:39 (permalink)
    0
    Hi JasonK
    I used the Harmony 3 configuration to setup the DDR.
    It creates the configuration function.
     
    THe DDR works, Ican access using pointers in DDR space, I just dont seem to be able to treat it like normal memory (ie create regions etc).
    #4
    Jump to:
    © 2020 APG vNext Commercial Version 4.5