Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
bin文件大
IMX.RT1052
30
关于imxrt1052 增加sdio链接生成bin文件的问题,
发布于 2022-04-24 16:56:24 浏览:854
订阅该版
bin文件550MB为何呢? 1.官方仓库`E:\opensource\rt-thread\bsp\imxrt\imxrt1052-nxp-evk` 增加了sdio驱动配置选项改动文件: ![image.png](https://oss-club.rt-thread.org/uploads/20220424/47d8c3f03eb966e759962fb302d53d52.png) 然后编译链接: ![image.png](https://oss-club.rt-thread.org/uploads/20220424/fc25daa054900c4bfa4b5e00d1901ce9.png) ![image.png](https://oss-club.rt-thread.org/uploads/20220424/ad20e444524f57c48e916026fc1d6729.png.webp) 链接脚本: ```c /* ** ################################################################### ** Processors: MIMXRT1052CVL5A ** MIMXRT1052DVL6A ** ** Compiler: GNU C Compiler ** Reference manual: IMXRT1050RM Rev.C, 08/2017 ** Version: rev. 0.1, 2017-01-10 ** Build: b170927 ** ** Abstract: ** Linker file for the GNU C Compiler ** ** 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: ** ** 1. Redistributions of source code must retain the above copyright notice, this list ** of conditions and the following disclaimer. ** ** 2. 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. ** ** 3. 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 ** ** ################################################################### */ /* Entry Point */ ENTRY(Reset_Handler) HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400; /* Specify the memory areas */ MEMORY { m_boot_data (RX) : ORIGIN = 0x60000000, LENGTH = 0x00001000 m_image_vertor_table (RX) : ORIGIN = 0x60001000, LENGTH = 0x00001000 m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400 m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x1F7FDC00 m_itcm (RW) : ORIGIN = 0x00000000, LENGTH = 0x00020000 m_dtcm (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000 m_ocram (RW) : ORIGIN = 0x20200000, LENGTH = 0x00040000 m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000 m_nocache (RW) : ORIGIN = 0x81E00000, LENGTH = 0x00200000 } /* Define output sections */ SECTIONS { .boot_data : { KEEP(*(.boot_hdr.conf)) } > m_boot_data .image_vertor_table : { KEEP(*(.boot_hdr.ivt)) KEEP(*(.boot_hdr.boot_data)) KEEP(*(.boot_hdr.dcd_data)) } > m_image_vertor_table /* The startup code goes first into internal RAM */ .interrupts : { __VECTOR_TABLE = .; . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); } > m_interrupts __VECTOR_RAM = __VECTOR_TABLE; __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0; /* The program code and other data goes into internal RAM */ .text : { . = ALIGN(4); *(.text) /* .text sections (code) */ *(.text*) /* .text* sections (code) */ *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ *(.glue_7) /* glue arm to thumb code */ *(.glue_7t) /* glue thumb to arm code */ *(.eh_frame) KEEP (*(.init)) KEEP (*(.fini)) . = ALIGN(4); /* section information for finsh shell */ . = ALIGN(4); __fsymtab_start = .; KEEP(*(FSymTab)) __fsymtab_end = .; . = ALIGN(4); __vsymtab_start = .; KEEP(*(VSymTab)) __vsymtab_end = .; . = ALIGN(4); /* section information for initial. */ . = ALIGN(4); __rt_init_start = .; KEEP(*(SORT(.rti_fn*))) __rt_init_end = .; } > m_text .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > m_text .ARM : { __exidx_start = .; *(.ARM.exidx*) __exidx_end = .; } > m_text .ctors : { PROVIDE(__ctors_start__ = .); /* __CTOR_LIST__ = .; */ /* gcc uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it doesn't matter if the user does not actually link against crtbegin.o; the linker won't look for a file to match a wildcard. The wildcard also means that it doesn't matter which directory crtbegin.o is in. */ KEEP (*crtbegin.o(.ctors)) KEEP (*crtbegin?.o(.ctors)) /* We don't want to include the .ctor section from from the crtend.o file until after the sorted ctors. The .ctor section from the crtend file contains the end of ctors marker and it must be last */ KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) /* __CTOR_END__ = .; */ PROVIDE(__ctors_end__ = .); } > m_text .dtors : { PROVIDE(__dtors_start__ = .); /* __DTOR_LIST__ = .; */ KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin?.o(.dtors)) KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) /* __DTOR_END__ = .; */ PROVIDE(__dtors_end__ = .); } > m_text .preinit_array : { PROVIDE_HIDDEN (__preinit_array_start = .); KEEP (*(.preinit_array*)) PROVIDE_HIDDEN (__preinit_array_end = .); } > m_text .init_array : { PROVIDE_HIDDEN (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array*)) PROVIDE_HIDDEN (__init_array_end = .); } > m_text .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); KEEP (*(SORT(.fini_array.*))) KEEP (*(.fini_array*)) PROVIDE_HIDDEN (__fini_array_end = .); } > m_text __etext = .; /* define a global symbol at end of code */ __DATA_ROM = .; /* Symbol is used by startup for data initialization */ .data : AT(__DATA_ROM) { . = ALIGN(4); __DATA_RAM = .; __data_start__ = .; /* create a global symbol at data start */ *(m_usb_dma_init_data) *(.data) /* .data sections */ *(.data*) /* .data* sections */ KEEP(*(.jcr*)) . = ALIGN(4); __data_end__ = .; /* define a global symbol at data end */ } > m_dtcm __NDATA_ROM = __DATA_ROM + (__data_end__ - __data_start__); .ncache.init : AT(__NDATA_ROM) { __noncachedata_start__ = .; /* create a global symbol at ncache data start */ *(NonCacheable.init) . = ALIGN(4); __noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */ } > m_nocache . = __noncachedata_init_end__; .ncache : { *(NonCacheable) . = ALIGN(4); __noncachedata_end__ = .; /* define a global symbol at ncache data end */ } > m_nocache __DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__); text_end = ORIGIN(m_text) + LENGTH(m_text); ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") /* Uninitialized data section */ .bss : { /* This is used by the startup in order to initialize the .bss section */ . = ALIGN(4); __START_BSS = .; __bss_start__ = .; *(m_usb_dma_noninit_data) *(.bss) *(.bss*) *(COMMON) . = ALIGN(4); __bss_end__ = .; __END_BSS = .; } > m_dtcm .stack : { . = ALIGN(8); stack_start = .; . += STACK_SIZE; stack_end = .; __StackTop = .; } > m_dtcm .RTT_HEAP : { heap_start = .; . = ALIGN(8); } > m_dtcm PROVIDE(heap_end = ORIGIN(m_dtcm) + LENGTH(m_dtcm)); .ARM.attributes 0 : { *(.ARM.attributes) } } ``` map文件 ![image.png](https://oss-club.rt-thread.org/uploads/20220424/07ec95de7ad091e60a84b509ffe5312b.png) 用到ncache section的地方: ![image.png](https://oss-club.rt-thread.org/uploads/20220424/b28ed131fb86b4f9a9230133f942be68.png.webp) ![image.png](https://oss-club.rt-thread.org/uploads/20220424/57a432eb023e234cd46cf9c9aa606b65.png.webp)
查看更多
lchnu
2022-04-24
Witness, Understand, Skill
看了你的帖子,有几个地方不明白: `截图中给出的结果是用gcc编译的,但是,提供的图和链接脚本却是mdk形式的工程、mdk中的scatter文件。` 若是用gcc编译,bin文件太大,你可以找到真实的lds文件,将.data段做一些简单修改,然后你的noncache section使用NOLOAD关键词。 这是我前几天写的一篇短文,总体想法是正确的,文章中的第三种方法有一点点小问题,还没有来得及修改。 https://club.rt-thread.org/ask/article/3677.html bin文件是没有所谓地址的,如aozima大佬所说的,会填充很多数据的,比如0x0000~0x80000000就会很大。
3
个回答
默认排序
按发布时间排序
aozima
2022-04-24
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
你新加的功能,有添加新的section,生成bin的时候又没指定只要某个section,所以就一股脑了。 请指定你要输出的section,不然你在0地址有数据,在3.9GB地址有数据,生成的BIN就有4GB了,要是64位更恐怖。 要么改代码,直接在代码直接引用地址,这样就不用改。
xiaoyu
2022-04-24
这家伙很懒,什么也没写!
困扰
撰写答案
登录
注册新账号
关注者
0
被浏览
854
关于作者
xiaoyu
这家伙很懒,什么也没写!
提问
27
回答
27
被采纳
1
关注TA
发私信
相关问题
1
gcc交叉编译器编译stm32项目代码,bin文件比keil编译的大很多。
2
rtthread studio生成hex文件正常,bin文件太大
3
如何将rt_hw_interrupt_disable放置RAM 中运行
4
RT1061/1052 带 RTT + LWIP和LPSPI,有什么坑要注意吗?
5
SFUD无法探测到flash
6
rt1052 bootloader跳转需要注意啥
7
RTthread在RT1052上的文件系统挂载与卸载
8
野火imxrt1052的bsp中缺少drv_sdio.c文件
9
microPython移植到正点原子RT1052开发板出现问题
10
rt1052能支持ap6181的驱动吗
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
at_device
ulog
C++_cpp
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
张世争
9
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
a1012112796
13
个答案
1
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
本月文章贡献
程序员阿伟
6
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
2
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部