d:/mounriver_studio/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: SDIO-FATFS-TEST.elf section `.bss' will not fit in region `RAM'
d:/mounriver_studio/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: section .stack VMA [0000000020007800,0000000020007fff] overlaps section .bss VMA [00000000200000c0,0000000020015923]
d:/mounriver_studio/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: region `RAM' overflowed by 0 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:59: SDIO-FATFS-TEST.elf] Error 1
移植的原子的程序,感觉是malloc的问题
malloc.h
//定义三个内存池
#define SRAM1 0 //内部内存池SRAM1
#define SRAM2 1 //内部内存池SRAM2
#define SRAMBANK 2 //定义支持的SRAM块数.
//mem1内存参数设定.mem1处于内部SRAM1里面.
#define MEM1_BLOCK_SIZE 64 //内存块大小为64字节
#define MEM1_MAX_SIZE 50*1024 //SRAM2空间为96K
#define MEM1_ALLOC_TABLE_SIZE MEM1_MAX_SIZE/MEM1_BLOCK_SIZE //内存表大小
//mem2内存参数设定.mem2处于内部SRAM2里面.
#define MEM2_BLOCK_SIZE 64 //内存块大小为64字节
#define MEM2_MAX_SIZE 30 *1024 //SRAM2空间为32K
#define MEM2_ALLOC_TABLE_SIZE MEM2_MAX_SIZE/MEM2_BLOCK_SIZE //内存表大小
malloc.c
//内存池(32字节对齐)
__attribute__((aligned(32))) u8 mem1base[MEM1_MAX_SIZE]; //内部SRAM1内存池
__attribute__((aligned(32))) u8 mem2base[MEM2_MAX_SIZE]__attribute__((at(0X20000000))); //内部SRAM2内存池
//内存管理表
u32 mem1mapbase[MEM1_ALLOC_TABLE_SIZE]; //内部SRAM1内存池MAP
u32 mem2mapbase[MEM2_ALLOC_TABLE_SIZE]__attribute__((at(0X20000000 + MEM2_MAX_SIZE))); //内部SRAM2内存池MAP