华芯微特开发论坛

 找回密码
 立即注册
搜索
热搜: SWM341 资料
查看: 124|回复: 5

SWM341 GCC sdram Linkscript

[复制链接]

6

主题

21

帖子

90

积分

注册会员

Rank: 2

积分
90
发表于 2024-3-21 13:36:06 | 显示全部楼层 |阅读模式
  1. MEMORY
  2. {
  3.         ROM   (arx) : ORIGIN = 0x00000000,    LENGTH = 0x00080000 /* 512k */
  4.     RAM   (arw) : ORIGIN = 0x20000000,    LENGTH = 0x00010000 /*  64k */
  5.     SDRAM (xrw)            : ORIGIN = 0x80000000, LENGTH = 2*1024*1024 /* 2M */
  6. }
复制代码
ld修改如上

定义变量
  1. static uint8_t Read_Buff[480*272*2] __attribute__(( section(".SDRAM"), aligned(4) ));
  2. static uint8_t Write_Buff[480*272*2] __attribute__(( section(".SDRAM"), aligned(4) ));
复制代码


    for(int i= 0; i<4;i++)
    {
    Read_Buff = str;
    }




出现错误
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: out/00_template.elf section `.SDRAM' will not fit in region `RAM'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: out/00_template.elf section `.SDRAM' will not fit in region `ROM'
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: region RAM overflowed with stack
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: region `ROM' overflowed by 38168 bytes
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: region `RAM' overflowed by 475324 bytes

回复

使用道具 举报

13

主题

47

帖子

394

积分

超级版主

Rank: 8Rank: 8

积分
394
发表于 2024-3-21 17:08:25 | 显示全部楼层


改成这样试试:
  1. /* Entry Point */
  2. ENTRY(Reset_Handler)

  3. /* Define the available memory regions in your embedded system */
  4. MEMORY
  5. {
  6.         ROM   (arx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 /* 512k */
  7.         RAM   (arw) : ORIGIN = 0x20000000, LENGTH = 0x00010000 /*  64k */
  8.         SDRAM (arw) : ORIGIN = 0x80000000, LENGTH = 0x00200000
  9. }

  10. /* Specify the placement of different sections within the memory regions defined in the MEMORY block */
  11. SECTIONS
  12. {
  13.         .text :
  14.         {
  15.                 KEEP(*(.isr_vector))

  16.                 *(.text)
  17.                 *(.text*)
  18.                 *(.rodata*)
  19.                 . = ALIGN(4);
  20.         } > ROM

  21.         __data_load__ = LOADADDR(.data);

  22.         .data :
  23.         {
  24.                 __data_start__ = .;
  25.                
  26.                 *(.data)
  27.                 *(.data*)
  28.                 . = ALIGN(4);

  29.                 __data_end__ = .;
  30.         } > RAM AT> ROM

  31.         .bss :
  32.         {
  33.                 __bss_start__ = .;

  34.                 *(.bss)
  35.                 *(.bss*)
  36.                 *(COMMON)
  37.                 . = ALIGN(4);

  38.                 __bss_end__ = .;
  39.         } > RAM

  40.         .heap :
  41.         {
  42.                 end = .;
  43.                 __HeapBase = .;

  44.                 *(.heap)
  45.         } > RAM

  46.         .stack_dummy :
  47.         {
  48.                 *(.stack)
  49.         } > RAM

  50.         __StackTop   = ORIGIN(RAM) + LENGTH(RAM);
  51.         __StackLimit = __StackTop - SIZEOF(.stack_dummy);
  52.         ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")

  53.         .SDRAM :
  54.         {
  55.                 *(.SDRAM)
  56.         } > SDRAM
  57. }
复制代码


回复

使用道具 举报

6

主题

21

帖子

90

积分

注册会员

Rank: 2

积分
90
 楼主| 发表于 2024-3-23 13:20:34 | 显示全部楼层
编译是通过了

下载出问题
回复

使用道具 举报

6

主题

21

帖子

90

积分

注册会员

Rank: 2

积分
90
 楼主| 发表于 2024-3-27 17:17:18 | 显示全部楼层
这个能编译,不能下载进去能解决不。  SWMPROGAM 下载一直在写flash  停不下来
回复

使用道具 举报

13

主题

47

帖子

394

积分

超级版主

Rank: 8Rank: 8

积分
394
发表于 2024-3-27 20:45:36 | 显示全部楼层
pophu 发表于 2024-3-27 17:17
这个能编译,不能下载进去能解决不。  SWMPROGAM 下载一直在写flash  停不下来


如果 SWD 下载有问题,,可以试下 ISP 下载,,ISP 下载是解救芯片的终极手段。。

左上角“资料下载”链接中有 ISP 上位机软件。。
回复

使用道具 举报

6

主题

21

帖子

90

积分

注册会员

Rank: 2

积分
90
 楼主| 发表于 2024-3-28 11:51:52 | 显示全部楼层
关键是写不进去,程序不能运行
LD 文件还是有问题
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|华芯微特开发论坛

GMT+8, 2024-5-20 14:44 , Processed in 0.028233 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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