tag:blogger.com,1999:blog-7822883683244244182.post8931268310773856267..comments2023-05-08T12:42:54.728+03:00Comments on low tech: Using The CCM Memory on the STM32muxhttp://www.blogger.com/profile/07901500843676691342noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-7822883683244244182.post-18439800976481836772017-08-02T16:22:08.548+02:002017-08-02T16:22:08.548+02:00I don't think so, they're both SRAMs. The ...I don't think so, they're both SRAMs. The CCM/TCM is just accessed exclusively. Note M4 doesn't have a cache.iabdalkaderhttps://www.blogger.com/profile/07526150314777847403noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-6245165709104378012017-08-02T15:58:57.256+02:002017-08-02T15:58:57.256+02:00Hy,
I read in the datasheets that the CCM Ram is ...Hy, <br />I read in the datasheets that the CCM Ram is supposed to be faster than the SRAM1 but when I run a little Test (10000x Incrementing a Variable in SRAM1 / CCMRAM, Variables were volatile and the Caches were disabled) I got the same results (both times 250us)????<br />Anonymoushttps://www.blogger.com/profile/10989516257662659421noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-38247071477491861262014-11-04T09:49:00.667+02:002014-11-04T09:49:00.667+02:00Hi,
thanks for your example, but I ran into troub...Hi,<br /><br />thanks for your example, but I ran into trouble. I tried to use your code to initialize a look up table in the CCM but all I get is a syntax error: nonconstant expression for load base<br /><br />any clue?Anonymoushttps://www.blogger.com/profile/14859111188022998571noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-61370681102039983712014-09-15T12:48:39.690+03:002014-09-15T12:48:39.690+03:00Really?
On STM32F405/407 (see Bus-Matrix above), t...Really?<br />On STM32F405/407 (see Bus-Matrix above), the CCM is NOT connected to the I-Bus or S-Bus at all.<br />So, executing code from it might prove difficult...<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-35426773681394870292014-04-13T18:26:10.620+02:002014-04-13T18:26:10.620+02:00if you're using malloc (linking with libc) you...if you're using malloc (linking with libc) you will need to fix _sbrk to check for heap/stack collision using the end of the heap (in main ram) not the stack, you could do that by using a different variable for the stack other than the one used by _sbrk (_estack) and if you need to place specific variables in the CCM you should use gcc's section attribute<br /><br />I'm currently using the CCM for everything (stack,heap and data), check out my linker script:<br />https://github.com/iabdalkader/openmv/blob/master/src/stm32f4xx.ldmuxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-72831388345404735862014-04-13T18:17:16.596+02:002014-04-13T18:17:16.596+02:00Also, please note, that the functions using CCM ma...Also, please note, that the functions using CCM may run slower, because the D-Bus must be arbitrated with FLASH.<br />To utilize CCM w/o performance penalty, one can for example copy some IRQ handlers code and data into the CCM. Angel Ghttp://digfor.netnoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-78170760225577121672014-04-13T17:46:32.628+02:002014-04-13T17:46:32.628+02:00Thank you for the NFO. It would be helpful if this...Thank you for the NFO. It would be helpful if this guide showed how to put the stacks (main stack, process stack) into the CCM. I imagine that one needs to edit the linker script: <br />.stack :<br /> {<br /> . = ALIGN(8);<br /> __stack_start = .;<br /> PROVIDE(__stack_start = __stack_start);<br /><br /> . = ALIGN(8);<br /> __main_stack_start = .;<br /> PROVIDE(__main_stack_start = __main_stack_start);<br /><br /> . += __main_stack_size;<br /><br /> . = ALIGN(8);<br /> __main_stack_end = .;<br /> PROVIDE(__main_stack_end = __main_stack_end);<br /><br /> . = ALIGN(8);<br /> __process_stack_start = .;<br /> PROVIDE(__process_stack_start = __process_stack_start);<br /><br /> . += __process_stack_size;<br /><br /> . = ALIGN(8);<br /> __process_stack_end = .;<br /> PROVIDE(__process_stack_end = __process_stack_end);<br /><br /> . = ALIGN(8);<br /> __stack_end = .;<br /> PROVIDE(__stack_end = __stack_end);<br /> } > ccm_ram AT > ccm_ram<br />If I want to combine the stack with some variables in the ccm, should I do anything else ?<br />Note that the CCM is not accessible by DMA.Angel Ghttp://digfor.netnoreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-87533084253543960912013-12-06T17:55:14.372+02:002013-12-06T17:55:14.372+02:00That depends on the linker script, most scripts ei...That depends on the linker script, most scripts either ignore it or just define a section for later use in runtime, but haven't seen any examples with initialized data, so I thought I'd post one, it just all depends on your application. and you're welcome, ask all you want.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-30098787367132786872013-12-06T17:22:18.284+02:002013-12-06T17:22:18.284+02:00Was what I meant, thank you for your patience :p
...Was what I meant, thank you for your patience :p<br /><br />Just one more question about it, if we don't define the CCM as you did on the first code block above, what is the default use for CCM? the microcontroller doesn't use it at all or use ir like a normal RAM?metRo_https://www.blogger.com/profile/13281650845339811266noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-73545838349119777492013-12-06T16:43:07.158+02:002013-12-06T16:43:07.158+02:00I'm not sure I understand you, if you mean I c...I'm not sure I understand you, if you mean I can read the data from flash, yes, but that would be slow, I needed some arrays in memory, so I used the CCM as an extra block, there's some memory left there, so I may eventually move the stack there too.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-58570919139703908372013-12-06T16:12:57.644+02:002013-12-06T16:12:57.644+02:00but on a faster way that using it on the FLASH, th...but on a faster way that using it on the FLASH, that's it?metRo_https://www.blogger.com/profile/13281650845339811266noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-25584882753681736202013-12-06T15:50:03.224+02:002013-12-06T15:50:03.224+02:00no stack just the data, I'm just using it as a...no stack just the data, I'm just using it as an extra memory block.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-67637215819813288212013-12-06T14:35:19.607+02:002013-12-06T14:35:19.607+02:00If I understand it correctly, it is the what you a...If I understand it correctly, it is the what you are doing:<br />1-you load the CCM data in Flash<br />2-when the microcontroller start it copy the data to CCM<br /><br />Now I just don't understand if you are placing the stack into CCM or any other data.<br /><br />Thank you :)metRo_https://www.blogger.com/profile/13281650845339811266noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-81832610062158491792013-12-06T03:26:47.357+02:002013-12-06T03:26:47.357+02:00Hi, contiguous memory means a single block of memo...Hi, contiguous memory means a single block of memory, no gaps in the address space, the STM32F4 has 3 blocks, two contiguous blocks (128KB total) and a separate CCM block (64KB), so you can't allocate a single array that spans the 3 blocks. <br />As for the CCM, I think I've talked about it enough in the post, but anyway, it's connected directly to the core on a separate bus, which means the core can access it while the main memory bus is used by say the DMA, you don't actually need to use it, but if you place the stack and critical system data there, the core should access them faster.muxhttps://www.blogger.com/profile/07901500843676691342noreply@blogger.comtag:blogger.com,1999:blog-7822883683244244182.post-63676518128279706182013-12-06T02:32:23.484+02:002013-12-06T02:32:23.484+02:00hi,
can you post another topic or update this one ...hi,<br />can you post another topic or update this one with information about what contiguous memory and CCM are? and why do you ned to use it? thank youmetRo_https://www.blogger.com/profile/13281650845339811266noreply@blogger.com