A C compiler will always generally assume that integers are aligned - so there is normally no "quick" solution to this problem. Casting an integer to an unaligned memory address is not strictly valid C, so you are really in to implementation defined behavior of the compiler.With the RealView tools you can make a pointer point to a packed object - which will generate either unaligned accesses or byte accesses depending on the CPU you have chosen and the presence of the --[no-]unaligned flag:__packed int *pMyInt;There might be an equivalent for the IAR tools - but it varies from tool to tool ...
__packed int *pMyInt;