I'm having trouble passing data between the cores via shared ram on the F28M35H52C1.
I've followed the examples shown in Ram Management and Lab 5, implemented basically the same lines, but when I run the code, I do not see the values actually getting updated at the target core. For example, the C28 writes a value of 3.1415 into the variable, but the corresponding variable on the M3 remains 0, its initial value.
Here are the relevant parts of the code. Am I missing something?
C28 main:
#pragma DATA_SECTION("SHARERAMS2"); float c28_r_array; // mapped to S2 of shared RAM owned by M3 #pragma DATA_SECTION("SHARERAMS0"); float c28_r_w_array; // mapped to S0 of shared RAM owned by c28 void main(void) { ...... c28_r_w_array = 3.1415; ...... }
C28 linker:
RAMS0 : origin = 0x00C000, length = 0x001000 /* on-chip Shared RAM block S0 */ RAMS1 : origin = 0x00D000, length = 0x001000 /* on-chip Shared RAM block S1 */ RAMS2 : origin = 0x00E000, length = 0x001000 /* on-chip Shared RAM block S2 */ RAMS3 : origin = 0x00F000, length = 0x001000 /* on-chip Shared RAM block S3 */ RAMS4 : origin = 0x010000, length = 0x001000 /* on-chip Shared RAM block S4 */ RAMS5 : origin = 0x011000, length = 0x001000 /* on-chip Shared RAM block S5 */ RAMS6 : origin = 0x012000, length = 0x001000 /* on-chip Shared RAM block S6 */ ...... SHARERAMS0 : > RAMS0, PAGE = 1 SHARERAMS1 : > RAMS1, PAGE = 1 SHARERAMS2 : > RAMS2, PAGE = 1 SHARERAMS3 : > RAMS3, PAGE = 1 SHARERAMS4 : > RAMS4, PAGE = 1 SHARERAMS5 : > RAMS5, PAGE = 1 SHARERAMS6 : > RAMS6, PAGE = 1
M3 main:
#pragma DATA_SECTION("SHARERAMS0"); float m3_r_array; // this array is mapped to S0 #pragma DATA_SECTION("SHARERAMS2"); float m3_r_w_array; // this array is mapped to S2 void main(void) { ...... RAMMReqSharedMemAccess((S0_ACCESS),C28_MASTER); ...... }
M3 linker:
S0 (RWX) : origin = 0x20010000, length = 0x2000 S1 (RWX) : origin = 0x20012000, length = 0x2000 S2 (RWX) : origin = 0x20014000, length = 0x2000 S3 (RWX) : origin = 0x20016000, length = 0x2000 S4 (RWX) : origin = 0x20018000, length = 0x2000 S5 (RWX) : origin = 0x2001A000, length = 0x2000 S6 (RWX) : origin = 0x2001C000, length = 0x2000 S7 (RWX) : origin = 0x2001E000, length = 0x2000 ....... SHARERAMS0 : > S0 SHARERAMS1 : > S1 SHARERAMS2 : > S2 SHARERAMS3 : > S3 SHARERAMS4 : > S4 SHARERAMS5 : > S5 SHARERAMS6 : > S6 SHARERAMS7 : > S7
I also tried very similar code shown in Lab5, using the CtoM and MtoC, but that does not work either.
Am I misunderstanding something? All I should need to do is to link the memory, then link with the pragma, then set or read the variables, correct? (FYI I am programming in C++ so the pragma syntax is slightly different. Also I tried changed the arrays from the example to be single variables for testing, but it does not work either way)
Thanks for any help!