This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

variable pattern in sram

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

Parents
  • 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.

Reply
  • 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.

Children