How to use flash memory address for particular variables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 12:54 AM
STM32F469I discovery board.
How to use internal flash memory address for a particular variables? it's possible ?
I am struggled with this issue.
i am beginner of stm32. help me.
Solved! Go to Solution.
- Labels:
-
Flash
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-26 6:42 AM
See here how to add a linker section and put variables there:
https://www.openstm32.org/Using%2BCCM%2BMemory
Use QSPI memory address rather than CCMRAM as in the example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 1:06 AM
Not exactly clear what exactly you're trying to achieve here.
​
P​lacement of constant data, via attributes and linker script sections?
​
O​r writing semi-permanent data or configuration into section of the flash memory?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 1:19 AM
File: mani.c
unsigned short int FlashArray[8192] __attribute__ ((at((uint32_t)0x08004000)));
File :STM32F469NIHX_FLASH.id
.user_data (NOLOAD) :
{
. = ALIGN(4);
*(.user_data) /* .buffram section */
. = ALIGN(4);
} >FLASH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 1:29 AM
I'd probably avoid the AT method and use a C pointer method​, where you make a hole in the FLASH sections in the linker script, with an initial section for the vector table and some initialization code to be directed into.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 2:39 AM
Thanks for your reply. I tried this logic also ,
main.c
const unsigned short int FlashArray[10] __attribute__((__section__(".user_data")));
File :STM32F469NIHX_FLASH.id
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
SDRAM (rw) : ORIGIN = 0xC0000000, LENGTH = 16M
QSPI (r) : ORIGIN = 0x90000000, LENGTH = 16M
.user_data (NOLOAD) :
{
. = ALIGN(4);
*(.user_data) /* .buffram section */
. = ALIGN(4);
} >FLASH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 9:27 AM
Putting an uninitialized array into flash makes no sense. Flash cannot be used as RAM. You didn't answer Tesla's question on what you are trying to achieve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-25 9:34 AM
I'd recommend sub-dividing this into 3 sections, one for the vectors, a hole for your data, and then the residual
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-26 1:54 AM
can i allocate QSPI memory for my uninitialized array? instead of RAM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-26 6:42 AM
See here how to add a linker section and put variables there:
https://www.openstm32.org/Using%2BCCM%2BMemory
Use QSPI memory address rather than CCMRAM as in the example.
