EmbDev.net

Forum: ARM programming with GCC/GNU tools Integer getting placed at address not divisible by 4


von Vinit B. (vinitbidkar)


Rate this post
useful
not useful
Details: i am using Atmel's AT91SAM7X256-EK board

Compiler: IAR 5.11

Problem Summary: An 32 bit structure member int (uint32_t) is getting
placed in the memory at an adress which is not divisible by 4. Hence an
abort execption is getting generated due to misaligned read access.

Do i have to use any compiler setting to avoid this?

According to my knowledge, in an ARM 7 processor, a data type will
always be placed at a memory location which is divisible by the size of
that data type.

von Vinit B. (vinitbidkar)


Rate this post
useful
not useful
Vinit Bidkar wrote:
> Details: i am using Atmel's AT91SAM7X256-EK board
>
> Compiler: IAR 5.11
>
> According to my knowledge, in an ARM 7 processor, a data type will
> always be placed at a memory location which is divisible by the size of
> that data type.

Additonal information:

The above mentioned structure pointer is typecasted to an array pointer.
When i create a local instance of the structure then there in problem of
misalignment.

von Vinit B. (vinitbidkar)


Rate this post
useful
not useful
Vinit Bidkar wrote:
> Vinit Bidkar wrote:
>> Details: i am using Atmel's AT91SAM7X256-EK board
>>
>> Compiler: IAR 5.11
>>
>> According to my knowledge, in an ARM 7 processor, a data type will
>> always be placed at a memory location which is divisible by the size of
>> that data type.
>
> Additonal information:
>
> The above mentioned structure pointer is typecasted to an array pointer.
> When i create a local instance of the structure then there in problem of
> misalignment.

Typo
When i create a local instance of the structure then there no problem of
misalignment.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.