Hot!eds Memory Space compile problem

Author
craigjbradley
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2013/09/12 15:30:37
  • Location: 0
  • Status: offline
2017/10/06 17:37:26 (permalink)
0

eds Memory Space compile problem

I am trying to use the EPMP port on a PIC24FJ1024GB610 using a the PIM module on an Explorer 16 board.
The XC16 C Compiler (v1.32) User's Guide shows some example code in the following section.
8.10.3 __eds__ Type Qualifier
__eds__ unsigned int __attribute__((eds)) myEDSvar;
__eds__ char * myEDSpointer;
When I try to compile this I get:
EPMP_files/EPMP_driver.c:57:2: warning: ignoring eds attribute applied to automatic myEDSvar
I have included <xc.h>
 
The code does compile and run but the variable address (as observed in the debugger) is in local RAM so the EPMP will not see it.
I am running MPLAB X IDE v4.01 with XC16 v1.32 (latest versions)
Is that something else I need to do?
I cannot access the EDS memory space without declaring a variable or pointer in EDS space.
Does anyone have any ideas on this?
- Craig
#1

5 Replies Related Threads

    DarioG
    leaving this planet
    • Total Posts : 53017
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: porcodioland
    • Status: online
    Re: eds Memory Space compile problem 2017/10/06 19:23:29 (permalink)
    0
    Try making those variables global and not automatic, i.e. inside a function.

    Dario Greggio
    --
    how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

    #2
    craigjbradley
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2013/09/12 15:30:37
    • Location: 0
    • Status: offline
    Re: eds Memory Space compile problem 2017/10/07 09:03:34 (permalink)
    +1 (1)
    That compiles and when viewed in the debugger the address of the pointer is now in eds space!
    It is interesting that the example code in the compiler manual shows it in the function.  However it also says that this is from working code in the examples folder (I don't see any eds code there).
    Now I just have get the EPMP working.
     
    thanks!
     - Craig
    #3
    DarioG
    leaving this planet
    • Total Posts : 53017
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: porcodioland
    • Status: online
    Re: eds Memory Space compile problem 2017/10/07 09:36:21 (permalink)
    +1 (1)
    Good! I seem to remember some other thread about this in the past...
     
    Anyway, no, of course "local stack" can't be in EDS space - this would mean some crazy management!
     
    PS: unless, of course, *all* program stack goes into EDS...

    Dario Greggio
    --
    how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

    #4
    craigjbradley
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2013/09/12 15:30:37
    • Location: 0
    • Status: offline
    Re: eds Memory Space compile problem 2017/10/07 12:08:03 (permalink)
    +1 (1)
    Yes, this does make sense and I would normally want the declaration to be global anyway as I will need to address it in several functions for initialization and data input and output.  I am interfacing to a specialized I/O chip with several registers.  I can now write data and get the address bits, data bits and write strobe to appear but so far the chip select is not working.  I can generate a chip select with port I/O functions but it is supposed to be automatic.  There are quite a few configuration and pin mapping functions for that pin so hopefully I can get it going soon.
    #5
    craigjbradley
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2013/09/12 15:30:37
    • Location: 0
    • Status: offline
    Re: eds Memory Space compile problem 2017/10/07 15:53:46 (permalink)
    +1 (1)
    Just for the record, I now have the EPMP module working for read and write.  Getting the chip select working was a bit of a trial and error struggle.  The key is getting the Chip Select start address correct and the proper enables set.  Here are the key setup values if anyone needs them.  I am only using CS1 and 3 address bits.  This code is for a PIC24FJ1024Gx610.  I had to use the PMA14 function for Chip Select 1 as enabling PMCS1 didn't work even though they are on the same pin!
     

    PMCON1bits.CSF = 0b10;          // PMA15 is used for Chip Select 2,
    // PMA14 is used for Chip Select 1
    PMCS1BS = 0x0080;               // set CS1 start address to the start of the EPMP EDS space
    PMCON4bits.PTEN0 = 1;           // enable PMA0
    PMCON4bits.PTEN1 = 1; // enable PMA1
    PMCON4bits.PTEN2 = 1; // enable PMA2
    PMCON4bits.PTEN14 = 1; // enable PMA14 as CS1

    #6
    Jump to:
    © 2017 APG vNext Commercial Version 4.5