This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F28069 CLA data ram read from CPU

I'm trying to to copy a struct from CLA Data Ram 1 to memory mapped to to the main CPU. I've found that using an assignment or memcpy uses RPT and PREAD to move the data.

 

According to SPRUH18D (p. 167), when MMEMCFG.RAM1E == 1 and MMEMCFG.RAM1CPUE ==1, CPU program reads return 0. This seems to be happening when using PREAD.

 

However, if I manually loop and assign the pointers without optimizations or use memmove, MOVs are used and the memory is copied correctly.

Is there any solution to this? The CLAtoCPUMsgRam is too small for my structure.

 

  • Nicholas,

    I do not see where program bus access (e.g. PREAD) to the CLA RAM blocks is restricted relative to data bus access (e.g., MOV).

    Nicholas Green said:

    According to SPRUH18D (p. 167), when MMEMCFG.RAM1E == 1 and MMEMCFG.RAM1CPUE ==1, CPU program reads return 0. This seems to be happening when using PREAD.

    I don't think p.167 is the correct page.  That page talks about vector table mappings.  I think you mean p.542?  According to p.542, if MMEMCFG.RAM1E==1 and MMEMCFG.RAM1CPUE==1, both the CLA and the CPU have access to CLA Data RAM 1.  I don't see any restriction on the bus that the CPU can use.  If you look at the F2806x datasheet, SPRS698D, p.10, Figure 2-1, you can see that CLA Data RAM 1 appears in both the Program and Data spaces for the CPU.

    If you are absolutely convinced that program access (PREAD) does not work, you can force MOV instruction use by writing a C-callable ASM function to do the transfer.  Alternately if you want to stick with C, you can try putting your copy function in a seperate source file and setting file specific build options for that file.  Turn off the unified memory model (disable -mt option) for the file.  That will stop the compiler from generating PREAD instructions.

    Regards,

    David

  • Thanks for the quick reply, David.

    My mistake, I meant p. 676, which is the CLA appendix. Assuming I'm correct, is there a way to use RPT #N || MOV ? I'd prefer to use the most efficient method possible, and that seems quicker than memmove.

    I'm a bit confused on the wording in general. The PREAD is a program space read, correct? Is that not the same as "CPU program reads" mentioned on p. 676, which returns 0? I understand that they both appear in Program and Data space, but if it's mapped as the CLA Data RAM and the instruction is a program space read, it seems the statement "CPU program reads return 0 while program writes are ignored" is valid.

  • Nicholas,

    I see p.676 now.  I think you're correct.  When it says program reads return 0, it means PREAD instruction.  The memory map shown in the datasheet that I cited shows the CLA data RAM in both CPU program and data space because I guess it is accessible in both spaces when mapped to the CPU.  Page 676 details the access.

    So if you need to avoid PREAD, try what I suggested.  Either code a small C-callable ASM function to do the transfer, or you can try disabling -mt compiler option for the specific source file of interest.

    - David

  • Thanks for the clarification and suggestion!