2014-10-09 06:45 AM
Hi everyone,
I'm working on an STM32F427 on a program with a huge linked list. I want to decrease the size of pointers used in this list in order to increase the number of elements in my ram. For instance, the memory mapping says that regular ram is located between 0x20000000 to 0x2002FFFF and CCM ram between 0x10000000 and 0x1000FFFF. So for example if i want to use the CCM ram for my linked list can i split the adresses in two parts. the significant part in my structure and concat the fixed part (0x1000) when i need it ? Is it possible and safe ? How would you do that ? Thank you, Ben #stm32f4-pointer2014-10-09 07:31 AM
Benoit,
ARM compiler generally align structures on 4-bytes boundaries. So the CCM only provides 16384 possible position for structures. Instead of using a pointer, you can use an index in range 0 - 16383, which requires only 2 bytes of storage, instead of 4 for a regular pointer. The conversion between the index and the real pointer is trivial.