查看: 3835|回复: 3

[其他] IAR报错 cannot fit "Block ZI" 请问如何访问dtcm内存

[复制链接]

该用户从未签到

2

主题

7

帖子

0

新手上路

Rank: 1

积分
27
最后登录
2018-11-4
发表于 2017-10-9 16:25:59 | 显示全部楼层 |阅读模式
单片机是KV58,应该是itcm 64kb的内存满了,求问如何使用d0tcm以及d1tcm的ram

我知道答案 目前已有3人回答
回复

使用道具 举报

该用户从未签到

3

主题

90

帖子

0

中级会员

Rank: 3Rank: 3

积分
419
最后登录
1970-1-1
发表于 2017-10-9 21:21:21 | 显示全部楼层
本帖最后由 浪淘沙-407988 于 2017-10-9 21:24 编辑

试着 Linker file 里这样干:
define symbol __ICFEDIT_region_FLASH_start__   = 0x10000000;
define symbol __ICFEDIT_region_FLASH_end__     = 0x100fffff;  
define symbol __ICFEDIT_region_ITCM_start__    = 0x0;
define symbol __ICFEDIT_region_ITCM_end__      = 0x0000ffff;
define symbol __ICFEDIT_region_DTCM_start__    = 0x20000000;
define symbol __ICFEDIT_region_DTCM_end__      = 0x2001ffff;
define symbol __ICFEDIT_region_OCRAM_start__   = 0x2f000000;
define symbol __ICFEDIT_region_OCRAM_end__     = 0x2f00ffff;


define region RAM_region   = mem:[from __ICFEDIT_region_ITCM_start__   to __ICFEDIT_region_ITCM_end__]
                           | mem:[from __ICFEDIT_region_DTCM_start__ to __ICFEDIT_region_DTCM_end__]
                           | mem:[from __ICFEDIT_region_OCRAM_start__ to __ICFEDIT_region_OCRAM_end__];


define block ApplicationRam { readwrite, block CodeRelocateRam, block CSTACK, block HEAP };
place in RAM_region   { block ApplicationRam };
回复 支持 反对

使用道具 举报

该用户从未签到

2

主题

7

帖子

0

新手上路

Rank: 1

积分
27
最后登录
2018-11-4
 楼主| 发表于 2017-10-11 22:49:32 | 显示全部楼层
浪淘沙-407988 发表于 2017-10-9 21:21
试着 Linker file 里这样干:
define symbol __ICFEDIT_region_FLASH_start__   = 0x10000000;
define symb ...

抱歉我看不太明白我的icf里面是这样你能帮我看下吗



** ###################################################################
**     Processors:          MKV58F1M0VLL24
**                          MKV58F1M0VLQ24
**                          MKV58F1M0VMD24
**
**     Compiler:            IAR ANSI C/C++ Compiler for ARM
**     Reference manual:    KV5XP144M240RM Rev. 3, 02/2016
**     Version:             rev. 0.3, 2016-02-29
**     Build:               b170214
**
**     Abstract:
**         Linker file for the IAR ANSI C/C++ Compiler for ARM
**
**     Copyright 2016 Freescale Semiconductor, Inc.
**     Copyright 2016-2017 NXP
**     Redistribution and use in source and binary forms, with or without modification,
**     are permitted provided that the following conditions are met:
**
**     o Redistributions of source code must retain the above copyright notice, this list
**       of conditions and the following disclaimer.
**
**     o Redistributions in binary form must reproduce the above copyright notice, this
**       list of conditions and the following disclaimer in the documentation and/or
**       other materials provided with the distribution.
**
**     o Neither the name of the copyright holder nor the names of its
**       contributors may be used to endorse or promote products derived from this
**       software without specific prior written permission.
**
**     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
**     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
**     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
**     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
**     ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
**     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
**     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
**     ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
**     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
**     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
**     http:                 www.nxp.com
**     mail:                 support@nxp.com
**
** ###################################################################
*/

define symbol __ram_vector_table_size__ =  isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0;
define symbol __ram_vector_table_offset__ =  isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0;

define symbol m_interrupts_ram_start   = 0x00000000;
define symbol m_interrupts_ram_end     = 0x00000000 + __ram_vector_table_offset__;

define symbol m_data_start             = m_interrupts_ram_start + __ram_vector_table_size__;
define symbol m_data_end               = 0x0000FFFF;

define symbol m_interrupts_start       = 0x10000000;
define symbol m_interrupts_end         = 0x100003FF;

define symbol m_flash_config_start     = 0x10000400;
define symbol m_flash_config_end       = 0x1000040F;

define symbol m_text_start             = 0x10000410;
define symbol m_text_end               = 0x100FFFFF;

define symbol m_data_2_start           = 0x20000000;
define symbol m_data_2_end             = 0x2001FFFF;

define symbol m_data_3_start           = 0x2F000000;
define symbol m_data_3_end             = 0x2F00FFFF;

/* Sizes */
if (isdefinedsymbol(__stack_size__)) {
  define symbol __size_cstack__        = __stack_size__;
} else {
  define symbol __size_cstack__        = 0x0400;
}

if (isdefinedsymbol(__heap_size__)) {
  define symbol __size_heap__          = __heap_size__;
} else {
  define symbol __size_heap__          = 0x0400;
}

define exported symbol __VECTOR_TABLE  = m_interrupts_start;
define exported symbol __VECTOR_RAM    = isdefinedsymbol(__ram_vector_table__) ? m_interrupts_ram_start : m_interrupts_start;
define exported symbol __RAM_VECTOR_TABLE_SIZE = __ram_vector_table_size__;

define memory mem with size = 4G;
define region m_flash_config_region = mem:[from m_flash_config_start to m_flash_config_end];
define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end]
                          | mem:[from m_text_start to m_text_end];
define region DATA_region = mem:[from m_data_start to m_data_end]
                          | mem:[from m_data_2_start to m_data_2_end-__size_cstack__];
define region CSTACK_region = mem:[from m_data_2_end-__size_cstack__+1 to m_data_2_end];
define region m_interrupts_ram_region = mem:[from m_interrupts_ram_start to m_interrupts_ram_end];

define block CSTACK    with alignment = 8, size = __size_cstack__   { };
define block HEAP      with alignment = 8, size = __size_heap__     { };
define block RW        { readwrite };
define block ZI        { zi };

initialize by copy { readwrite, section .textrw };
do not initialize  { section .noinit };

place at address mem: m_interrupts_start    { readonly section .intvec };
place in m_flash_config_region              { section FlashConfig };
place in TEXT_region                        { readonly };
place in DATA_region                        { block RW };
place in DATA_region                        { block ZI };
place in DATA_region                        { last block HEAP };
place in CSTACK_region                      { block CSTACK };
place in m_interrupts_ram_region            { section m_interrupts_ram };
回复 支持 反对

使用道具 举报

该用户从未签到

2

主题

7

帖子

0

新手上路

Rank: 1

积分
27
最后登录
2018-11-4
 楼主| 发表于 2017-10-11 23:10:04 | 显示全部楼层
上面说错了 应该已经用了128k了, 256k的ram后半用不了?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|恩智浦技术社区

GMT+8, 2025-7-20 16:13 , Processed in 0.088477 second(s), 24 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表