We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I've one global pointer to a register in one c-file. This variable is stored in the sram at the position (shown in the symbol window) - e.g. 0x00100000. But when I take a look into the memory window I can see this variable at 0x00100000, 0x00110000, 0x00120000, 0x00130000 and so on. What's the reason for this?
The header file is included in this c-file and in another c-file calling one function.
When I commend out this variable I don't see this pattern in the sram - but I can see a few other pattern where's the same problem (with maybe librarys). In both c-files I include the same librarys.
thanks in advance JChris
You haven't mentioned if it is internal or external RAM.
Quite a number of processors has only partial address decoding, i.e. all "bigger" address lines are not decoded. The result is that you will get aliasing, where you will see multiple full copies of the RAM directly following each other. If you place a 2kB RAM in a 8kB window, and don't decode the two most significant address lines of the 8kB range, you will see four full copies of the RAM.
The variable is stored in the internal RAM.
The result is that you will get aliasing, where you will see multiple full copies of the RAM directly following each other.
But I won't get in trouble if I store more variables in the internal RAM, so that the multiple copies will be overlayed themselves?
JChris
In a situation where you have aliasing (such as a 2kB RAM showing up 4 times after each other in a 8kB memory area) you will not get into any problems if you only use 2kB variables. As soon as you try to use more than 2kB, writes past the 2kB limit will roll ower and destroy other variables.
The datasheet for your chip will tell you how much internal RAM it has. If you have RAM aliasing, then the aliasing distance should be a multiple of the RAM size.
thanks for your explanation - now I understand what you mean. The size for the SRAM is much bigger than the SRAM really is, so the values of the SRAM will be shown several times.
Yes, it is quite common (at least for "bigger" processors) that the allocated space is a lot larger than the actual amount of RAM.
The ARM has 4GB of address space. Because of this, they may allocate a huge memory range for RAM. Then they release a number of specific models with varying amount of RAM and/or FLASH.