Memory Problem
Up to M32C
Can anyone show me how to read and write base on a structer to memory I have 4 mb of extern ram
on my project. I using MC3287
Thanks
Dennis
Using what development tools?
With gcc, you just edit the linker script to point to the external ram instead of the internal ram.
I'm Using HEW with reneesas c complier,
example code
typedef struct /* command message header structure */
{
long start_address; ( some address like 0xC00000 )
}MEM_MAP;
typedef struct /* command message header structure */
{
char name[80];
int a;
}_m0601rs;
#define MP_DB(a) (*(volatile _m0601rs*)((sizeof(map)+MEM_MAP.monitor_point.start_address)+(sizeof(m0601rs)*a)))
now using code example:
_m0601rs m0601rs;
MEM_MAP map;
sprintf(MP_DB(1).name,"hello world");
Thanks Dennis
Dennis,
You referenced example _m0601rs...
Can you include a link to this? Or explain where it came from?
What is MEM_MAP.monitor_point.start_address? MEM_MAP is a variable type, start_address is a member of MEM_MAP, and there is no variable monitor_point.
This example should fill 2MB starting at address 0xC00000 with "hello world".
unsigned char far * p_mem;
void dummyfunc(void);
void dummyfunc()
{
p_mem = (unsigned char far *)0xC00000;
while (p_mem < (unsigned char far *)0xE00000)
{
sprintf(p_mem,"hello world");
p_mem = p_mem+sizeof("hello world");
}
}

