How to put a big array in OCRAM?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to put a big array in OCRAM?

跳至解决方案
1,296 次查看
simmania
Contributor IV

Hi,
I'm usingMCUXpresso with  MIMXRT1010-EVK hardware.

In my program I need a big array. The linker tries to put this in the SRAM_DTC (which I assume is the DTCM). But there is not enough room. While the SRAM_OC (which I assume is the OCRAM) is completely empty.
So, how to instruct the linker to put my big array in SRAM_OC?

Is there some tutorial about this kind of memory management stuff?

0 项奖励
回复
1 解答
1,291 次查看
simmania
Contributor IV

Ok, I found it out.
So here is how I did it, in case other people may want to know:

In the Properties of the project, under C/C++ Build -> MCU settings, I could see that the OCRAM section has the alias 'RAM3'. (here you also can change the sizes of the RAM sections)

Then in the code you can do:

#include <cr_section_macros.h>

__DATA(RAM3) uint16_t buffer[BUFSIZE];

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,292 次查看
simmania
Contributor IV

Ok, I found it out.
So here is how I did it, in case other people may want to know:

In the Properties of the project, under C/C++ Build -> MCU settings, I could see that the OCRAM section has the alias 'RAM3'. (here you also can change the sizes of the RAM sections)

Then in the code you can do:

#include <cr_section_macros.h>

__DATA(RAM3) uint16_t buffer[BUFSIZE];

 

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2001975%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%A6%82%E4%BD%95%E5%9C%A8%20OCRAM%20%E4%B8%AD%E6%94%BE%E7%BD%AE%E4%B8%80%E4%B8%AA%E5%A4%A7%E9%98%B5%E5%88%97%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2001975%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CBR%20%2F%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%E5%B8%A6%E6%9C%89%20MIMXRT1010-EVK%20%E7%A1%AC%E4%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