Pointer Optimization
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-10-09 6:45 AM
Posted on October 09, 2014 at 15:45
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-pointer
Labels:
- Labels:
-
STM32F4 Series
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-10-09 7:31 AM
Posted on October 09, 2014 at 16:31
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.