cancel
Showing results for 
Search instead for 
Did you mean: 

How to declare a big array in external SDRAM?

ray
Associate II
Posted on January 06, 2015 at 14:03

I use STM429 and 128Mb SDRAM and want to decare a big array in keil. How to declare it? How to let keil linker know the array is in external RAM?

I defines uint8_t temp[1024*1024], but linker error L6406E: no space in execution region.

Thanks.
3 REPLIES 3
Uwe Bonnes
Principal II
Posted on January 06, 2015 at 14:22

How to declare a big array in external SDRAM?I use STM429 and 128Mb SDRAM and want to decare a big array in keil. How to declare it? How to let keil linker know the array is in external RAM?

I defines uint8_t temp[1024*1024], but linker error L6406E: no space in execution region.

Thanks.

uint8_t *temp = (uint8_t *)0xa0000000

Or learn about section attributes in C and section definitions in the linker.
Posted on January 06, 2015 at 15:02

char buf[256] __attribute__ ((section(''.sdram'')));

Then you'd need to describe the memory regions and sections in the scatter file, and make sure you initialize the SDRAM in SystemInit() so it's functional prior to the C run time code initializing the statics. This uses the CCM memory, but is on point, add a RAM1 section for the external SDRAM [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Usage%20of%20CCM%20Data%20RAM%20in%20KEIL&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20140926%252010%253a32%253a21%26p_ID%3D43964%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41&currentviews=32]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Usage%20of%20CCM%20Data%20RAM%20in%20KEIL&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20140926%252010%253a32%253a21%26p_ID%3D43964%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41¤tviews=32
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ray
Associate II
Posted on January 07, 2015 at 14:55

It's good. thank you.