【问题标题】:Unable to copy array in PIC24FJ256GB206 with C30 compiler无法使用 C30 编译器复制 PIC24FJ256GB206 中的数组
【发布时间】:2019-01-06 14:58:03
【问题描述】:

我正在尝试将一个数组复制到另一个 PIC24 PIC24FJ256GB206 microcontrollerC30 compiler 中。我的数组长度超过1500 bytes. 这是我的代码:-

int i=0;
int count = sizeof(rx.data.buff.fields.data);
for(i=0;i<count;i++)
{
    rec.data.data_block.data[i] = rx.data.buff.fields.data[i];
}

但是当我编译我的代码时,我得到了这个错误:-

build/SINGLE_PORT_BAUD57600/production/_ext/733800733/rdso_icd_0065.o(.text+0x1604)c:\program files (x86)\microchip\mplab c30\bin\bin\..\bin/pic30-elf-ld.exe: Dwarf Error: found address size '3', this reader can only handle address sizes '2', '4' and '8'.
: In function `.LM403':
: undefined reference to `_rec'
make[2]: *** [dist/SINGLE_PORT_BAUD57600/production/StandaloneHCD.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

显然这不是逻辑问题。但这可能是什么原因?解决方案是什么?谢谢

【问题讨论】:

  • 错误消息的重要部分是“未定义对'_rec'的引用”。这意味着您有一个rec 的声明,但是实际上定义了rec定义 缺失。它是否在您应该构建的另一个源文件中定义?您是否缺少与库或目标文件的链接?
  • 你有理由不只使用memcpy吗?
  • 得到了我的问题。我有链接问题

标签: c arrays memory out-of-memory mplab


【解决方案1】:

如果您有超过 8 KB 的数据,则必须将数据模型切换为大:

ProjectProperties / Conf: / Memory model / Data model = Large

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多