cancel
Showing results for 
Search instead for 
Did you mean: 

How to put struct object in absolute memory address?

jmary
Associate III

My old project using 16bit infineon MCU with tasking c166, now I am moving to spc5 with free gnu gcc spc5studio.

I am working with typedef struct.

typedef struct
{
	struct
	{
		struct
		{
			INT16  Rpm[6];
			INT16  Load[7];
			INT16  Threshold[6];
		}
		pickup;
       } sensor;
     
      UINT16	checksum;
} USERDATA;

in c166 I set a struct object to an absolute address with ___at

USERDATA __at( 0xE00004 ) userData;

how to do the same with spc5 free gnu gcc?

This discussion is locked. Please start a new topic to ask your question.
11 REPLIES 11

The SPC5 is your platform, is the address RAM?

Or FLASH you want to set via calibration process?

M​y example was one of using pointers vs globals.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jmary
Associate III

Yes, the address is RAM.

I tried the code in windows pc first, still waiting for the development board.