AM263P4: AM263Px ICSS RAM mapping and access

Part Number: AM263P4


1.DRAM 0 and 1 "sharing"

While working with PRU_0 and PRU_1, we were surprised at how it interacts with DRAM0 and DRAM1. We are writing c-code for both of these cores and based the linker files off of example code. After much experimentation, it was noted that PRU_0 data RAM address 0x00000000 goes to DRAM0 address 0x00000000, ICSS relative address 0x00000000. But unexpectedly, PRU_1 data RAM address 0x00000000 goes to DRAM1 address 0x00000000, ICSS relative address 0x00002000. Both linker files use a starting RAM address of 0x00000000 and a length of 0x2000 for the data ram. We also noted that PRU_0 is able to access DRAM1 by referencing addresses greater than 0x2000. We also noted that PRU_1 was never able to directly make use of DRAM0. This is surprising, as the technical reference manual describes DRAM0 and DRAM1 as being shared. 

2. DRAM2 access outside of ICSS

We were able to determine that DRAM2 could be utilized by both cores of the PRU as expected, and data could be exchanged between PRU_0 and PRU_1 in this region. However, we were unable to use R5 core 0_0 to read or write values to 0x48010000 as expected. What is really interesting is that if R5 core 0_0 writes to 0x48010000 it can correctly read that value back, however, neither PRU core is able to retrieve the value from 0x00010000. We are truly confused as to what R5 core 0_0 is actually writing to in these instances. We have also validated that the MPU is setup correctly to allow read/write operations to this region.

3. CCS display of PRU stack values

This doesn't work. None of our local variables find the correctly memory address when debugging in CCS. We were able to track down variable memory locations by walking through the assembly code to determine that they were being handled in RAM correctly. 

4. CCS display of DRAM2 in memory viewer

When either of the PRU cores is selected during a debug session, and the memory window is set to PRU_Device_Memory, all of the values at 0x00010000 (DRAM2) show as 0. We have written test code to read/write directly to values in this region and validated that data flow is as expected, its just not being displayed in the memory viewer.

5. Technical Reference Manual error

In section 2.3 of SPRUJ55D (latest AM263P Technical Reference Manual), it lists PRU-ICSS Data RAM2 as starting at 0x00010000 and ending at 0x0001FFFF as expected. but it lists this size as 64KB, which it is not. We believe this should be 32KB to align with the listed locations and other areas of the document describing the size of DRAM2.

 

Please provide clarifications that what we have observed through development testing is what TI expects but hasn't clearly documented in the Technical Reference Manual.

  • Hi,

    1.DRAM 0 and 1 "sharing"

    While working with PRU_0 and PRU_1, we were surprised at how it interacts with DRAM0 and DRAM1. We are writing c-code for both of these cores and based the linker files off of example code. After much experimentation, it was noted that PRU_0 data RAM address 0x00000000 goes to DRAM0 address 0x00000000, ICSS relative address 0x00000000. But unexpectedly, PRU_1 data RAM address 0x00000000 goes to DRAM1 address 0x00000000, ICSS relative address 0x00002000. Both linker files use a starting RAM address of 0x00000000 and a length of 0x2000 for the data ram. We also noted that PRU_0 is able to access DRAM1 by referencing addresses greater than 0x2000. We also noted that PRU_1 was never able to directly make use of DRAM0. This is surprising, as the technical reference manual describes DRAM0 and DRAM1 as being shared. 



    ICSS level :-

    DRAM0 :- 0x00000000

    DRAM1 :- 0x00002000

    DRAM2 (also know known as SMEM)

    PRU0

    Address 0x00000000 will access DRAM0 at ICSS level, PRU0_DRAM0

    Address 0x00002000 will access DRAM1 at ICSS level, PRU0_DRAM1

    Address 0x00010000 will access DRAM2 at ICSS level

    PRU1

    Address 0x00000000 will access DRAM1 at ICSS level, PRU1_DRAM0

    Address 0x00002000 will access DRAM0 at ICSS level, PRU1_DRAM1

    Address 0x00010000 will access DRAM2 at ICSS level

    Both of the PRU cores will be able to access DRAM0, DRAM1, DRAM2 also there is no difference in terms of latency.

    On am263px :

    R5F

    Address 0x48000000 will access DRAM0

    Address 0x48000000 + 0x10000 will access DRAM2

    Address 0x48000000 + 0x2000 will access DRAM1


    you can run the empty example available in mcu_plus_sdk_path\examples\pru_io\empty to check these

    Download mcu plus sdk from here :-  www.ti.com/.../11.00.00.19

    Please check below images, PRU0 is writing at offset 0x0 and PRU1 is writing at offset 0x04 in DRAM0, DRAM1, DRAM2

    DRAM0 from PRU device memory


    DRAM1 from PRU device memory




    4. CCS display of DRAM2 in memory viewer

    When either of the PRU cores is selected during a debug session, and the memory window is set to PRU_Device_Memory, all of the values at 0x00010000 (DRAM2) show as 0. We have written test code to read/write directly to values in this region and validated that data flow is as expected, its just not being displayed in the memory viewer.




    DRAM2 from PRU device memory







    2. DRAM2 access outside of ICSS

    We were able to determine that DRAM2 could be utilized by both cores of the PRU as expected, and data could be exchanged between PRU_0 and PRU_1 in this region. However, we were unable to use R5 core 0_0 to read or write values to 0x48010000 as expected. What is really interesting is that if R5 core 0_0 writes to 0x48010000 it can correctly read that value back, however, neither PRU core is able to retrieve the value from 0x00010000. We are truly confused as to what R5 core 0_0 is actually writing to in these instances. We have also validated that the MPU is setup correctly to allow read/write operations to this region.

    you can verify this also from mcu_plus_sdk_path\examples\pru_io\empty example itself

    DRAM2 by connecting R5F0_0.

    PRU0 is writing at offset 0 and PRU1 is writing at offset 0x4



    5. Technical Reference Manual error

    In section 2.3 of SPRUJ55D (latest AM263P Technical Reference Manual), it lists PRU-ICSS Data RAM2 as starting at 0x00010000 and ending at 0x0001FFFF as expected. but it lists this size as 64KB, which it is not. We believe this should be 32KB to align with the listed locations and other areas of the document describing the size of DRAM2.

    DRAM2 starts at 0x00010000 and ends at 0x17FFF, you are right it is 32KB in some places of TRM it is documented incorrectly, I will follow up internally, thanks for reporting.




    3. CCS display of PRU stack values

    This doesn't work. None of our local variables find the correctly memory address when debugging in CCS. We were able to track down variable memory locations by walking through the assembly code to determine that they were being handled in RAM correctly. 

    can you share me test code or image for this.

    Thanks & regards,
    Manoj.

     

  • For item 1, are you able to provide a document (such as the technical reference manual) to support this? My testing aligns very closely to what you are showing, but I have not been able to locate this in common AM263Px documentation.

    For items 3 and 4, I should have specified that I am using the official TI IDE CCS 20.2.0.12, what you are showing is clearly the deprecated eclipse based IDE. I would encourage you to retest using the latest TI IDE.

    For item 2, I will review the example from the SDK and report back.

  • For item 2, I have reviewed the example and verified that data is being communicated in this project between the R5 and PRU through the shared memory region. My initial instinct on the differences between my non-working project and the example code, based on prior experience, is that the compiled c-code misses initialization steps. We've already experienced that with regards to r2 as the stack pointer. Looking at the assembly code in the example, there is specifically noted code which gives proper access to the shared RAM (lines 73 through 77). I will attempt to replicate this within my project.

    Please look into where this is documented outside of an example. We've already lost days of time due to the stack pointer initialization issue, and this is yet another instance where no example exists (in c-code) but certain things are required to be added.

  • Hello Nathan,

    I have reassigned your thread to a team member who will be responsible for making updates to the AM263P TRM.

    I am on a different team, so I will comment on the DMEM address question from the standpoint of AM62x (same PRU-ICSS infrastructure, we just didn't pin out the industrial communication signals on AM62x so we call it PRUSS instead).

    Memory maps - local vs global 

    The rest of the processor should access DRAM0 at 1 address, and DRAM1 at a different address. This is the "global" memory map. On the other hand, each PRU core sees a DRAM0 & 1 at different addresses - that is each PRU's "local" memory map.

    For AM62x TRM, refer to PRU chapter, section "Memory Maps". For AM26x devices, leave off the "PRUSS" part and just search for the rest of the section title.

    FYI: 16kB of IRAM, not 12kB 

    When I was looking at AM26x TRMs a few months ago, I think I saw IRAM listed as 12kB, but that is a typo. There is actually 16kB of IRAM per PRU core on AM26x devices. Not sure if the AM26x team has fixed that yet or not.

    Regards,

    Nick

  • I have split off the programming shared RAM & stack pointer initialization conversation into a separate e2e thread:
    RE: AM263P4: How to use shared memory region in PRU ICSS shared RAM

    AM26x team, any inputs on the TRM discussion?

    Regards,

    Nick

  • Hi Nick,

    I have created a jira for the TRM to be updated, it was indeed a bug in TRM.

    jira.itg.ti.com/.../SMCUAPPS-1131