I'm using TMDXEVM6678LE board. Trying to make some data shared between cores, and I can't get the doubles in external memory to update to correct values. I use two projects - one holding all the data that is shared (and no executable code - it's compiled as a relocatable module), and a second one that uses this data.
Here is the code of the first CCS project:
#include <c6x.h>
#pragma DATA_SECTION(gptr_buffer, ".shared")
#pragma DATA_SECTION(glob_SNAFU, ".shared")
#pragma DATA_SECTION(glob_buffer, ".shared")
volatile double *gptr_buffer;
volatile double glob_SNAFU[4];
volatile double glob_buffer[8000];
.shared is a section that's supposed to appear in EXT0 region of memory, everything else goes int L2
Here is the code of the second CCS project:
#include <c6x.h>
#include "memory.h"
void main(void)
{
volatile double *vdref;
vdref = glob_SNAFU;
*vdref++ = 0.001;
for(;;){}
}
Contents of memory.h:
#ifndef _MEMORY_H
#define _MEMORY_H
extern volatile double *gptr_buffer;
extern volatile double glob_SNAFU[4];
extern volatile double glob_buffer[8000];
#endif
Both projects are compiled with "-mv6600 -g -O0"
When I execute project on the hardware using debug mode of CCS via Blackhawk XDS560v2-USB Mezzanine Emulator and view the contents of glob_SNAFU[0], it's value at the end of execution is -518969491456.0 rather than expected 0.001. I currenly run it only on a single core. Both projects have the same sections included in the linker command file. The only difference being that the linker command file of the second project explicitly includes the .out file of the first project. Note: earlier attempts with integers and pointers resulted in correct values being assigned.
I'm using:
CCS Version: 5.0.1.201105110900
Code Generation Tools: TI v7.2.1 (according to project preferences)
C6000 Code Generation Tools: v7.2.0.0 (according to Eclipse Installation Details)