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.

Concerto shared memory trouble

Hi, i'm using a Concerto Experimenter's kit with F28M35H52C1 MCU onboard.
I am trying to transfer data between M3 and C28 cores. When i try to store variables into shared memory (M3 core) like this:

int test_var[10] = {0,1,2,3,4,5,6,7,8,9};
#pragma DATA_SECTION(test_var,"SHARERAMS0");

on debug i see test_var[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} instead of my data.

My .cmd file for this project looks like this:

SECTIONS
{
/* Allocate program areas: */
.text : > FLASH
.binit : > FLASH
.cinit : > FLASH
.pinit : > FLASH

/* Initialized sections go in Flash */
.const : > FLASH

/* Allocate uninitalized data sections: */
.data : > S07SHRAM
.bss : >> C03SRAM | S07SHRAM
.dma : > S07SHRAM
.sysmem : > C03SRAM | S07SHRAM
.stack : > S07SHRAM
.cio : > C03SRAM
.neardata : > C03SRAM
.rodata : > C03SRAM
.args : > C03SRAM

SHARERAMS0 : > RAMS0
SHARERAMS1 : > RAMS1
}

1) Why it is happening?

2) Is it possible at all simply put variable into shared ram on M3 and get it on C28 core?

  • Did you configure memory subsystem to use Sx-0 RAM as Shared memory?

    I suppose, you need to configure MEMCNF register and set Sx-0 field to "1", then select Master. Only Master is able to write to the selected memory region.

    Please refer to spruh22c.pdf, page 189 and page 421.

    If you want bi-direction memory transfer, you should use IPC functionality (MSG RAM) or configure different SxRAM with opposite Masters.