This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Pointer allocation problem


Hi all,

I am porting my project from ADS to GCC_ARM v4.0.3. I have been able to
compile & Link my source files with GCC-ARM.  The image (running in Flash)
crashes on target. The reason for crash is wrong pointer allocation.

I have used a pointer to a structure as shown below:

typedef volatile struct UARTInfoTag
{
    void                         (*rxInt_p) (void);
    void                         (*txComplete_p) (void);
    tUartLineStatusCallbackFunc  lineStatusInt_p;
    tBool                        NewRxData;
    tBool                        IsTransmitting;
} UARTInfo;

#define NUMBER_OF_UARTS		2	

UARTInfo   UARTCallBack[NUMBER_OF_UARTS];
UARTInfo  *pUARTInfo = &UARTCallBack[0];

UARTCallBack is located in RAM with &UARTCallBack[0]=0x000033C8, but
pUARTInfo contains the value 0x4B1D1BCA & pUARTInfo is located in RAM at
address 0x00001FCA.

The address 0x4B1D1BCA is out of my memory range which leads to image crash
on target.

Also the pUARTInfo contains value =0x000033C8 when I use ADS for image
build.

Can anybody suggest me how to fix this problem?

Regards,
Kanwal
  


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]