OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2968|回复: 2

请教关于malloc的使用

[复制链接]

7

主题

16

帖子

0

精华

初级会员

Rank: 2

积分
127
金钱
127
注册时间
2017-6-29
在线时间
16 小时
发表于 2017-12-12 10:33:58 | 显示全部楼层 |阅读模式
1金钱
添加原子哥写的malloc文件到工程下,初始化之后出现空间不足,是怎么回事,刚接触内存分配的问题,诸多不懂,望遇到类似问题的朋友指教,

usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching malloc.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f105xc.o(HEAP).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching malloc.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f105xc.o(STACK).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching usb_host.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching usbh_conf.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching uart.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching malloc.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching usbh_msc.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching ff.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching ff_gen_drv.o(.bss).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching ff.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching uart.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching fatfs.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f1xx_hal.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching delay.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching system_stm32f1xx.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching stdout.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching mvars.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching mvars.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f1xx_it.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6406E: No space in execution regions with .ANY selector matching usb_host.o(.data).
usbhost Configuration\usbhost Configuration.axf: Error: L6407E: Sections of aggregate size 0x1d588 bytes could not fit into .ANY selector(s).

最佳答案

查看完整内容[请看2#楼]

例程的malloc中会定义一个很大的数组,这个数组定义在内部ram中,malloc内存申请就是从这个数组中申请的,错误提示是RAM不够了,说明这个数组太大了,把这个数组改小,直到能编译下去。
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

88

主题

7377

帖子

5

精华

资深版主

Rank: 8Rank: 8

积分
14980
金钱
14980
注册时间
2013-11-13
在线时间
1823 小时
发表于 2017-12-12 10:33:59 | 显示全部楼层
例程的malloc中会定义一个很大的数组,这个数组定义在内部ram中,malloc内存申请就是从这个数组中申请的,错误提示是RAM不够了,说明这个数组太大了,把这个数组改小,直到能编译下去。
回复

使用道具 举报

7

主题

16

帖子

0

精华

初级会员

Rank: 2

积分
127
金钱
127
注册时间
2017-6-29
在线时间
16 小时
 楼主| 发表于 2017-12-12 10:51:33 | 显示全部楼层
zuozhongkai 发表于 2017-12-12 10:47
例程的malloc中会定义一个很大的数组,这个数组定义在内部ram中,malloc内存申请就是从这个数组中申请的, ...

谢谢。果然没错误了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-7-24 05:38

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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