EmbDev.net

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


Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 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.

Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 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.

Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 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.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.