STM32F429 & SDRAM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-14 8:45 AM
Hi,
I have been working with a Waveshare Core 429I board, essentially an STM32F429IGT6 & IS42S16400J and Keil.
I am trying to store a large array in the SDRAM using the int32_t Array[xxxxx] __attribute__((at(0xD000000))); command, and have FMC and SDRAM functions initiated first.
I can declare a very large array okay and write to individual elements fine, but when I try to fill it using a for loop the program hard faults and 'Cannot access Memory' is displayed. I don't think the for loop requires the array to be in the heap?
I have done lots of reading, I believe there is no reason to need a scatter file, increase the heap size or call the ram functions in the Systeminit routine when using SDRAM in main? I am a complete novice with Keil and my C experience is fairly limited.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-01 11:45 AM
Hi Clive,
I've got my hands on a 32f429I-Discovery board but still having problems.
I've attached the entire project, you will see what I'm trying to achieve is quite simple so something is probably incorrectly configured.
I have not used a scatter file but entered the external RAM address and size into target options.
Thanks again
________________ Attachments : DISCO.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxXn&d=%2Fa%2F0X0000000azf%2FAXsjRHHgirof6qt77eVCO3.dnw2sNzkamP1Zc9u3ttA&asPdf=false- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-02 8:12 AM
STM32F429I-DISCO
Core=180000000, 180 MHz
CPUID 410FC241 DEVID 419 REVID 1003 Cortex M4 r0p1 STM32F429 or F439 C0000000 00000000 00000000 10110021 11000011 00000000 FPU-S Single-precision only APB1=45000000 APB2=90000000 RAM OK 80000 50000 1000 ________________ Attachments : DISCO-002.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxXZ&d=%2Fa%2F0X0000000azd%2FaZF3._rWULhTbBU86zvLyXQwytrkAS_j27rHoCefojQ&asPdf=falseUp 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
‎2018-06-04 6:01 AM
Hi Clive,
Thank you so much for the resolution.
So it would seem the default Keil compiler is not working with the __attribute__at command for static allocation, with dynamic allocation the correct D0000000 addresss shows in the debugger.
The address location in the debugger is the same with or without the __attribute__at, I have checked the documentation and it should work fine with a non GNU compiler.
Is there a way to resolve this without dynamic allocation using the __attribute__at command, as I intend on having multiple 2D arrays within SDRAM?
Static allocation would be much simpler.
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-04 9:08 AM
I don't like AT for many reasons. Why does this stuff need to be at absolute addresses? Can't you use the scatter file to direct the linker to place specific variables in SDRAM? can't you define a structure where you place all your SDRAM buffers, mange the placement/ordering in there, and set the pointer to the base of the SDRAM?
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
‎2018-06-04 9:17 AM
Try not defining the Array inside the scope of a function, ie do it globally, the code exploded because it made a large stack allocation.
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
‎2018-06-04 5:37 PM
Dear
Turvey.Clive.002
, please give examples of scatterfile for external memory- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-04 6:54 PM
Try some of these
https://community.st.com/0D50X00009XkgpJSAR
https://community.st.com/0D70X000006SIA5SAO
I'll fish some more, and try and fix the DEAD LINKs
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
‎2018-06-04 7:53 PM
Here stuffing memory into the Keil allocator
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
‎2018-06-07 11:57 AM
Clive, thank you so much, this is exactly what I needed to resolve.
Everything is working fine, I had no idea a large external array declaration would overflow the stack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-06-07 12:19 PM
>> I had no idea a large external array declaration would overflow the stack.
From static analysis I didn't either, but the debugger kept exploding. Having an auto variable with an AT directive apparently is an issue, not a form I've every tried, but I'll remember it now.
&sharpTheElephantInTheRoom
Up vote any posts that you find helpful, it shows what's working..

- « Previous
-
- 1
- 2
- Next »