I'm trying to write to memory using pointer as below, But it is writing to the unexpected address.
uint32_t* pointer = (uint32_t) (__MEMORY_BASE)
*(pointer+4) = data;
While using the below its working as expected,
uint32_t* pointer = (uint32_t) (__MEMORY_BASE + 4)
*pointer = data;
Can anyone please let me know, WHy I'm not able to use the first method to write to pointer address.